Based on this gist
For NSDictionary
:
@implementation NSDictionary (MutableDeepCopy)
// As seen here (in the comments): https://gist.github.com/yfujiki/1664847
- (NSMutableDictionary *)mutableDeepCopy
{
-- Finds the index of the device token or -1 if the token doesn't exist in the devices. | |
function findDeviceIndexForToken(devices, deviceToken) | |
for i,v in ipairs(devices) do | |
if v.token == deviceToken then | |
return i | |
end | |
end | |
return -1 |
// All these functions are literally based on connect.vhost which borders on unintelligible. I'll fix that when converting to module. | |
exports.vroute = function(route, server) { | |
if (!route) throw new Error('vroute route required'); | |
if (!server) throw new Error('vroute server required'); | |
var regexpString = '^\\/' + cleanForRegexp(route) + '(\\/.*)$'; | |
var regexp = new RegExp(regexpString, 'i'); | |
return function(req, res, next) { | |
if(!req || !req.url) return next(); | |
var matches = req.url.match(regexp); |
RESOURCES_TESTS_PATH = '<whatever works for you>' | |
pathToTestJson = (filename) -> | |
return path.join __dirname, RESOURCES_TESTS_PATH, filename | |
nockActionIsRecording = () -> | |
return not _.isUndefined process.env.NOCK_RECORDING and process.env.NOCK_RECORDING == '1' | |
# If we are recording (NOCK_ACTION == 'recording') then we start the recording and return the filename | |
# to which we will be saving them. |
// Originally found at http://pastebin.com/kdUHWMZf | |
// Fixed the recursion not working on layers of subviews. | |
@interface UIView (LayerEdgeAntialiasing) | |
/** Uses the -setAllowsEdgeAntialiasing: method from CALayer prior to iOS 7, and also can applies it to every sublayers (and sublayers's of sublayers', and so on) if you want to. */ | |
@property (nonatomic, assign) BOOL allowsLayerEdgeAntialiasing; | |
- (void)setAllowsLayerEdgeAntialiasing:(BOOL)allowsLayerEdgeAntialiasing applyToSublayers:(BOOL)applyToSublayers; | |
@end |
Based on this gist
For NSDictionary
:
@implementation NSDictionary (MutableDeepCopy)
// As seen here (in the comments): https://gist.github.com/yfujiki/1664847
- (NSMutableDictionary *)mutableDeepCopy
{
var db = require('nano'); | |
var debug = require('debug')('cleanDb'); | |
var async = require('async'); | |
function cleanDb(callback) { | |
debug('Cleaning up db from all non-design documents'); | |
db.list(function(err, body) { | |
if(err) { |
I hereby claim:
To claim this, I am signing this object:
#!/bin/bash | |
# Shell Script for super-respositores that executes git on all sub-repositories | |
# Homepage at http://www.bitweaver.org/wiki/supergit | |
# Licensed under the GPL | |
# Authors: github.com/spiderr | |
function usage { | |
appName=`basename $0` | |
echo "Welcome to $appName. It acts on all directories in your project as if they were sub-respositories. For most commands, you simply type what you would normally for git, however you simply type $appName with desired parameters in the super-repository root of your project. For example:" | |
echo "-- To clone, type '$appName [email protected]:bitweaver/bitweaver.git -b DEV testbw' which will clone, then intiliaze + update submodules and checkout the master branch for each submodule" |
// Run this script from a directory above the packages you are analyzing | |
/* global process */ | |
'use strict'; | |
var _ = require('lodash'); | |
var glob = require('glob'); | |
var path = require('path'); |
#!/bin/bash | |
# As seen here https://stackoverflow.com/questions/2683279/how-to-detect-if-a-script-is-being-sourced | |
if [[ $0 == $BASH_SOURCE ]]; then | |
echo 'You must run this script as `source export_envvars.sh` for it to export the envvars.' | |
else | |
if [[ -z $1 ]]; then | |
echo 'You must provide name of the envvars file.' | |
else | |
# As seen here http://stackoverflow.com/questions/10929453/read-a-file-line-by-line-assigning-the-value-to-a-variable |