Skip to content

Instantly share code, notes, and snippets.

View llun's full-sized avatar
:octocat:

Maythee Anegboonlap llun

:octocat:
View GitHub Profile
@llun
llun / archive.sh
Last active August 29, 2015 14:04
Debian CDN error
wget -q https://ftp-master.debian.org/keys/archive-key-7.0.asc -O- | sudo apt-key add -
@llun
llun / build.gradle
Last active August 29, 2015 14:03
Gradle plugin project build file
apply plugin: 'groovy'
apply plugin: 'maven'
group = 'com.gimmie'
version = '1.0'
repositories {
mavenCentral()
}
root 22872 0.0 0.0 140208 568 ? S Apr14 0:00 CROND
root 22876 0.0 0.0 106056 516 ? Ss Apr14 0:00 /bin/bash -c /usr/bin/php -q /etc/zpanel/panel/bin/daemon.php >> /dev/null 2>&1
root 22880 0.0 0.1 342820 2748 ? S Apr14 0:00 /usr/bin/php -q /etc/zpanel/panel/bin/daemon.php
@llun
llun / figure1
Created April 1, 2014 15:31
setTimeout
setTimeout(function () {
// do something.
}, 1000)
@llun
llun / gist:9431872
Created March 8, 2014 15:05
Nodejitsu nomem error
error: Error: spawn ENOMEM
error: at errnoException (child_process.js:855:11)
error: at ChildProcess.spawn (child_process.js:802:11)
error: at exports.spawn (child_process.js:626:9)
error: at tailLog (/opt/local/lib/node_modules/solenoid/lib/solenoid.js:473:18)
error: at /opt/local/lib/node_modules/solenoid/lib/solenoid.js:468:15
error: at delay (/opt/local/lib/node_modules/solenoid/node_modules/back/index.js:39:5)
error: at Timer.list.ontimeout (timers.js:101:19)
@llun
llun / gist:5779766
Created June 14, 2013 05:58
JSON as HAML style template
{
"head":
{
"script": {
"attribute": {
"type": "text/javascript",
"src": "http://site/js/application.js"
}
},
"script": {
@llun
llun / gist:5082353
Last active December 14, 2015 11:50
Expect to run success but got error with below result actual expected 1{}
var chai = require('chai'),
sinon = require('sinon'),
sinon_chai = require('sinon-chai'),
chai_as_promised = require('chai-as-promised'),
should = require('chai').should(),
mongoose = require('mongoose'),
q = require('q');
chai.use(sinon_chai);
chai.use(chai_as_promised);
describe("method", function() {
it("should call model with argument", function() {
spyOn(model, 'list').andCallFake(function(page, limit) {
expect(page).toBe(0);
expect(limit).toBe(10);
});
routes.list({ query: { page: 0, limit: 10 }, {});
})
})
Aaron Swartz
We are deeply saddened to hear the news about Aaron Swartz. We extend our heartfelt condolences to Aaron’s family, friends, and everyone who loved, knew, and admired him. He was a truly gifted person who made important contributions to the development of the internet and the web from which we all benefit.
We have had inquiries about JSTOR’s view of this sad event given the charges against Aaron and the trial scheduled for April. The case is one that we ourselves had regretted being drawn into from the outset, since JSTOR’s mission is to foster widespread access to the world’s body of scholarly knowledge. At the same time, as one of the largest archives of scholarly literature in the world, we must be careful stewards of the information entrusted to us by the owners and creators of that content. To that end, Aaron returned the data he had in his possession and JSTOR settled any civil claims we might have had against him in June 2011.
JSTOR is a not-for-profit service and a member of the i
@llun
llun / all.js
Created October 3, 2012 16:26
CORS in Facebook SDK
__d("CORSRequest", ["wrapFunction", "QueryString"], function (a, b, c, d, e, f) {
var g = b('wrapFunction'),
h = b('QueryString');
function i(l, m) {
if (!window.XMLHttpRequest) return null;
var n = new XMLHttpRequest(),
o = function () {};
if ('withCredentials' in n) {
n.open(l, m, true);