Skip to content

Instantly share code, notes, and snippets.

View heruputra's full-sized avatar
🌴
On vacation

Heru Hang Tryputra heruputra

🌴
On vacation
  • Yogyakarta, Indonesia
View GitHub Profile
(function($) {
$(function() {
$(".print").live('click', function(e) {
e.preventDefault();
// remove old printframe
$("#printframe").remove();
// create new printframe
<?php
$ip = '127.0.0.1';
$port = '9051';
$auth = 'PASSWORD';
$command = 'signal NEWNYM';
$fp = fsockopen($ip,$port,$error_number,$err_string,10);
if(!$fp) { echo "ERROR: $error_number : $err_string";
return false;
{
"name": "cakephp-application",
"repositories": [
{
"type": "pear",
"url": "http://pear.cakephp.org"
}
],
"require": {
"pear-cakephp/cakephp": ">=2.4.0"
<?php
/**
* Simple excel writer class with no external dependencies, drop it in and have fun
* @author Matt Nowack
* @license Unlicensed
* @version 1.0
*/
class Excel {
private $col;
@heruputra
heruputra / gist:7672924
Last active December 29, 2015 12:49
untuk udin
<?php
// ini di controller
// nama file BlogController.php
class BlogController extends BaseController {
public function index() {
$posts = Post::all();
var fs = require('fs')
, path = require('path')
, _ = require('underscore');
var rootPath = "/path/to/remove";
removeDirForce(rootPath);
// path should have trailing slash
function removeDirForce(dirPath) {
fs.readdir(dirPath, function(err, files) {
// api/controllers/AuthController.js
var passport = require('passport');
var AuthController = {
login: function (req,res)
{
res.view();
},
module.exports = {
/**
*
* Using raw socket.io functionality from a Sails.js controller
*
*/
index: function (req,res) {
sudo apt-get update
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password root'
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password root'
sudo apt-get install -y vim curl python-software-properties
sudo add-apt-repository -y ppa:ondrej/php5
sudo apt-get update
sudo apt-get install -y php5 apache2 libapache2-mod-php5 php5-curl php5-gd php5-mcrypt php5-readline mysql-server-5.5 php5-mysql git-core php5-xdebug
<?php namespace Smile\Services\Creators;
use Illuminate\Validation\Factory as Validator;
abstract class Creator implements CreatorInterface
{
protected $model;
protected $errors;