Skip to content

Instantly share code, notes, and snippets.

View aaronksaunders's full-sized avatar

Aaron K Saunders aaronksaunders

View GitHub Profile
@anitahall102790
anitahall102790 / Javascript Lesson One Project
Last active December 3, 2015 18:05
Justin Bieber "Game"
// Check if the user is ready to play!
confirm("I am ready to play!");
var age = prompt("What's your age?");
if (age < 13) {
console.log("You are able to play but I am not responsible if you are traumatized")
}
else {
console.log("Lets Play!")
@johnpapa
johnpapa / create new file
Last active January 4, 2021 15:09
Getting Started Super Fast - Angular 2 CDN'd
npm init –y
npm i angular2 systemjs --save --save-exact
npm i typescript tsd live-server --save-dev
/**
* ================== angular-ios9-uiwebview.patch.js v1.1.1 ==================
*
* This patch works around iOS9 UIWebView regression that causes infinite digest
* errors in Angular.
*
* The patch can be applied to Angular 1.2.0 – 1.4.5. Newer versions of Angular
* have the workaround baked in.
*
* To apply this patch load/bundle this file with your application and add a
@robertjpayne
robertjpayne / RCTSwiftBridgeModule.h
Last active January 17, 2024 11:43
React Native - Swift Native Modules
#import <Foundation/Foundation.h>
#import "RCTBridgeModule.h"
#define RCT_EXTERN_MODULE(objc_name, objc_supername) \
RCT_EXTERN_REMAP_MODULE(objc_name, objc_name, objc_supername)
#define RCT_EXTERN_REMAP_MODULE(js_name, objc_name, objc_supername) \
objc_name : objc_supername \
@end \
@interface objc_name (RCTExternModule) <RCTBridgeModule> \
@kocyigityunus
kocyigityunus / IosStyleNav1.js
Created April 7, 2015 06:45
Navgiation Bar Example
'use strict';
var React = require('react-native');
var {
ActivityIndicatorIOS,
ListView,
Navigator,
StyleSheet,
Text,
TextInput,
@premiumFrye
premiumFrye / pf-mobilePolyForm.js
Last active July 7, 2016 11:00
A directive for making Android behave a bit more like iOS when filling out forms using the ionic framework. Directive will automatically advance cursor to next field when user taps return, and if the next field is a select input, automatically pop open options. Additionally, this directive solves an issue where angularjs won't update ng-model an…
/*global ionic*/
// for example usage, see http://codepen.io/premiumfrye/pen/pJMOZe
angular.module('pf-mobilePolyForm', [])
.directive('mobileFormPolyfill', function ($timeout, $parse) {
// keep track of our input fields for jumping to the next
var inputs = [],
// any other methods declared in template for ng-keydown that we'll want called
keydownFns = [];
@JedWatson
JedWatson / API-Auth-With-KeystoneJS.md
Last active April 16, 2023 02:11
API Auth with KeystoneJS

To implement API authentication in KeystoneJS, you need the following:

For key based authentication

  • Middleware that validates the key in the request body or a header

For session based authentication

  • An endpoint that handles signin
  • An endpoint that handles signout
@chriseidhof
chriseidhof / gcd.swift
Created August 28, 2014 01:08
GCD Wrappers
import Foundation
// Executes an array of blocks in parallel, but only returns after they're all done.
func parallel(blocks: [() -> ()]) {
let group = dispatch_group_create()
let queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)
for block in blocks {
dispatch_group_async(group, queue, block)
}
@cb1kenobi
cb1kenobi / appid.js
Created August 4, 2014 17:23
Titanium CLI hook that changes the app id
/* Put this file in <product dir>/plugins/appid/hooks/
* then add this to your tiapp.xml:
* <plugins>
* <plugin>appid</plugin>
* </plugins>
*/
exports.cliVersion = '>=3.2.1';
exports.init = function (logger, config, cli, appc) {
@tonylukasavage
tonylukasavage / app.js
Created June 2, 2014 14:51
Inject environment variables into Titanium. Makes shared code easier to manage (no more sanitizing keys in repos). Uses Titanium to encrypt the values.
// now you can use it in a titanium app
useSomeApi(Ti.App.Properties.getString('SOME_API_KEY'));