Skip to content

Instantly share code, notes, and snippets.

@andybangs
andybangs / GSEventEmitter.h
Last active Feb 4, 2019
Example RCTEventEmitter Subclass
View GSEventEmitter.h
#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
@rcugut
rcugut / node-npm-install.md
Last active Dec 4, 2020 — forked from DanHerbert/fix-homebrew-npm.md
Install node & npm on Mac OS X with Homebrew
View node-npm-install.md

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.

@vamdt
vamdt / city.rb
Last active Mar 14, 2019 — forked from sumskyi/README.md
rails4 sti, custom "type" column name and value
View city.rb
class City < GeoEntity
def self.sti_name
3
end
end
@DanHerbert
DanHerbert / fix-homebrew-npm.md
Last active Sep 17, 2021
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew
View fix-homebrew-npm.md

READ THIS Very Important Update

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 Sep 3, 2021
A badass list of frontend development resources I collected over time.
View frontendDevlopmentBookmarks.md
@leshill
leshill / heroku_auto_scaler.rb
Created Nov 28, 2011
HerokuAutoScaler -- drop in, require, and go!
View heroku_auto_scaler.rb
# 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