Skip to content

Instantly share code, notes, and snippets.

View khalilgharbaoui's full-sized avatar
🎯
Focusing

Khalil Gharbaoui khalilgharbaoui

🎯
Focusing
View GitHub Profile
@khalilgharbaoui
khalilgharbaoui / alias_matchers.md
Created April 23, 2018 02:33 — forked from JunichiIto/alias_matchers.md
List of alias matchers in RSpec 3

This list is based on aliases_spec.rb.

You can see also Module: RSpec::Matchers API.

matcher aliased to description
a_truthy_value be_truthy a truthy value
a_falsey_value be_falsey a falsey value
be_falsy be_falsey be falsy
a_falsy_value be_falsey a falsy value
# shortform git commands
alias g='git'
# push changes to an empty git repository for the first time
git push --set-upstream origin master
# remove untracked files in a git repository
git status -su | cut -d' ' -f2- | tr '\n' '\0' | xargs -0 rm
# get most modified files and counts
@khalilgharbaoui
khalilgharbaoui / Dockerfile
Created October 23, 2016 12:16 — forked from yefim/Dockerrun.aws.json
Build a Docker image, push it to AWS EC2 Container Registry, then deploy it to AWS Elastic Beanstalk
# Example Dockerfile
FROM hello-world
@khalilgharbaoui
khalilgharbaoui / ActionMailer-and-Sidekiq-Redis.md
Last active October 22, 2016 10:35 — forked from maxivak/00.md
Sending emails with ActionMailer and Sidekiq

Sending emails with ActionMailer and Sidekiq

Send email asynchroniously using Sidekiq.

ActionMailer

Create your mailer us usual:

@khalilgharbaoui
khalilgharbaoui / DragonFireCubes.js
Created July 18, 2016 01:25
RiftSketch - Dragon Fire Cubes - Tree.js
var t3 = THREE;
var light = new t3.PointLight();
light.position.set(20, 10, 10);
scene.add(light);
var makeCube = function(x, y, z) {
var cube = new t3.Mesh(
@khalilgharbaoui
khalilgharbaoui / form_submit.js
Created June 29, 2016 00:02 — forked from lingceng/form_submit.js
JavaScript request like a form submit
// http://stackoverflow.com/questions/133925/javascript-post-request-like-a-form-submit
// form_submit('/contact/', {name: 'Johnny Bravo'});
function form_submit(path, params, method) {
method = method || "post"; // Set method to post by default if not specified.
// The rest of this code assumes you are not using a library.
// It can be made less wordy if you use one.
var form = document.createElement("form");
form.setAttribute("method", method);
form.setAttribute("action", path);