Skip to content

Instantly share code, notes, and snippets.

@stephenfeather
stephenfeather / cleanup.zsh
Created April 21, 2019 00:49
Clean Up wasted space on osx
#!/usr/local/bin/zsh
echo "Updating Homebrew"
brew update
brew upgrade
brew cask upgrade
brew cleanup -s
brew doctor
brew missing
echo "Updating App Store Items"
mas outdated
@vladfr
vladfr / 1-standard.js
Last active May 9, 2023 07:34
Use async/await and for..of in Cloud Firestore
// In a Firestore standard example, we quickly create a 'xmas tree' of nested stuff
// We use Promises directly: get().then(callback) and use snapshot.forEach() to iterate
let campaignsRef = db.collection('campaigns');
let activeCampaigns = campaignsRef.where('active', '==', true).select().get()
.then(snapshot => {
snapshot.forEach(campaign => {
console.log(campaign.id);
let allTasks = campaignsRef.doc(campaign.id).collection('tasks').get().then(
snapshot => {
snapshot.forEach(task => {
@sebastianbenz
sebastianbenz / gcm-high-prio.sh
Last active August 4, 2021 15:29
Send high priority GCM messages via curl (Android Doze mode & App Standby testing)
curl -X POST \
-H "Authorization: key= YOUR-API-KEY" \
-H "Content-Type: application/json" \
-d '{
"registration_ids": [
"YOUR-GCM-REGISTRATION-ID"
],
"data": {
"message": "Hello Message"
},
@rborn
rborn / gist:63113167aace181f4f8b
Created October 14, 2014 12:12
Delete iOS8 simulator NSUserDefaults (Ti.App.Properties) on app uninstall
Delete this file
/Users/YOUR_USER/Library/Developer/CoreSimulator/Devices/SIM_UDID/data/Library/Preferences/APP_ID.plist
find-up() {
local path=$(pwd)
while [[ "$path" != "" && ! -e "$path/$1" ]]; do
path=${path%/*}
done
if [ "$path" != "" ]
then
echo "$path"
fi
}
@TatsuoWatanabe
TatsuoWatanabe / alloy.jmk
Last active September 7, 2015 18:57
Titanium + Alloy + TypeScript1.0RC のコンパイル ref: http://qiita.com/TatsuoWatanabe/items/14e6b8062d64d895e465
task("pre:compile", function(event,logger) {
var wrench = require("wrench"),
fs = require("fs"),
path = require("path");
var code = [
fs.readFileSync("/usr/local/lib/node_modules/alloy/bin/tsc.js"), // <- path to tsc.js in your environment
"module.exports = TypeScript;"
].join("");
fs.writeFileSync(process.env.TMPDIR + "tsc.js", code);
@wbroek
wbroek / genymotionwithplay.txt
Last active November 8, 2024 01:24
Genymotion with Google Play Services for ARM
NOTE: Easier way is the X86 way, described on https://www.genymotion.com/help/desktop/faq/#google-play-services
Download the following ZIPs:
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)
Download the correct GApps for your Android version:
Google Apps for Android 6.0 (https://www.androidfilehost.com/?fid=24052804347835438 - benzo-gapps-M-20151011-signed-chroma-r3.zip)
Google Apps for Android 5.1 (https://www.androidfilehost.com/?fid=96042739161891406 - gapps-L-4-21-15.zip)
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip)
@willurd
willurd / web-servers.md
Last active November 13, 2024 13:44
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@kwhinnery
kwhinnery / howto.md
Created May 13, 2013 00:42
Execute "tishadow run" in your Titanium app directory whenever a JavaScript file changes.

Automatic TiShadow Installs

Execute "tishadow run" in your Titanium app directory whenever a JavaScript file changes. Edit your JS files in a text editor, save, then switch to the test device or simulator. Profit.

Install supervisor

[sudo] npm install -g supervisor

Execute tishadow run anytime a JavaScript file changes

@myleftboot
myleftboot / social.js
Created March 5, 2013 20:17
An implementation of social.js for Appcelerator Titanium. Works with Twitter v1.1 effective from 5th March 2013
/**
* This is a JavaScript module for Titanium Mobile made by Dawson Toth. I adapted the majority of this code from other
* authors to make it easy to share content on social sites through a single interface.
*
* Example usage: http://appc.me/social.sample.js
*
*/
//