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 / AndroidManifest.xml
Created December 27, 2016 14:10
Android Launcher Badge
<!-- Samsung -->
<uses-permission android:name="com.sec.android.provider.badge.permission.READ" />
<uses-permission android:name="com.sec.android.provider.badge.permission.WRITE" />
<!-- Sony -->
<uses-permission android:name="com.sonyericsson.home.permission.BROADCAST_BADGE" />
<!-- HTC -->
<uses-permission android:name="com.htc.launcher.permission.READ_SETTINGS" />
<uses-permission android:name="com.htc.launcher.permission.UPDATE_SHORTCUT" />
@suhanlee
suhanlee / ko.yml
Last active January 5, 2017 15:54
Rails i18n yml files
ko:
datetime:
distance_in_words:
less_than_x_seconds: "%{count}초 전"
less_than_x_minutes: "%{count}분 전"
half_a_minute: "30초 전"
x_minutes: "%{count}분 전"
about_x_hours: "%{count}시간 전"
x_days: "%{count}일 전"
about_x_months: "%{count}달 전"
@suhanlee
suhanlee / server.rb
Created October 17, 2016 08:37
Sinatra local directory server
require 'sinatra'
$pwd = ENV['PWD']
configure do
set :server, :puma
set :root, File.dirname(__FILE__)
set :port, 7777
end
@suhanlee
suhanlee / react-native-alert.js
Created October 15, 2016 03:27
react-native example
import React, { Component } from 'react';
import { AppRegistry, View, TouchableHighlight, Text, Alert } from 'react-native';
// corporate ipsum > lorem ipsum
var alertMessage = 'Credibly reintermediate next-generation potentialities after goal-oriented ' +
'catalysts for change. Dynamically revolutionize.';
class AlertApp extends Component {
constructor(props) {
super(props)
@suhanlee
suhanlee / pg backups.sh
Last active July 20, 2016 07:24
heroku pg backup script
# 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
@suhanlee
suhanlee / hash key
Created July 4, 2016 17:52
Social Login
# 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
# "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
@suhanlee
suhanlee / cmd_line
Created June 24, 2016 08:04
Imagemagick
$ convert [Input_file] [output_file]
# convert input.mp4 output.gif
@suhanlee
suhanlee / call url.java
Last active June 20, 2016 20:40
Instagram-android
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);
@suhanlee
suhanlee / get frame count
Last active August 9, 2016 08:03
ffmpeg command line
$ ffprobe -select_streams v -show_streams -count_frames [input file]
$ ffmpeg -i [input_file]
# fps * duration_time