Skip to content

Instantly share code, notes, and snippets.

View tistaharahap's full-sized avatar

Batista Harahap tistaharahap

View GitHub Profile
@tistaharahap
tistaharahap / Hsock.php
Created January 20, 2012 03:35
HandlerSocket Client for CodeIgniter
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* HandlerSocket Library for CodeIgniter
*
* To use this class, please use HandlerSocket's PHP extension available at
* http://code.google.com/p/php-handlersocket/
*
* @package CodeIgniter Library
* @subpackage HandlerSocket
@tistaharahap
tistaharahap / MY_Output.php
Created February 2, 2012 19:33
Hacking CodeIgniter for Persistent Timestamped Cache with Memcache
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class MY_Output extends CI_Output {
function _display($output = '') {
$elapsed = $BM->elapsed_time('total_execution_time_start', 'total_execution_time_end');
$output = str_replace('{elapsed_time}', $elapsed, $output);
$memory = ( ! function_exists('memory_get_usage')) ? '0' : round(memory_get_usage()/1024/1024, 2).'MB';
$output = str_replace('{memory_usage}', $memory, $output);
@tistaharahap
tistaharahap / CellTowerLocation.java
Created February 3, 2012 05:29
Blackberry Cell Tower Location
package com.urbanesia.api;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import javax.microedition.io.Connector;
import javax.microedition.io.HttpConnection;
@tistaharahap
tistaharahap / LICENSE.txt
Created February 15, 2012 14:42 — forked from 140bytes/LICENSE.txt
140byt.es -- Click ↑↑ fork ↑↑ to play!
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@tistaharahap
tistaharahap / OAUTHnesia.cs
Created April 2, 2012 10:37
OAUTHnesia for Windows 8 Metro Apps C#
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using System.Threading.Tasks;
/**
* OAUTHnesia for Windows 8 Metro Apps C#
*
* OAUTH v1.0a library for C# to access Urbanesia API
@tistaharahap
tistaharahap / gist:2522184
Created April 28, 2012 21:29
DNSMasq Install & Configuration using Homebrew
# If you don't have Homebrew installed, you should. Do this.
/usr/bin/ruby -e "$(/usr/bin/curl -fksSL https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew.rb)"
# Install DNSMasq from Homebrew
brew install dnsmasq
# Create a directory for virtual hosts files
mkdir -p /usr/local/etc/dnsmasq.d
# Create a config for DNSMasq
@tistaharahap
tistaharahap / config.log
Created July 17, 2012 19:53
Failed building PHP 5.3.14 on Mountain Lion Golden Master
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
configure:1897: checking for Cygwin environment
configure:1913: /usr/bin/clang -c -Os -w -pipe -march=native -Qunused-arguments -mmacosx-version-min=10.8 -I/usr/local/Cellar/libxml2/2.8.0/include -I/usr/local/Cellar/gettext/0.18.1.1/include -isystem /usr/local/include conftest.c 1>&5
configure:1909:8: error: use of undeclared identifier '__CYGWIN32__'
return __CYGWIN__;
^
configure:1907:20: note: expanded from macro '__CYGWIN__'
#define __CYGWIN__ __CYGWIN32__
@tistaharahap
tistaharahap / header.html
Created July 21, 2012 00:13
Techtorial - Responsive with Zurb Foundation & HTML5 - Header
<header class="row">
<div class="twelve columns">
<h1>DailySocial Reader</h1>
<p>A simple reader for DailySocial built with Zurb Foundation 3.0 &amp; HTML5.</p>
<hr />
</div>
</header>
@tistaharahap
tistaharahap / belly.html
Created July 21, 2012 00:20
Techtorial - Responsive with Zurb Foundation & HTML5 - Belly
<section class="row" id="belly">
<div class="eight columns" id="left"></div>
<div class="three columns" id="right">
<div class="row">
<div class="twelve columns">
<h5>About DailySocial</h5>
<p>DailySocial.net adalah sebuah blog yang membahas mengenai berita-berita teknologi web dan internet dari dalam dan luar negeri. Kami membahas strategi-strategi perusahaan IT/Web global, dan juga memperkenalkan startup-startup Indonesia.</p>
<p><a href="http://dailysocial.net/contact/" target="_blank">Kontak kami &raquo;</a></p>
</div>
</div>
@tistaharahap
tistaharahap / footer.html
Created July 21, 2012 00:24
Techtorial - Responsive with Zurb Foundation & HTML5 - Footer