git init
or
--- | |
# ^^^ YAML documents must begin with the document separator "---" | |
# | |
#### Example docblock, I like to put a descriptive comment at the top of my | |
#### playbooks. | |
# | |
# Overview: Playbook to bootstrap a new host for configuration management. | |
# Applies to: production | |
# Description: | |
# Ensures that a host is configured for management with Ansible. |
2015-01-29 Unofficial Relay FAQ
Compilation of questions and answers about Relay from React.js Conf.
Disclaimer: I work on Relay at Facebook. Relay is a complex system on which we're iterating aggressively. I'll do my best here to provide accurate, useful answers, but the details are subject to change. I may also be wrong. Feedback and additional questions are welcome.
Relay is a new framework from Facebook that provides data-fetching functionality for React applications. It was announced at React.js Conf (January 2015).
function! ShowOnGithub() | |
let u = system("echo ${${${$(git --git-dir=.git config --get remote.origin.url)#git@github.com:}%.git}#https://github.com/} | xargs echo -n") | |
silent exec "!open "."https://github.com/".u."/blob/master/".@%.'\#L'.line(".") | |
endfunction | |
command! -nargs=0 ShowOnGithub call ShowOnGithub() | |
nnoremap <Leader>gh :ShowOnGithub<CR> |
# initializers/active_admin.rb | |
module ActiveAdmin | |
class OrderClause | |
alias_method :initialize_old, :initialize | |
alias_method :valid_old?, :valid? | |
alias_method :to_sql_old, :to_sql | |
def initialize(clause) | |
if clause.class == String | |
initialize_old(clause) |
import Image | |
import numpy as n | |
#open image and convert to greyscale | |
img = Image.open('photo.png').convert('LA') | |
#get dimensions and scale them | |
w,h = img.size | |
# change to 4 and 7, respectivly to make smaller image | |
w /=2 | |
h /=4 |
(evil-define-state god | |
"God state." | |
:tag " <G> " | |
:message "-- GOD MODE --" | |
:entry-hook (evil-god-start-hook) | |
:exit-hook (evil-god-stop-hook) | |
:input-method t | |
:intercept-esc nil) | |
(defun evil-god-start-hook () |
/* | |
Copyright (c) 2015 Paul Jolly <paul@myitcv.org.uk) | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
docker run -rm -t -i -v $(dirname $SSH_AUTH_SOCK) -e SSH_AUTH_SOCK=$SSH_AUTH_SOCK ubuntu /bin/bash |
This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.
The script is here:
#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"