This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// You have 3 choices | |
// 1st : npm way, you can use any npm after this (yeah!) | |
// Refer to : http://stackoverflow.com/questions/10165978/how-do-we-or-can-we-use-node-modules-via-npm-with-meteor | |
// $ meteor add meteorhacks:npm | |
// 2nd : mrt way | |
// $ meteor add mrt:firebase | |
// 3rd : diy way | |
// refer to : https://gist.github.com/kenyee/6307258 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Firebase = Meteor.npmRequire("firebase"); | |
var firebase = new Firebase('https://radiant-inferno-foo.firebaseio.com/'); | |
firebase.on('child_added', willLog); | |
firebase.on('child_changed', willLog); | |
firebase.on('child_removed', willLog); | |
function willLog(snapshot) { | |
console.log(snapshot.key() + " : " + EJSON.stringify(snapshot.val())); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://github.com/firebase/firebase-token-generator-node | |
Meteor.methods({ | |
enterChat: function (userId) { | |
if (!userId) { | |
throw new Meteor.Error("not-logged-in", | |
"Must be logged in to enter chat."); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Meteor.methods({ | |
getFirebaseToken: function (userId) { | |
if (!userId) { | |
throw new Meteor.Error("not-logged-in", | |
"Must be logged in to enter chat."); | |
} | |
var FirebaseTokenGenerator = Meteor.npmRequire("firebase-token-generator"); | |
var tokenGenerator = new FirebaseTokenGenerator(YOUR_FIREBASE_SECRET); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ref : https://github.com/meteorhacks/meteor-aggregate | |
Meteor.startup(function () { | |
// C : insert | |
console.log("## insert"); | |
// insert list | |
var list_id = Lists.insert({ | |
name: "foo", | |
incompleteCount: 1, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
zip -d foo.zip __MACOSX/\* | |
zip -d foo.zip \*/.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Shader "Transparent/Cutout/DiffuseBack" { | |
Properties { | |
_Color ("Main Color", Color) = (1,1,1,1) | |
_MainTex ("Base (RGB) Trans (A)", 2D) = "white" {} | |
_Cutoff ("Alpha cutoff", Range(0,1)) = 0.5 | |
} | |
SubShader { | |
Tags {"Queue"="AlphaTest" "IgnoreProjector"="True" "RenderType"="TransparentCutout"} | |
Cull front |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.IO; | |
using System.Net; | |
using System.Net.Sockets; | |
using System.Threading; | |
using System.Diagnostics; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.IO; | |
using System.Net; | |
using System.Net.Sockets; | |
using System.Threading; | |
using System.Diagnostics; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
// 2016 eh? | |
var dateString = "Fri Jan 01 00:00:00 +1100 2016" | |
let dateFormatter = NSDateFormatter() | |
dateFormatter.dateFormat = "E MMM dd HH:mm:ss Z yyyy" | |
let calendar = NSCalendar.currentCalendar() | |
let components = calendar.components([.Day , .Month , .Year], fromDate: dateFormatter.dateFromString(dateString)!) |