This file contains 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
# http://codingdojo.org/cgi-bin/wiki.pl?KataBowling | |
# "5/5/5/5/5/5/5/5/5/5/5" | |
rolls = [5 for x in range(21)] | |
# "XXXXXXXXXXXX" | |
rolls = [10 for x in range(12)] | |
# "9-9-9-9-9-9-9-9-9-9-" | |
rolls = zip([9 for x in range(10)], [0 for x in range(10)]) |
This file contains 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
apply plugin: "java" | |
apply plugin: "eclipse" | |
apply plugin: "idea" | |
group = "com.mycompany.hadoopproject" | |
version = "1.0" | |
repositories { | |
// Standard Maven | |
mavenCentral() |
This file contains 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
package spark.examples | |
import org.apache.spark._ | |
import org.apache.spark.SparkContext._ | |
import org.json4s.jackson.JsonMethods | |
import org.json4s.jackson.JsonMethods._ | |
import org.json4s.JsonAST._ | |
object HDFSDeleteExample { |
This file contains 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
jq . <<< '{ "foo": "lorem", "bar": "ipsum" }' | |
{ | |
"foo": "lorem", | |
"bar": "ipsum" | |
} | |
python -m json.tool <<< '{ "foo": "lorem", "bar": "ipsum" }' | |
{ | |
"bar": "ipsum", | |
"foo": "lorem" |
This file contains 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
--- | |
- name: Check forward udp port 53 | |
command: iptables -t nat -C PREROUTING -i {{ eth }} -p udp --dport 53 -j REDIRECT --to-port 8600 | |
register: result | |
failed_when: False | |
changed_when: False | |
when: server | |
tags: iptables | |
- name: Forward udp port 53 |
This file contains 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Twitter Bootstrap</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta name="description" content=""> | |
<meta name="author" content=""> | |
<!-- Le styles --> |
This file contains 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
" My .gvimrc with https://github.com/szw/vim-smartclose | |
" <D-w> to close "help", "quickfix", "nerdtree" and for last you files. | |
" For MacVim | |
macmenu File.Close key=<Nop> | |
" tabclose like chrome {{{1 | |
noremap <silent> <D-w> :if tabpagenr() != tabpagenr('$') && winnr('$') == 1<CR>:tabclose<CR>:if tabpagenr() > 1<CR>:tabprev<CR>:endif<CR>:else<CR>:SmartClose<CR>:endif<CR> | |
" tabs {{{1 |
This file contains 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
let s:windowmapnr = 0 | |
let s:wins='1234567890!@#$%^&*()' | |
while (s:windowmapnr < strlen(s:wins)) | |
exe 'noremap <silent> <D-' . s:wins[s:windowmapnr] . '> ' . (s:windowmapnr + 1) . 'gt' | |
exe 'inoremap <silent> <D-' . s:wins[s:windowmapnr] . '> <C-O>' . (s:windowmapnr + 1) . 'gt' | |
exe 'cnoremap <silent> <D-' . s:wins[s:windowmapnr] . '> <C-C>' . (s:windowmapnr + 1) . 'gt' | |
exe 'vnoremap <silent> <D-' . s:wins[s:windowmapnr] . '> <C-C>' . (s:windowmapnr + 1) . 'gt' | |
let s:windowmapnr += 1 | |
endwhile | |
unlet s:windowmapnr s:wins |
This file contains 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
require.config({ | |
urlArgs: "v=" + (new Date()).getTime(), | |
paths: { | |
jquery: 'libs/jquery', | |
underscore: 'libs/lodash', | |
backbone: 'libs/backbone', | |
text: 'libs/text', | |
ast_model: 'app/models/ast_model', | |
foo_model: 'app/models/foo_model', |
This file contains 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
'use strict'; | |
var $ = require('jquery2'); | |
var Bacon = require('baconjs'); | |
$.fn.asEventStream = Bacon.$.asEventStream; | |
var _ = require('lodash'); | |
var button = function(options) { | |
var opts = _.defaults(options, { | |
rate: 10, |
OlderNewer