Skip to content

Instantly share code, notes, and snippets.

View hellowin's full-sized avatar
:octocat:
Working from office

Andi N. Dirgantara hellowin

:octocat:
Working from office
View GitHub Profile
@hellowin
hellowin / prng.js
Created September 17, 2016 08:14 — forked from Protonk/prng.js
Various PRNGs, implemented in javascript.
// Linear Congruential Generator
// Variant of a Lehman Generator
var lcg = (function() {
// Set to values from http://en.wikipedia.org/wiki/Numerical_Recipes
// m is basically chosen to be large (as it is the max period)
// and for its relationships to a and c
var m = 4294967296,
// a - 1 should be divisible by m's prime factors
a = 1664525,
// c and m should be co-prime
@hellowin
hellowin / README.md
Created May 20, 2016 05:28 — forked from MethodGrab/README.md
Jenkins NodeJS Plugin: Missing nodejs.org installers

Jenkins NodeJS Plugin: Missing nodejs.org installers

Versions

  • Ubuntu 14.04 LTS x64
  • Java 1.7
  • Jenkins 1.639
  • NodeJS plugin 0.2.1
@hellowin
hellowin / constructor
Last active August 29, 2015 14:21
Javascript Copy Object Reference
// using constructor to clone object
var A = function(){
this.array = ['a','b','c'];
};
var a = new A();
console.log(a.array);
// ["a", "b", "c"]
var b = new A();
@hellowin
hellowin / login.dust
Created May 4, 2015 02:03
sails-permissions error at sails 0.11.0
<div class="container">
<div class="row">
<div class="col-xs-offset-4 col-xs-4">
<div class="section-title"><span>Login Form</span></div>
{#errors}
<div class="alert alert-danger alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span
class="sr-only">Close</span></button>{@i18n}{.}{/i18n}</div>
{/errors}
<form role="form" action="/auth/local" method="post" class="cannes-form">
package controllers
import play.api.mvc._
import scala.concurrent._
import akka.actor.{Props, Actor}
import play.api.Play.current
import play.api.libs.concurrent.Akka
import scala.concurrent.ExecutionContext.Implicits._
object Application extends Controller {
@hellowin
hellowin / Laravel Call Artisan
Created October 26, 2014 05:35
Call Artisan fromm Laravel routes
//Example for force install DB
Route::get('/install', function()
{
echo '<br>init migrate';
Artisan::call('migrate');
echo 'done migrate';
echo '<br>init with tables seeder...';
Artisan::call('db:seed');
echo '<br>done with tables seeder';