Skip to content

Instantly share code, notes, and snippets.

@hSammir
hSammir / shBrushLatex.js
Created November 1, 2014 08:31
Alex Gorbatchev SyntaxHighlighter Brush:Latex
/**
* SyntaxHighlighter LaTeX Brush by DiGMi
* http://digmi.org
*
* Used for SyntaxHighlighter which can be found at:
* http://alexgorbatchev.com/SyntaxHighlighter
*
* @version
* 1.0.0 (July 21 2012)
*
@hSammir
hSammir / backpro.py
Last active November 6, 2022 11:35
Implementasi algoritma back propagation (jaringan syaraf tiruan) pada bahasa pemrograman python. Sumber: http://stackoverflow.com/questions/2276933/good-open-source-neural-network-python-library
# Back-Propagation Neural Networks
#
# Written in Python. See http://www.python.org/
# Placed in the public domain.
# Neil Schemenauer <nas@arctrix.com>
import math
import random
import string
@hSammir
hSammir / angg.php
Last active August 29, 2015 14:02
Menampilkan daftar berita plus gambar *hanya* untuk list berita ter atas.
<?php
/*
Asumsikan database:
| Judul Berita | Kutipan berita | Gambar |
*/
$data = [
[
'jb' => 'Workshop Pengenalan Drupal',
@hSammir
hSammir / rtmp.conf
Created May 7, 2014 03:13
Contoh konfigurasi nginx-rtmp-module.
events {
worker_connections 1024; ## Default: 1024
}
http {
server {
listen 8080;
server_name localhost;
@hSammir
hSammir / shoutcast.sh
Last active November 12, 2017 15:51
Shoutcast Server Initscript.
#!/bin/sh
#
# chkconfig: 345 99 01
#
# description: shoutcast server startup script
#
# Init script for SHOUTcast
# by caraoge, modified to work correctly by Thomas R Bailey, modified further for
# use with three servers by Nathan Skelton
#
@hSammir
hSammir / index.php
Created November 6, 2012 04:49
Rest web service dengan memanfaatkan Slim Framework.
<?php
require 'Slim/Slim.php';
\Slim\Slim::registerAutoloader();
$app = new \Slim\Slim();
// route
$app->get("/blog/post", function() use($app) {
// tampilkan semua post
$sql = "select * from post";
@hSammir
hSammir / phpa-norl
Created June 12, 2012 14:49
PHP interactive shell for no read line operating systems (Windows, Mac Os)
#!/usr/bin/php
<?php
/*
$Id: phpa-norl.php 2010/06/16 $
Stefan Fischerländer <stefan@fischerlaender.de>, http://www.fischerlaender.net/php/phpa-norl
original version: David Phillips <david@acz.org>, http://david.acz.org/phpa/
2010/07/16 - register_shutdown_function
@hSammir
hSammir / hredisdot.php
Created December 8, 2010 17:20
Redis PHP Bindings - Penambahan fungsi auth() u/ mendukung authentikasi.
<?php
/*******************************************************************************
* Redis PHP Bindings - http://code.google.com/p/redis/
*
* Copyright 2009 Ludovico Magnocavallo
* Released under the same license as Redis.
*
* Version: 0.1
*
* $Revision: 139 $
@hSammir
hSammir / phprediska.php
Created November 5, 2010 16:14
POC Koneksi PHP + Redis menggunakan rediska.
<?php
/*
* PHP + Redis dgn rediska
* Kode POC ini di ciplak dari: http://rediska.geometria-lab.ru/documentation/get-started/
* Rediska: http://rediska.geometria-lab.ru/
*
*/
// Opsi konfigurasi rediska, alamat ip redis server dan port yg digunakan. (lihat redis.conf)
@hSammir
hSammir / sq2.php
Created November 5, 2010 13:09
Koneksi PHP, Sqlite3 dgn Pendekatan OOP.
<?php
/**
* Sumber: http://id2.php.net/manual/en/sqlite3.open.php
* Sesuaikan file database sqlite3 (dlm contoh: sqlite/data)
*/
class MyDB extends SQLite3
{
function __construct()
{
$this->open('sqlite/data');