Skip to content

Instantly share code, notes, and snippets.

:octocat:
Ramping

Yonghwan SO sio4

:octocat:
Ramping
Block or report user

Report or block sio4

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
@sio4
sio4 / swagger12.json
Last active Mar 6, 2019
Swagger 1.2 example
View swagger12.json
{
"apiVersion": "1.0.0",
"swaggerVersion": "1.2",
"basePath": "http://petstore.swagger.wordnik.com/api",
"resourcePath": "/store",
"produces": [
"application/json"
],
"authorizations": {},
"apis": [
@sio4
sio4 / resize_nocrop_noscale
Created Mar 27, 2016 — forked from maxivak/resize_nocrop_noscale
Crop and resize an image using MiniMagick in Ruby on Rails. Two approaches.
View resize_nocrop_noscale
def resize_nocrop_noscale(image, w,h)
w_original = image[:width].to_f
h_original = image[:height].to_f
if w_original < w && h_original < h
return image
end
# resize
image.resize("#{w}x#{h}")
@sio4
sio4 / authenticated_rest_adapter.js
Created Dec 10, 2015 — forked from marcoow/authenticated_rest_adapter.js
custom REST adapter for ember-data that sends the authentication token in a header
View authenticated_rest_adapter.js
App.AuthenticatedRESTAdapter = DS.RESTAdapter.extend({
ajax: function(url, type, hash) {
hash = hash || {};
hash.headers = hash.headers || {};
hash.headers['X-AUTHENTICATION-TOKEN'] = this.authToken;
return this._super(url, type, hash);
}
});
@sio4
sio4 / softlayer-api-test.rb
Created Jul 3, 2015
SoftLayer API Test (Ruby)
View softlayer-api-test.rb
#!/usr/bin/env ruby
require 'softlayer_api'
USER = "@@USERNAME@@"
API_KEY = "@@API_KEY@@"
client = SoftLayer::Client.new(username: USER, api_key: API_KEY)
puts client.to_json
View gist:a18c2272b75d74907c88
###
# Namespace
###
Semantic = window.Semantic = Ember.Namespace.create
UI_DEBUG: false
UI_PERFORMANCE: false
UI_VERBOSE: false
###
# Mixin
View git-http.site
server {
...
# git via nginx ------------------------------------------------------
location ~ /git(/.*) {
auth_basic "";
auth_basic_user_file /var/git/.htpasswd;
fastcgi_pass unix:/var/run/fcgiwrap.socket;
fastcgi_param SCRIPT_FILENAME /usr/lib/git-core/git-http-backend;
fastcgi_param GIT_HTTP_EXPORT_ALL "";
fastcgi_param GIT_PROJECT_ROOT /var/git;
@sio4
sio4 / gitle-new-repo.sh
Created Dec 17, 2014
HTTP 서비스용 Git 저장소 만들기
View gitle-new-repo.sh
#!/bin/bash
umask 002
repo=$1
repo_base=/var/git
[ "$repo" = "" ] && { echo "usage: $0 new_repo_name"; exit; }
git --bare init $repo_base/$repo.git && \
cd $repo_base/$repo.git && \
@sio4
sio4 / outlook-macro-forward.vb
Last active Aug 29, 2015
MS Outlook Macro for forwarding message to me by single click.
View outlook-macro-forward.vb
Public Sub ResendToMe()
Dim oMail As Outlook.MailItem
Dim objItem As Object
Dim addr As String
addr = Application.GetNamespace("MAPI").Accounts.Item(1).SmtpAddress
For Each objItem In ActiveExplorer.Selection
Set oMail = objItem.Forward
oMail.Subject = "Delayed - " + oMail.Subject
@sio4
sio4 / outlook-macro-save-msg.vb
Last active Aug 29, 2015
MS Outlook Macro for saving message(s) by single click.
View outlook-macro-save-msg.vb
Option Explicit
Public Sub SaveMessageAsMsg()
Dim oMail As Outlook.MailItem
Dim objItem As Object
Dim sPath As String
Dim dtDate As Date
Dim sName As String
Dim sSender As String
Dim enviro As String
@sio4
sio4 / app_logger.rb
Created Oct 5, 2014
custom application log for rails app.
View app_logger.rb
# lib/app_logger.rb
# vim: set ts=2 sw=2 expandtab:
class AppLogger < Logger
def format_message(severity, timestamp, progname, msg)
"#{timestamp.to_formatted_s(:db)} #{severity} #{msg}\n"
end
end
LOGGER = AppLogger.new('log/application.log', 'weekly')
You can’t perform that action at this time.