Skip to content

Instantly share code, notes, and snippets.

View hysios's full-sized avatar
🎯
Focusing

hysios hysios

🎯
Focusing
View GitHub Profile
export POW_TIMEOUT=10000
export POW_WORKERS=3
export POW_TIMEOUT=10000
export POW_WORKERS=3
echo export POW_TIMEOUT=10000 >> ~/.powconfig
echo export POW_WORKERS=3 >> ~/.powconfig
powpid=$(ps -eaf|grep pow |grep -v grep |awk '{print $2}')
echo "kill $powpid"
sudo kill $powpid
@hysios
hysios / rails_console
Created May 24, 2012 07:02
install production rails console
yum install readline-devel
rvm pkg install readline
rvm reinstall 1.9.2 --with-readline-dir=$rvm_path/usr
cd /var/www/neza/current
bundle exec rails c production
@hysios
hysios / AjaxAuth
Created January 16, 2013 07:40
AjaxAuth
// client = new AjaxAuthClient({
//
// })
// AjaxAuth.registerDialog(function(element){
// $(element)
// .appendTo('body')
// .addClass('center_model')
// .width(400)
@hysios
hysios / sprites.js
Created October 15, 2013 07:00
sprites server
// includes
var cluster = require('cluster');
var cpuCount = require('os').cpus().length;
var util = require("util");
var http = require("http");
var url = require('url');
var fs = require('fs');
// max number of connections
var MAX_CONNECTIONS = 1000000;
@hysios
hysios / path-distance.rb
Last active August 29, 2015 14:01
path-distance 1
def distance_between v,w
dist = 0
adj[v].each do |e|
dist = e.weight if e.to == w
end
return dist
end
#receive a path str like "A-B-C", return length of that path
def path_distance str
import Ember from 'ember';
var get = Ember.get;
export default Ember.Component.extend({
didInsertElement: function(){
Ember.$(document).bind('click', this.closeThis);
},
closeThis: function(event) {
@hysios
hysios / index-array.js
Last active August 29, 2015 14:06
ember highlight a item in menu
/* lib/index-array.js */
App.IndexArray = Ember.ArrayController.extend({
_indexName: 'index',
_isVirtual: true,
/**
* initializer function
*
* @param [Array] array proxy target object
@hysios
hysios / convert_bgm_to_m4a.sh
Last active January 12, 2017 06:10
将所有背景音乐转换成 底 bit 的音轨
for f in *.aac; do ffmpeg -y -i $f -c:a libfdk_aac -b:a 32k -ac 1 $(basename $f .aac).m4a; done