Skip to content

Instantly share code, notes, and snippets.

View suhanlee's full-sized avatar
:octocat:
Focusing

kyle suhanlee

:octocat:
Focusing
View GitHub Profile
@suhanlee
suhanlee / Procfile
Last active June 13, 2016 06:01
Flask basic app deploy for heroku
web: gunicorn app:app
@suhanlee
suhanlee / regex.swift
Created April 15, 2016 05:18
regular expression swift example
class Regex {
let internalExpression: NSRegularExpression?
let pattern: String
init(_ pattern: String) {
self.pattern = pattern
do {
self.internalExpression = try NSRegularExpression(pattern: pattern, options: .CaseInsensitive)
} catch {
self.internalExpression = nil
@suhanlee
suhanlee / get_version_code.rb
Created February 17, 2016 07:38
get version-code and version-name in android's build.grade
#!/usr/bin/env ruby
filename = ARGV[0]
File.open(filename, 'r').each do |line|
versionCode = line.match(/versionCode\s(\d*)/)
if versionCode != nil
v = versionCode.captures
puts v
end
end
@suhanlee
suhanlee / gcm-send-curl.py
Last active February 26, 2016 06:35
Simple GCM Send Script
#!/usr/bin/env python
import os
API_KEY='API_KEY'
DEVICE_TOKENS = 'DEVICE_TOKEN'
MESSAGES = "messages"
command_string = "curl https://android.googleapis.com/gcm/send" \
" -H 'Content-Type: application/json'" \
" -H 'Authorization: key=" + API_KEY + "'" \