Skip to content

Instantly share code, notes, and snippets.

View BenFausch's full-sized avatar

Ben Fausch BenFausch

View GitHub Profile
@BenFausch
BenFausch / bannerperf.php
Last active October 25, 2018 16:37
Pull banner performance from sailthru to CSV file, by month
<?php
// create this file somewhere
include "simple_html_dom.php";
require_once __DIR__ . '/inc/sailthru.php';
//Load sailthru client
global $sailthruSettings;
$sailthru = new Sailthru_Client($sailthruSettings['key'], $sailthruSettings['secret']);
@BenFausch
BenFausch / xcodecleanup.sh
Created January 9, 2018 21:20
Xcode Project cleanup
#removes derived data:
rm -rf ~/Library/Developer/Xcode/DerivedData
#removes modulecache:
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache"
#cmd+shift+opt+k = full build folder clean
@BenFausch
BenFausch / mouseover.js
Created January 7, 2018 17:57
log all mouseover events, useful for finding elements to target
window.onmouseover=function(e) {
console.log(e.target.className);
};
@BenFausch
BenFausch / RNassembleRelease.sh
Created January 5, 2018 19:23
Assemble release for RN android
you'll need a keystore.properties file that is in the root of PROJECT/android
then put a .keystore file in android/app/ i.e. PROJECTNAME.keystore
in terminal, use the following command when in your main project folder:
cd android && ./gradlew assembleRelease
if you have the correct keystore.properties and .keystore file and your build works on a device in debug,
it should build for release
@BenFausch
BenFausch / AndroidEmulatorAlias.sh
Created December 22, 2017 18:00
Run Android emu from command line
//this lists available devices:
alias listAndroid='cd ~/Library/Android/Sdk/tools/bin && ./avdmanager list avd'
response looks like this:
Available Android Virtual Devices:
Name: Nexus_5X_API_24
Device: Nexus 5X (Google)
Path: /Users/benfausch/.android/avd/Nexus_5X_API_24.avd
Target: Google Play (Google Inc.)
Based on: Android 7.0 (Nougat) Tag/ABI: google_apis_playstore/x86
@BenFausch
BenFausch / RNRFDrawer.js
Created December 20, 2017 16:46
Side navigation for React Native Router Flux v4, using drawer, opens and closes with button
//been trying to find an example with RNRF that has a drawer that can be opened and closed with a
//button, and responds in the same way as v3
//it's been impossible to find this anywhere in the docs, so here's a few snippets to help out
//so here you have your new basic nav router setup:
<Router>
<Scene key='root'>
<Drawer
hideNavBar