hg clone https://code.google.com/p/chromium-compact-language-detector
cd chromium-compact-language-detector/src
curl https://chromium-compact-language-detector.googlecode.com/hg-history/51f2ced495a49d78267239da0184a61cb7519a06/build.sh > build.sh
curl https://gist.github.com/curist/2767346/raw/e21a1c52e84ee6e867995323e7eb228c91f1786c/example.cc > example.cc
sh ./build.sh
cp example ~/bin/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var net = require('net'); | |
| var isPrime = (function() { | |
| var table = new Array(2000000); | |
| var len = table.length; | |
| var sqrtlen = Math.ceil(Math.sqrt(len)); | |
| for (var i = 2; i < sqrtlen; i++) { | |
| if(table[i]) { | |
| continue |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| require 'readline' | |
| require 'json' | |
| require 'uri' | |
| # for lang_detect you may want to check https://gist.github.com/2767346 | |
| LANG_DETECTOR = 'lang_detect' | |
| class GoogleTranslate | |
| def initialize |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var github = (function(){ | |
| function render(target, repos){ | |
| var i = 0, fragment = '', t = $(target)[0]; | |
| for(i = 0; i < repos.length; i++) { | |
| fragment += '<li><a href="'+repos[i].url+'">'+repos[i].name+'</a><p>'+repos[i].description+'</p></li>'; | |
| } | |
| t.innerHTML = fragment; | |
| } | |
| return { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Path to your oh-my-zsh configuration. | |
| ZSH=$HOME/.oh-my-zsh | |
| # Set name of the theme to load. | |
| # Look in ~/.oh-my-zsh/themes/ | |
| # Optionally, if you set this to "random", it'll load a random theme each | |
| # time that oh-my-zsh is loaded. | |
| # zsh_themes: | |
| # git/ruby: bira, dpoggi | |
| # git only: takashiyoshida, duellj, candy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ diff .git-completion.sh /etc/bash_completion.d/git | |
| 292c292,296 | |
| < u="$(parse_git_dirty)" | |
| --- | |
| > if [ -n "${GIT_PS1_SHOWUNTRACKEDFILES-}" ]; then | |
| > if [ -n "$(git ls-files --others --exclude-standard)" ]; then | |
| > u="%" | |
| > fi | |
| > fi |
Shall we caching the gist API result at a seperate server?
That means when create a new blog post, user must also update the server file providing blog posts list, it seems will only calling the gist API one time, when the blog updated.
On the other hand, if we do this all by client side, heavier gist API calling, but creating blog post just meaning create new gist, named you_name_it.md, it's more DRY.
Let's see how the second approach performed, shall we?
trying out gist-vim...
(copied from https://github.com/mattn/gist-vim)
-
set description
:Gist -s "nonsense random description" -
list all my gists
OlderNewer