Skip to content

Instantly share code, notes, and snippets.

View xcambar's full-sized avatar

Xavier Cambar xcambar

View GitHub Profile
@drogus
drogus / Rakefile.rb
Created July 26, 2013 10:49
This is the example contents of the Rakefile, which you would use to run active record tasks without using Rails. It assumes using the same directories as rails uses: `db/migrate`, `config/database.yml`.
require 'bundler/setup'
require 'active_record'
include ActiveRecord::Tasks
db_dir = File.expand_path('../db', __FILE__)
config_dir = File.expand_path('../config', __FILE__)
DatabaseTasks.env = ENV['ENV'] || 'development'
@kates
kates / search_and_replace.sh
Last active August 31, 2019 05:22
bulk search and replace with the silver searcher, awk, sed and xargs
ag "sometext" --nogroup | awk '{print substr($1,1,index($1,":")-1);}' | xargs -I {} sed -i .bak -e 's/sometext/anothertext/g' {}
@flomotlik
flomotlik / gist:5709952
Last active December 18, 2015 02:18
Exported Commit variables
'CI' => true,
'CI_BUILD_NUMBER' => id,
'CI_BUILD_URL' => project_build_url(project, self),
'CI_PULL_REQUEST' => false,
'CI_BRANCH' => branch,
'CI_COMMIT_ID' => commit_id,
'CI_COMMITTER_NAME' => name,
'CI_COMMITTER_EMAIL' => email,
'CI_COMMITTER_USERNAME' => github_username,
'CI_MESSAGE' => message,
@follmann
follmann / Manual and upstart config for AeroFS (aerofs-cli) on Ubuntu 12.04.1 LTS
Last active May 19, 2022 05:35
Manual and upstart config for AeroFS (aerofs-cli) on Ubuntu 12.04.1 LTS
Manual and upstart config for AeroFS (aerofs-cli) on Ubuntu 12.04.1 LTS:
# link standard upstart script
cd /etc/init.d
sudo ln -s /lib/init/upstart-job aerofs-cli
# create upstart config for aerofs-cli
sudo nano /etc/init/aerofs-cli.conf
(replace andreas with your desired runtime user)
----
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 3, 2024 19:09
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@1stvamp
1stvamp / mac-curl-ca-bundle.sh
Created March 22, 2012 12:50
Script to install cURL CA certificates on OS X without macports
#!/bin/bash
mkdir /tmp/curl-ca-bundle
cd /tmp/curl-ca-bundle
wget http://curl.haxx.se/download/curl-7.22.0.tar.bz2
tar xzf curl-7.22.0.tar.bz2
cd curl-7.22.0/lib/
./mk-ca-bundle.pl
if [ ! -d /usr/share/curl/ ]; then
sudo mkdir -p /usr/share/curl/
else

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@Raynos
Raynos / a.md
Created January 23, 2012 19:48
Shim status of ES6

ES6 what can be shimmed and what not.

Currently only lists things that can be shimmed or are experimentally implemented

Note that for any kind of decent ES6 support we need an ES6 transpiler. A few projects are attempting this [Reference SO question][3]

  • [traceur][4]
  • [Caja][5]
  • [ES transpiler][6]