Skip to content

Instantly share code, notes, and snippets.

@grossadamm
grossadamm / withCodePush.ts
Created January 4, 2023 23:15
Use code push with expo
const { AndroidConfig, withAppDelegate, withPlugins, withInfoPlist, withSettingsGradle, withAppBuildGradle, withMainApplication, withStringsXml } = require('@expo/config-plugins');
function withCodePushAppDelegate(config) {
return withAppDelegate(config, (cfg) => {
const { modResults } = cfg;
const { contents } = modResults;
const lines = contents.split('\n');
const importIndex = lines.findIndex((line) =>
/^#import "AppDelegate.h"/.test(line)
@grossadamm
grossadamm / EXIFmover.py
Created January 15, 2016 21:19 — forked from nerdtalker/EXIFmover.py
EXIFmover - Moves Dropbox Camera uploaded Images into sensible directories
# Name: EXIFmover.py
# Author: Brian Klug (@nerdtalker / [email protected])
# Purpose:
# Move Files into directory based on EXIF data make and model
# Designed to un-clusterfuck the Dropbox camera upload directory which is a mess of every
# JPEG and PNG ever if you use it like I do on a bunch of phones, and thus totally unwieldy
# and full of images sorted by date or else nothing sometimes, dropbox seems nondeterminstic
# Moves files into /[Image Make]+[Image Model]/ eg /Camera Uploads/LGE Nexus 4/
@grossadamm
grossadamm / cacheable_has_one.rb
Last active August 29, 2015 14:18
Rails cacheable has_one
module CacheableHasOne
extend ActiveSupport::Concern
included do
@build_cached_getter = ::Kernel.lambda do |cache_key, association_symbol|
alias_method "_#{association_symbol}".to_sym, association_symbol
define_method(association_symbol) do
return send("_#{association_symbol}") unless persisted?
@grossadamm
grossadamm / jasmine-blanket.js
Created August 13, 2014 15:40
jasmine-blanket.js for jasmine 2.0
(function() {
if (!jasmine) {
throw new Exception("jasmine library does not exist in global namespace!");
}
function elapsed(startTime, endTime) {
return (endTime - startTime) / 1000;
}
@grossadamm
grossadamm / gist:a4f6997a369d30eb5110
Created June 30, 2014 19:13
Jasmine-jquery requirejs
/*!
Jasmine-jQuery: a set of jQuery helpers for Jasmine tests.
Version 2.0.5
https://github.com/velesin/jasmine-jquery
Copyright (c) 2010-2014 Wojciech Zawistowski, Travis Jeffery
Permission is hereby granted, free of charge, to any person obtaining
@grossadamm
grossadamm / gist:11add4b4681df3a23804
Created June 30, 2014 19:11
Jasmine-fixture requirejs
/* jasmine-fixture - 1.2.0
* Makes injecting HTML snippets into the DOM easy & clean!
* https://github.com/searls/jasmine-fixture
*/
(function() {
var createHTMLBlock,
__slice = [].slice;
require(['jquery'], function($) {
var ewwSideEffects, jasmineFixture, originalAffix, originalJasmineDotFixture, originalJasmineFixture, root, _, _ref;