Skip to content

Instantly share code, notes, and snippets.

View heracek's full-sized avatar

Tomáš Horáček heracek

View GitHub Profile
[core]
editor = "mvim -f -c 'au VimLeave * !open -a Terminal'"
[merge]
tool = vimdiff
guitool = mvim
[diff]
tool = vimdiff
guitool = mvim
[mergetool "mvim"]
cmd = mvim -f -d "$LOCAL" "$MERGED" "$REMOTE"
@heracek
heracek / gauge.js
Created July 10, 2012 12:14 — forked from tomerd/gauge.js
google style gauges using javascript d3.js
function Gauge(placeholderName, configuration)
{
this.placeholderName = placeholderName;
var self = this; // some internal d3 functions do not "like" the "this" keyword, hence setting a local variable
this.configure = function(configuration)
{
this.config = configuration;
@heracek
heracek / 0_reuse_code.js
Created October 11, 2013 14:04
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@heracek
heracek / padrino-sprocktes-compass.rb
Last active August 29, 2015 14:04
Padrino generators
###
# Template for generate clean sample app at Padrino(Compass, SASS, Slim, Asset pipelines, CoffeeScript, etc…) & Angular
# @requirements
# => Bundler, Padrino-gen, npm, bower
# @uses
# =>
# padrino-gen project testapp --template padrino-sprocktes-compass.rb
# bundle exec padrino rake -e production assets:precompile
# bundle exec padrino start -e production
@heracek
heracek / gist:fbf63f71e22e2ee32f2a
Last active August 29, 2015 14:22 — forked from steida/gist:d54a2cd2296ec7c164d1
React.js field validation
/*
Simple serial "one by one" sync/async promises based validation.
*/
import validator from 'validator'
import Promise from 'bluebird'
export function focusInvalidField(reactComponent) {
return (error) => {
if (error instanceof ValidationError) {
if (!error.prop) return
@heracek
heracek / ubuntu.yml
Last active August 29, 2015 14:23 — forked from jameskyle/ubuntu.yml
- name: Set the Hostname
hostname: name=ubuntu
- name: upgrade packages
apt: upgrade=full
- name: install packages
apt: >
name="{{ item }}"
state=latest
with_items:
- git
@heracek
heracek / README.md
Created October 16, 2015 14:24 — forked from JoelQ/README.md
Using Shell Scripts for a Better User Experience (source for https://robots.thoughtbot.com/improving-user-experience-with-shell-scripts)

Server scripts

This is the source for the scripts discussed in https://robots.thoughtbot.com/improving-user-experience-with-shell-scripts

Both scripts are in the bin/ directory of the repo that contains all the markdown documents for blog posts. Users run bin/server and everything is automatically set up for them to view a local preview of the blog. bin/server-setup is a dependency of bin/server and is never run directly by users.

Maitre-d is the name of the "blog engine" discussed in the article.