Skip to content

Instantly share code, notes, and snippets.

On the way to refactoring

othree othree

On the way to refactoring
Block or report user

Report or block othree

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View happy-desinger-mini-1.md

JavaScript 品質工具:CodePaint 與 Plato

介紹協助提昇 F2E Code Style 的兩個工具。

分享者

josephj@faria

問題

View acp-custom-behaves.vim
let behavs = { 'javascript': [], 'html': [] }
call add(behavs.javascript, {
\ 'command' : "\<C-x>\<C-u>",
\ 'completefunc' : 'acp#completeSnipmate',
\ 'meets' : 'acp#meetsForSnipmate',
\ 'onPopupClose' : 'acp#onPopupCloseSnipmate',
\ 'repeat' : 0,
\})
call add(behavs.javascript, {
\ 'command' : g:acp_behaviorKeywordCommand,
@othree
othree / 0_reuse_code.js
Last active Aug 29, 2015
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View Promise Sequential.js
var T = function (id) {
var p = new Promise(function (resolve) {
setTimeout(function () {
console.log(id, 'resolved');
resolve(id);
}, Math.random()*3000);
});
return p;
View gist:17e9fb5614c0e3a4eb2e
var removeElements = function(head, val) {
if (head === null) { return null; }
if (head.val === val) {
return removeElements(head.next, val);
} else {
head.next = removeElements(head.next, val);
}
return head;
};
View gist:367ed6f793953803c420
var rangeBitwiseAnd = function(m, n) {
if (m === 0) { return 0; }
if (m === n) { return m; }
var min = m;
var l2m = Math.floor(Math.log2(m)) + 1;
var l2n = Math.floor(Math.log2(n)) + 1;
if (l2m !== l2n) { return 0; }
@othree
othree / convert_textile_to_markdown.rake
Created Jun 4, 2015
redmine_convert_textile_to_markdown.rake
View convert_textile_to_markdown.rake
task :convert_textile_to_markdown => :environment do
require 'tempfile'
WikiContent.all.each do |wiki|
([wiki] + wiki.versions).each do |version|
textile = version.text
src = Tempfile.new('textile')
src.write(textile)
src.close
dst = Tempfile.new('markdown')
dst.close
View gist:77cfdfef52c5b82a1fb3
git config --global alias.user '!f() { if [ "$1" = "360" ]; then git config user.name "othree"; git config user.email othree@360.cn; else git config user.name "othree"; git config user.email othree@gmail.com; fi; }; f'
View ghcjs.md
View foxmosa-telegram.json
{
"celebrate":"BQADBQADhwADMqsKAuEXXyu4ilLCAg",
"busy bee":"BQADBQADogADMqsKAiykgKeu_QqfAg",
"enthusiast":"BQADBQADpAADMqsKAvrSFOHsu44HAg",
"evergreen":"BQADBQADpgADMqsKAuYN0dN0aGTUAg",
"middle manager":"BQADBQADqAADMqsKAvnjyOmGak8JAg",
"stalwart":"BQADBQADqgADMqsKAruaTkuu2qMjAg",
"wizard":"BQADBQADrAADMqsKAsOBf5BSdIygAg",
"happy":"BQADBQADrgADMqsKAk-8VDZI5syBAg",
"angry":"BQADBQADsAADMqsKAsjoJq9W1mnJAg",
You can’t perform that action at this time.