Skip to content

Instantly share code, notes, and snippets.

View ChrisRicca's full-sized avatar

Chris Ricca ChrisRicca

View GitHub Profile
@boneskull
boneskull / README.md
Last active April 10, 2024 12:47
example of how to debug mocha v4 if hanging

Here's an example of how to debug Mocha v4 if it hangs.

Ensure you're using a Node.js 8 or newer (or any version with async_hooks support).

If you run your test, you'll notice it hangs:

$ mocha test.js
@liaujianjie
liaujianjie / Eureka+Firebase.swift
Last active July 3, 2018 10:51
Swift extension to bridge between Eureka datatypes and Firebase datatypes
import Foundation
import Eureka // https://github.com/xmartlabs/Eureka
public extension Form {
public func valuesForFirebase(includeHidden: Bool = false) -> [String: Any?] {
let rows = includeHidden ? self.allRows : self.rows
return rows.filter({ $0.tag != nil })
.reduce([:], { (dictionary, row) -> [String: Any?] in
var dictionary = dictionary
dictionary[row.tag!] = row.firebaseValue
@vhbit
vhbit / twitter.m
Created May 6, 2011 10:34
Follow us on Twitter button for iOS
- (BOOL)openTwitterClientForUserName:(NSString*)userName {
NSArray *urls = [NSArray arrayWithObjects:
@"twitter:@{username}", // Twitter
@"tweetbot:///user_profile/{username}", // TweetBot
@"echofon:///user_timeline?{username}", // Echofon
@"twit:///user?screen_name={username}", // Twittelator Pro
@"x-seesmic://twitter_profile?twitter_screen_name={username}", // Seesmic
@"x-birdfeed://user?screen_name={username}", // Birdfeed
@"tweetings:///user?screen_name={username}", // Tweetings
@"simplytweet:?link=http://twitter.com/{username}", // SimplyTweet
@ChrisRicca
ChrisRicca / fetch_original_dropio_files.rb
Created November 7, 2009 06:19
This is a script for downloading original files from premium (upgraded or manager) drops. Requires a few gems and curl (might need SSL libs installed)
#!/usr/bin/env ruby
# this will let you download the original files
# from a premium dropio drop
# run it in the command line with "ruby fetch_original_dropio_files.rb"
require 'rubygems'
require 'fileutils'
require 'httparty'
#!/usr/bin/env ruby
puts "looking for the gems to upgrade..."
gem_info = Struct.new(:name, :version)
to_reinstall = []
Dir.glob('/Library/Ruby/Gems/**/*.bundle').map do |path|
path =~ /.*1.8\/gems\/(.*)-(.*?)\/.*/
name, version = $1, $2
bundle_info = `file path`
to_reinstall << gem_info.new(name, version) unless bundle_info =~ /bundle x86_64/
end