Skip to content

Instantly share code, notes, and snippets.

View gyulalaszlo's full-sized avatar

Gyula László gyulalaszlo

View GitHub Profile
@gyulalaszlo
gyulalaszlo / evan_alt.zsh-theme
Created April 28, 2015 17:49
Birx zsh theme for Oh-my-zsh
# 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%}'
@gyulalaszlo
gyulalaszlo / test.cpp
Last active August 29, 2015 14:24
Comparison of in-place vs return-by-value
// 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:
@gyulalaszlo
gyulalaszlo / loaded_dice_basline.cljc
Created August 26, 2015 15:57
Loaded dice simulation in clojure
(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)
@gyulalaszlo
gyulalaszlo / LogWatcher.cs
Created November 9, 2015 16:03
C# log file watcher
using System;
using System.Threading;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
/// <summary>
///
@gyulalaszlo
gyulalaszlo / index.html
Last active November 25, 2016 11:09
D3 training 2016.11.25
<!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>