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
#!/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 + "'" \ |
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
#!/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 |
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
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 |
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
web: gunicorn app:app |
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
$ ffprobe -select_streams v -show_streams -count_frames [input file] | |
$ ffmpeg -i [input_file] | |
# fps * duration_time |
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
Intent insta_intent = getPackageManager().getLaunchIntentForPackage("com.instagram.android"); | |
insta_intent.setComponent(new ComponentName("com.instagram.android", "com.instagram.android.activity.UrlHandlerActivity")); | |
insta_intent.setData(Uri.parse("https://www.instagram.com/explore/tags/tech/")); // 해시태그 주소 넣기 | |
startActivity(insta_intent); |
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
$ convert [Input_file] [output_file] | |
# convert input.mp4 output.gif |
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
# "Can't verify CSRF token authenticity" for json format | |
class ApplicationController < ActionController::Base | |
protect_from_forgery with: :null_session, only: Proc.new { |c| c.request.format.json? } | |
end |
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
# google plus login | |
keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore -list -v | |
# facebook login | |
keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64 |
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
# check pg backup schedules | |
$ heroku pg:backups schedules | |
# unschedule | |
$ heroku pg:backups unschedule DATABASE_URL | |
# download backup file | |
$ curl -o latest.dump `heroku pg:backups public-url` | |
# restore db-backup-file |
OlderNewer