Skip to content

Instantly share code, notes, and snippets.

View panaggio's full-sized avatar

Ricardo Panaggio panaggio

View GitHub Profile
#!/bin/sh
exec 9>/tmp/lock-file
if ! flock -n 9 ; then
(>&2 echo "another instance is running";)
exit 1
fi
sleep 60
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
App.push = (function() {
var instance;
var config = {
ios: {
alert: true,
badge: true,
sound: true,
categories: {
a: {

To start: there are three locations:

  • your local machine (you're editing files here)
  • your personal remote (this lived on github)
  • the mozilla remote (this also lives on github)

When working on "things", the basic idea is to, before you start editing things, make sure all three locations have the same develop branch. The mozilla remote is the boss here, so the idea is to ask it what the most up to date code is, then update your local machine develop branch to be the same as that, and to then push your local copy up to your personal remote:

$> git fetch mozilla
BlogPost = Backbone.Model.extend({
select: function(){
this.set({selected: true});
this.collection.selectPost(this);
}
});
BlogPosts = Backbone.Collection.extend({
model: BlogPost,
@panaggio
panaggio / gist:806036
Created February 1, 2011 15:44
sweep_news_items
def sweep_news_items(question)
User.all.each do |u|
if u.news_items.include? question
expire_fragment("user_news_items_#{u.id}")
end
end
end
class Semaphore
#
# Creates a new Semaphore
#
def initialize(initvalue = 0)
@counter = @max = initvalue
@waiting = []
@mutex = Mutex.new
end
def test
puts "before stop"
Thread.stop
ensure
puts "ensures?"
end
t = Thread.new { test }
t.join