Skip to content

Instantly share code, notes, and snippets.

@leshill
leshill / heroku_auto_scaler.rb
Created November 28, 2011 23:21
HerokuAutoScaler -- drop in, require, and go!
# Scale workers on Heroku automatically as your Resque queue grows.
# Mixin the +Scaling+ module into your models to get the behavior.
#
# class MyModel < ActiveRecord::Base
# extend HerokuAutoScaler::AutoScaling
# end
#
# And configure in an initializer +config/initializers/heroku_workers.rb+:
#
# HerokuAutoScaler.configure do
@andybangs
andybangs / GSEventEmitter.h
Last active February 4, 2019 03:03
Example RCTEventEmitter Subclass
#import "RCTEventEmitter.h"
#import "RCTBridge.h"
@interface GSEventEmitter : RCTEventEmitter <RCTBridgeModule>
+ (BOOL)application:(UIApplication *)application didSightBeacon:(NSString *)beaconID;
+ (BOOL)application:(UIApplication *)application didDepartBeacon:(NSString *)beaconID;
@end
@vamdt
vamdt / city.rb
Last active July 26, 2022 05:01 — forked from sumskyi/README.md
rails4 sti, custom "type" column name and value
class City < GeoEntity
def self.sti_name
3
end
end
@rcugut
rcugut / node-npm-install.md
Last active February 2, 2024 11:51 — forked from DanHerbert/fix-homebrew-npm.md
Install node & npm on Mac OS X with Homebrew

DEPRECATED as of macOS 10.13 (High Sierra). See the new GUIDE to install nvm and yarn for macOS (updated July 2019)

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

Solution

This solution fixes the error caused by trying to run npm update npm -g. Once you're finished, you also won't need to use sudo to install npm modules globally.

@DanHerbert
DanHerbert / fix-homebrew-npm.md
Last active February 12, 2024 17:18
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew

OBSOLETE

This entire guide is based on an old version of Homebrew/Node and no longer applies. It was only ever intended to fix a specific error message which has since been fixed. I've kept it here for historical purposes, but it should no longer be used. Homebrew maintainers have fixed things and the options mentioned don't exist and won't work.

I still believe it is better to manually install npm separately since having a generic package manager maintain another package manager is a bad idea, but the instructions below don't explain how to do that.

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active March 27, 2024 06:36
A badass list of frontend development resources I collected over time.