Skip to content

Instantly share code, notes, and snippets.

Tony Xiao tonyxiao

Block or report user

Report or block tonyxiao

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@tonyxiao
tonyxiao / router.js
Created Sep 9, 2016
GraphQL authentication
View router.js
router.post('/graphql', (ctx) => {
return apolloKoa({
schema: executableSchema,
context: {
headers: ctx.request.headers,
},
printErrors: true,
})(ctx)
})
View sendbirdUnminified.js
! function(e, n) {
var t = n();
"function" == typeof define && define.amd ? define([], t.getInstance()) : "object" == typeof exports ? (module.exports = t.getInstance(), module.exports.SB = t, module.exports.sendbird = t.getInstance()) : (e.SB = t, e.sendbird = t.getInstance())
}(this, function() {
function e() {
try {
if ("undefined" == typeof navigator || "undefined" == typeof navigator.userAgent) return !1;
var e = navigator.userAgent.toLowerCase();
return -1 != e.indexOf("msie") ? parseInt(e.split("msie")[1]) : !1
} catch (n) {
@tonyxiao
tonyxiao / docheadRoutes.jsx
Created Mar 10, 2016
Inject custom dochead into html returned by meteor server. Credit goes to https://github.com/thereactivestack/meteor-react-router-ssr
View docheadRoutes.jsx
import React from 'react'
import {IndexRoute, Route} from 'react-router'
import Helmet from 'react-helmet'
const wrap = (Component) => (location, cb) => {
cb(null, Component)
}
const makeHelmet = (info) => {
const {title, description, image, url} = {
View keybase.md

Keybase proof

I hereby claim:

  • I am tonyxiao on github.
  • I am tonyx (https://keybase.io/tonyx) on keybase.
  • I have a public key whose fingerprint is C754 3E03 15B7 33C6 1C3B E4BC 8A3A 3627 015F 2E03

To claim this, I am signing this object:

View get_crashlytics_ipa.py
#!/usr/bin/env python
from urlparse import urlparse, parse_qs
import urllib2
import plistlib
import webbrowser
print 'Enter url copied from Crashlytics Beta iOS webpage'
print 'Should look like itms-services://?action=download-manifest&url=https%3A%2F%2Fapps.crashlytics.com%2Fprojects...'
itms_url = raw_input('Enter item-services url: ')
result = urlparse(itms_url)
@tonyxiao
tonyxiao / Analytics.podspec
Created Feb 22, 2014
Analytics Selective Podspec
View Analytics.podspec
Pod::Spec.new do |s|
s.name = "Analytics"
s.version = "0.9.9.fork"
s.summary = "Segment.io analytics and marketing tools library for iOS."
s.homepage = "https://segment.io/libraries/ios"
s.license = { :type => "MIT", :file => "License.md" }
s.author = { "Segment.io" => "friends@segment.io" }
s.platform = :ios, '6.0'
s.source = { :git => "https://github.com/segmentio/analytics-ios.git", :commit => "06e96dbdb6bdd4b640c584bda2107c53cfd07fdb" }
s.requires_arc = true
View VideoView.m
//
// VideoView.m
// MacVideoWall
//
// Created by David Rönnqvist on 9/28/13.
// This is the source code behind the Mac Video Wall that I was trying to port to iOS in [this Stack Overflow question](http://stackoverflow.com/questions/19065816/ios-alternative-to-qtmovielayer-that-has-non-nil-contents)
//
#import "VideoView.h"
View cocoabots-uncrustify.cfg
# Uncrustify 0.59
#
# General options
#
# The type of line endings
newlines = auto # auto/lf/crlf/cr
# The original size of tabs in the input
You can’t perform that action at this time.