Skip to content

Instantly share code, notes, and snippets.

View calrrox's full-sized avatar
🏠
Remote office

Carlos Torrealba calrrox

🏠
Remote office
View GitHub Profile
@learncodeacademy
learncodeacademy / webpack.config.js
Created January 8, 2016 03:55
Sample Basic Webpack Config
var debug = process.env.NODE_ENV !== "production";
var webpack = require('webpack');
module.exports = {
context: __dirname,
devtool: debug ? "inline-sourcemap" : null,
entry: "./js/scripts.js",
output: {
path: __dirname + "/js",
filename: "scripts.min.js"
@skyriser
skyriser / Dockerfile
Last active August 29, 2015 14:01
ローカルにあるRailsをDockerコンテナで動かす奴
# Master image
FROM centos
# Use Epel
RUN rpm -ivh http://ftp.riken.jp/Linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
# Install middleware
RUN yum -y update
RUN yum install -y which tar patch libffi-devel glibc-headers autoconf gcc-c++ glibc-devel patch readline-devel zlib-devel openssl-devel bzip2 automake libtool bison
RUN yum install -y libyaml libyaml-devel libxml2 libxml2-devel libxslt libxslt-devel
@emad-elsaid
emad-elsaid / share-screen.rb
Created February 22, 2014 10:30
share your screen on the local network
require 'socket'
require 'base64'
Refresh = 1 # seconds to refresh image on server
screen_capture_command = 'screencapture -C -x tmp.png'
image = ''
latest = Time.now
server = TCPServer.new 3000
loop do
@okor
okor / gist:4236979
Last active August 17, 2021 09:19
Git Cheat Sheet

Delete the last commit, if it hasn't been pushed.

git reset --soft HEAD~1

Delete the last commit, if it has been pushed.

git reset --hard HEAD~1
git push origin HEAD --force

Temporarily ignore local changes to a file

@traviskroberts
traviskroberts / gist:2830535
Created May 29, 2012 20:33
FactoryGirl Polymorphic Association
class Alert < ActiveRecord::Base
belongs_to :alertable, :polymorphic => true
end
class Region < ActiveRecord::Base
has_many :alerts, :as => :alertable
end