git init
or
| // openBrowser tries to open the URL in a browser, | |
| // and returns whether it succeed in doing so. | |
| func openBrowser(url string) bool { | |
| var args []string | |
| switch runtime.GOOS { | |
| case "darwin": | |
| args = []string{"open"} | |
| case "windows": | |
| args = []string{"cmd", "/c", "start"} | |
| default: |
| M[16],X=16,W,k;main(){T(system("stty cbreak") | |
| );puts(W&1?"WIN":"LOSE");}K[]={2,3,1};s(f,d,i | |
| ,j,l,P){for(i=4;i--;)for(j=k=l=0;k<4;)j<4?P=M | |
| [w(d,i,j++)],W|=P>>11,l*P&&(f?M[w(d,i,k)]=l<< | |
| (l==P):0,k++),l=l?P?l-P?P:0:l:P:(f?M[w(d,i,k) | |
| ]=l:0,++k,W|=2*!l,l=0);}w(d,i,j){return d?w(d | |
| -1,j,3-i):4*i+j;}T(i){for(i=X+rand()%X;M[i%X] | |
| *i;i--);i?M[i%X]=2<<rand()%2:0;for(W=i=0;i<4; | |
| )s(0,i++);for(i=X,puts("\e[2J\e[H");i--;i%4|| | |
| puts(""))printf(M[i]?"%4d|":" |",M[i]);W-2 |
| # ClojureHelpers.py for Sublime Text 3 | |
| # originally by James MacCaulley | |
| # https://gist.github.com/jamesmacaulay/5457344 | |
| import re | |
| import sublime | |
| import sublime_plugin | |
| import SublimeREPL.sublimerepl | |
| import SublimeREPL.text_transfer |
| function retry(isDone, next) { | |
| var current_trial = 0, max_retry = 50, interval = 10, is_timeout = false; | |
| var id = window.setInterval( | |
| function() { | |
| if (isDone()) { | |
| window.clearInterval(id); | |
| next(is_timeout); | |
| } | |
| if (current_trial++ > max_retry) { | |
| window.clearInterval(id); |
| # coding=UTF-8 | |
| from __future__ import division | |
| import nltk | |
| from collections import Counter | |
| # This is a simple tool for adding automatic hashtags into an article title | |
| # Created by Shlomi Babluki | |
| # Sep, 2013 |
| // Just before switching jobs: | |
| // Add one of these. | |
| // Preferably into the same commit where you do a large merge. | |
| // | |
| // This started as a tweet with a joke of "C++ pro-tip: #define private public", | |
| // and then it quickly escalated into more and more evil suggestions. | |
| // I've tried to capture interesting suggestions here. | |
| // | |
| // Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_, | |
| // @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant, |
| <?xml version="1.0" encoding="UTF-8" ?> | |
| <Data> | |
| <Series> | |
| <id>83462</id> | |
| <Actors>|Nathan Fillion|Stana Katic|Molly C. Quinn|Jon Huertas|Seamus Dever|Tamala Jones|Susan Sullivan|Ruben Santiago-Hudson|Monet Mazur|</Actors> | |
| <Airs_DayOfWeek>Monday</Airs_DayOfWeek> | |
| <Airs_Time>10:00 PM</Airs_Time> | |
| <ContentRating>TV-PG</ContentRating> | |
| <FirstAired>2009-03-09</FirstAired> | |
| <Genre>|Drama|</Genre> |
| // FizzBuzz solution with one comparison: | |
| // Bitwise operations, using predefined 0-15 numbers mask | |
| // live demo: http://jsfiddle.net/TbAuQ/ | |
| // source: http://www.zoharbabin.com/which-fizzbuzz-solution-is-the-most-efficient | |
| var words = [undefined, "Fizz", "Buzz", "FizzBuzz"], | |
| mask = 810092048, //11 00 00 01 00 10 01 00 00 01 10 00 01 00 00 | |
| c = 0; |
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.