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 / 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 / figure1
Created April 1, 2014 15:31
setTimeout
setTimeout(function () {
// do something.
}, 1000)
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 / 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()
}
@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 / .profile
Last active August 29, 2015 14:04
Shell alias for Docker
docker_get_name_from_image() {
echo $@ | sed "s/\//./"
}
docker_remove_exists_name() {
local name=`docker_get_name_from_image $2`
local exists=`sudo docker ps -a | grep $name | awk '{ print $1 }'`
if [ -n "$exists" ]; then
sudo docker rm $name > /dev/null 2>&1
fi
@llun
llun / toc.js
Created October 21, 2014 03:18
Create TOC from Github markdown page
var toc = '';
for (var i = 0; i < contents.length; i++) { var link = contents[i].querySelector('a').getAttribute('href'); var text = contents[i].textContent.replace(/^\s+|\s+$/,''); toc += '- [' + text + '](' + link + ')\n' }
console.log (toc);
@llun
llun / in.js
Created February 15, 2015 01:18
generated from 6to5
let obj = [1, 2, 3]
for (let val of obj) {
console.log (val)
}
@llun
llun / helper1.js
Created March 10, 2015 14:37
Ember.js helper
Ember.Handlebars.registerHelper('helperName', function(param1, param2, options) {
return "HTML output for this helper"
})
@llun
llun / gulpfile.js
Created March 13, 2015 06:23
Jasmine ES6
var gulp = require('gulp')
, jasmine = require('gulp-jasmine')
gulp.task('default', function() {
require('babel/register');
return gulp.src('test.js').pipe(jasmine())
});