Skip to content

Instantly share code, notes, and snippets.

View mtvillwock's full-sized avatar

Matthew Villwock mtvillwock

View GitHub Profile
@oelmekki
oelmekki / doc.md
Created December 30, 2015 19:37
Rails + Browserify + React + es7

1. Gemfile

gem 'browserify-rails', '1.5.0' # until fix: https://github.com/browserify-rails/browserify-rails/issues/101
gem 'react-rails'

Browserify-rails allows to use browserify within assets pipeline. React-rails is here only to allow to use #react_component (and thus, prerendering).

Note that jquery-rails can be removed from Gemfile, the npm version of jquery and jquery-ujs will be used instead.

@bluenex
bluenex / zsh_envi.md
Last active May 17, 2023 19:31
Moving to Zsh note and configuration settings.

Moving to Zsh

Have a good time with bash for a long while, it's time to try another tempting shell - Zsh. So, this Gist is nothing but my collection for the environment that I've searched and applied to my system. There is also this kind of Gist in a version of bash.

Why Zsh?

There are several shells out there but this is the one that is close to the bash with some useful and attractive features especially - yes, theme. Here are some good articles about how and why to choose Zsh over bash, enjoy trying!

@tenderlove
tenderlove / h2_puma.rb
Last active September 4, 2023 17:30
Demo HTTP/2 server with Puma
require 'socket'
require 'openssl'
require 'puma/server'
require 'ds9'
class Server < DS9::Server
def initialize socket, app
@app = app
@read_streams = {}
@write_streams = {}
var results = [];
var app = {
initialize: function() {
var arr = [
this.generateMediaObj('imgs/avengers.jpg', "Avengers", "2012"),
this.generateMediaObj('imgs/blade_runner.jpg', "Blade Runner", "1982")
];
/* eachLimit(arr, limit, iterator, callback) */
async.eachLimit(arr, 1, this.makeRequest, this.onComplete);
@zeuxisoo
zeuxisoo / package.json
Created April 28, 2015 12:49
Simple script for fetch and save the word definition to local html file in console
{
"dependencies": {
"async": "^0.9.0",
"cheerio": "^0.19.0",
"datauri": "^0.6.0",
"unirest": "^0.4.0"
}
}
@adamsanderson
adamsanderson / README.markdown
Created March 29, 2015 23:42
Hash vs Array vs Set

For simple duplicate checking, which is faster, a Ruby hash, array, or set?

For arrays, we try two approaches, when inserting data either avoid duplicates, or just add them to the list.

This is most likely flawed, and should probably be taken with a grain of salt.

@irazasyed
irazasyed / manage-etc-hosts.sh
Created March 7, 2015 09:16
Bash Script to Manage /etc/hosts file for adding/removing hostnames.
#!/bin/sh
# PATH TO YOUR HOSTS FILE
ETC_HOSTS=/etc/hosts
# DEFAULT IP FOR HOSTNAME
IP="127.0.0.1"
# Hostname to add/remove.
HOSTNAME=$1
@jaredsmithse
jaredsmithse / alias
Created January 15, 2015 20:27
Aliases For Dev
alias gs='git status'
alias gc='git commit -m'
alias gb='git branch'
alias gaa='git add --all'
alias gco='git checkout'
alias gpom='git push origin master'
alias gplom='git pull --rebase origin master'
alias ga='git add'
alias gd='git diff'
@avaughan89
avaughan89 / resources_to_explore
Created January 14, 2015 08:01
Things we found quad-pairing on P1 with Sherif
URL list from Tuesday, Jan. 13 2015 23:57 PM
To copy this list, type [Ctrl] A, then type [Ctrl] C.
oop - How is almost everything in Javascript an object? - Stack Overflow
http://stackoverflow.com/questions/9108925/how-is-almost-everything-in-javascript-an-object
javascript - Everything is an object? - Stack Overflow
http://stackoverflow.com/questions/19165021/everything-is-an-object
@samuel-holt
samuel-holt / _mixins.scss
Last active November 23, 2016 18:58
Responsive typography
// STRIP UNIT
// It strips the unit of measure and returns it
@function strip-unit($num) {
@return $num / ($num * 0 + 1);
}
// Media queries mixin
// Default widths
$default-medium: 768px !default;