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> | |
<head> | |
<script src="https://d3js.org/d3.v4.min.js"></script> | |
<script src="https://d3js.org/d3-color.v1.min.js"></script> | |
<script src="https://d3js.org/d3-dispatch.v1.min.js"></script> | |
<script src="https://d3js.org/d3-ease.v1.min.js"></script> | |
<script src="https://d3js.org/d3-interpolate.v1.min.js"></script> |
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
using System; | |
using System.Threading; | |
using System.IO; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
/// <summary> | |
/// |
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
(ns clj-loaded-dice.core) | |
(defn make-loaded-dice | |
"Create the data structure for the loaded dice." | |
[& probabilities] | |
(let [total-probability (apply + probabilities)] | |
(->> | |
;; normalize the probabilities to sum up to 1 | |
(map #(/ % total-probability) probabilities) |
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
// This is a bad comparison as the data gets written back to the source array, | |
// so in-place has an advantage here. | |
// Compile with | |
// | |
// clang++ --std=c++11 -stdlib=libstdc++ -static -lstdc++ test.cpp | |
// On my machine it prints: | |
// When running unoptimized: |
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
# Evan describes this sexy prompt as: "a skinny, topless prompt" | |
local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ %s)%{$reset_color%}" | |
local dir_str="%{$fg[cyan]%}%2~%{$reset_color%}" | |
PROMPT='${ret_status} %m :: ${dir_str} %B»%b %{$reset_color%}' |
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
; Takes a list of tasks and their dependencies, solves a DAG | |
; and returns the order in which the tasks | |
; should be run, grouping the paralellizable tasks into lists. | |
; | |
; Transforms this task list: | |
; {:sql_1 [] | |
; :sql_sum [:sql_1] | |
; :sql_3 [] | |
; :view [:sql_1 :sql_sum]} | |
; |
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
class Task | |
attr_reader :key, :deps, :block, :all_dependencies | |
# Creates a new task | |
def initialize key, &to_do_block | |
@key, @deps, @all_dependencies = key, [], [] | |
@block = to_do_block.to_proc if to_do_block | |
end | |
# Mark the dependencies of this task |
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
# Script to watch a directory for any changes to a haml file | |
# and compile it. | |
# Copyright © 2013 Gyula László. Code released under the DWTFYW License. | |
require 'fssm' | |
require 'haml' | |
class HamlWatch < Thor |
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
from_date_strings = (s1, s2)-> | |
s2 = "0#{s2}" if s2 < 10 | |
"#{s2}.#{s1[4..5]}.#{s1[0..3]}" | |
$(-> | |
$('#repcsi_es_szallas form').submit -> | |
self = this | |
t = (sc)-> $(sc, self) |
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
#encoding: UTF-8 | |
require 'rubygems' | |
require 'builder' | |
#Started POST "/gyorskereso/repjegy/purchase?url=http%3A%2F%2Fflight1.onlinetravel.ch%2Fcgi-bin%2Fflightmore" for 188.36.35.62 at 2011-12-03 04:11:57 +0000 | |
REQUEST_LINE = /^Started ([A-Z]+) "(.*?)" for ([0-9\.]+) at (.*?)$/ | |
LAYOUT_RENDER_LINE = /^Rendered (.*?) within (.*?) \(/ | |
ABINGO_BINGO = /ABingo#bingo!/ |
NewerOlder