Skip to content

Instantly share code, notes, and snippets.

View asciimike's full-sized avatar
🔥
All the things

Mike McDonald asciimike

🔥
All the things
View GitHub Profile
@asciimike
asciimike / gist:c50b8810b95c51ccc2c0
Created July 31, 2014 17:57
Snippet of code for handling Twitter multiple login using Firebase Simple Login
@interface TwitterTest()
@property (strong, nonatomic) NSString *currentTwitterHandle;
@end
@implementation TwitterTest // Note, must conform to the <UIActionSheetDelegate> protocol
- (void)authenticateWithTwitter;
{
@asciimike
asciimike / TwitterTest.m
Created July 31, 2014 17:58
Snippet of code for handling Twitter multiple login using Firebase Simple Login
@interface TwitterTest()
@property (strong, nonatomic) NSString *currentTwitterHandle;
@end
@implementation TwitterTest // Note, must conform to the <UIActionSheetDelegate> protocol
- (void)authenticateWithTwitter;
{
@asciimike
asciimike / fireimport.py
Last active September 17, 2015 18:53
Multiple JSON files to single JSON file, with key sanitization, for data import into Firebase
#!/usr/bin/python
import sys, os, getopt, re, json
def main(argv):
inputpath = ''
outputfile = ''
verbose = False;
outputDictionary = {}
try:
@asciimike
asciimike / firebase-util.js
Last active March 20, 2016 04:49
Firebase Friend List with Presence and Idle
/*! Firebase-util - v0.1.2 - 2014-01-11
* https://github.com/firebase/firebase-util
* Copyright (c) 2014 Firebase
* MIT LICENSE */
(function(exports) {
/**
* @var {Object} a namespace to store internal utils for use by Firebase.Util methods
*/
@asciimike
asciimike / stylesheet.css
Created September 26, 2014 06:02
Firechat template modification example
.user-chat-username {
color:red;
}
@asciimike
asciimike / mirror.js
Created December 3, 2014 22:20
Mirror a Firebase to a second Firebase
var Firebase = require('firebase');
var fromRef = new Firebase('https://<FROM-FIREBASE>.firebaseio.com');
var toRef = new Firebase('https://<TO-FIREBASE>.firebaseio.com');
function main(){
mirrorRef(fromRef,toRef);
}
function mirrorRef(fromReference, toReference){
@asciimike
asciimike / index.html
Created January 22, 2015 02:50
Firebase Client Side Crypto Demo
<!doctype html>
<html>
<head>
<title>JavaScript RSA Encryption</title>
<script src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
<script src="https://cdn.firebase.com/js/client/2.0.4/firebase.js"></script>
<script src="jsencrypt/bin/jsencrypt.min.js"></script>
<script type="text/javascript">
// Call this code when the page is done loading.
@asciimike
asciimike / MainActivity.java
Last active March 7, 2016 22:08
Data Binding in 2015: Reactive Programming and Firebase Code Snippets
public class MainActivity extends Activity {
private ListView mListView;
private ArrayList<Message> mMessages;
private ArrayAdapter mAdapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
@asciimike
asciimike / ViewController.m
Created October 2, 2015 16:40
iOS Keyboard Helpers
-(void)viewWillAppear:(BOOL)animated {
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardShown:) name:UIKeyboardWillShowNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardHidden:) name:UIKeyboardWillHideNotification object:nil];
}
- (void)viewWillDisappear:(BOOL)animated {
[[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardWillShowNotification object:nil];
[[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardWillHideNotification object:nil];
}
@asciimike
asciimike / AppDelegate.swift
Last active July 12, 2021 21:56
Zero to App: Develop with Firebase (for iOS - Google I/O 2016)
///
// AppDelegate.swift
// ZeroToApp
//
import UIKit
import Firebase
import FBSDKCoreKit
@UIApplicationMain