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
module.exports = {
/**
*
* Using raw socket.io functionality from a Sails.js controller
*
*/
index: function (req,res) {
// api/controllers/AuthController.js
var passport = require('passport');
var AuthController = {
login: function (req,res)
{
res.view();
},
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) {
@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();
<?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;
{
"name": "cakephp-application",
"repositories": [
{
"type": "pear",
"url": "http://pear.cakephp.org"
}
],
"require": {
"pear-cakephp/cakephp": ">=2.4.0"
<?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;
(function($) {
$(function() {
$(".print").live('click', function(e) {
e.preventDefault();
// remove old printframe
$("#printframe").remove();
// create new printframe