Look up Ruby motions by running :help ruby-motion
.
command | effect |
---|
<template> | |
<div> | |
<slot/> | |
</div> | |
</template> | |
<script> | |
// @ts-check | |
/** |
build_package_patch_ruby_railsexpress() { | |
fetch_git rvm-patchsets git://github.com/skaes/rvm-patchsets.git master | |
for p in rvm-patchsets/patches/ruby/2.2.3/railsexpress/* ; do | |
patch -p1 < $p | |
done | |
} | |
install_package "openssl-1.0.2d" "https://www.openssl.org/source/openssl-1.0.2d.tar.gz#671c36487785628a703374c652ad2cebea45fa920ae5681515df25d9f2c9a8c8" mac_openssl --if has_broken_mac_openssl | |
install_package "ruby-2.2.3" "https://cache.ruby-lang.org/pub/ruby/2.2/ruby-2.2.3.tar.gz#df795f2f99860745a416092a4004b016ccf77e8b82dec956b120f18bdc71edce" patch_ruby_railsexpress ldflags_dirs standard verify_openssl |
class API::V1::BaseController < ApplicationController | |
skip_before_filter :verify_authenticity_token | |
before_filter :cors_preflight_check | |
after_filter :cors_set_access_control_headers | |
def cors_set_access_control_headers | |
headers['Access-Control-Allow-Origin'] = '*' | |
headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS' |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
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"
Mkdown renders Markdown GitHub gists with alternative CSS. Use it to elegantly share gists written in Markdown.
To create your own mkdown URL, append the gist ID in a URL of the form: http://mkdown.com/{GIST ID}
. The gist ID is the string at the end of a gist URL.
# Start the old vagrant | |
$ vagrant init centos-6.3 | |
$ vagrant up | |
# You should see a message like: | |
# [default] The guest additions on this VM do not match the install version of | |
# VirtualBox! This may cause things such as forwarded ports, shared | |
# folders, and more to not work properly. If any of those things fail on | |
# this machine, please update the guest additions and repackage the | |
# box. |
# | |
# UPDATE for 10.10.4+: please consider this patch obsolete, as apple provides a tool called "trimforce" to enable trim support for 3rd party SSDs | |
# just run "sudo trimforce enable" to activate the trim support from now on! | |
# | |
# Original version by Grant Parnell is offline (http://digitaldj.net/2011/07/21/trim-enabler-for-lion/) | |
# Update July 2014: no longer offline, see https://digitaldj.net/blog/2011/11/17/trim-enabler-for-os-x-lion-mountain-lion-mavericks/ | |
# | |
# Looks for "Apple" string in HD kext, changes it to a wildcard match for anything | |
# | |
# Alternative to http://www.groths.org/trim-enabler-3-0-released/ |
Sometimes you want to use a gem on Heroku that is in a private repository on GitHub.
Using git over http you can authenticate to GitHub using basic authentication. However, we don't want to embed usernames and passwords in Gemfiles. Instead, we can use authentication tokens.
First you will need to get an OAuth Token from GitHub using your own username and "note"