Skip to content

Instantly share code, notes, and snippets.

View sio4's full-sized avatar
😱
Panic again

Yonghwan SO sio4

😱
Panic again
View GitHub Profile
@sio4
sio4 / cli-issue-241.patch
Last active December 3, 2022 07:20
patch for checking `buffalo test` flag supporting issue
diff --git a/internal/cmd/test/cmd.go b/internal/cmd/test/cmd.go
index fbadaaf..fdcd852 100644
--- a/internal/cmd/test/cmd.go
+++ b/internal/cmd/test/cmd.go
@@ -4,11 +4,20 @@ import "github.com/spf13/cobra"
func Cmd() *cobra.Command {
cmd := &cobra.Command{
- Use: "test",
- Short: "Run the tests for the Buffalo app. Use --force-migrations to skip schema load.",
@sio4
sio4 / main.go
Last active November 26, 2022 13:54
dsp highpass filter example
package main
import (
"fmt"
"log"
"math"
"net/http"
"github.com/eripe970/go-dsp-utils"
"github.com/go-echarts/go-echarts/v2/charts"
@sio4
sio4 / swagger12.json
Last active March 6, 2019 05:14
Swagger 1.2 example
{
"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 March 27, 2016 16:11 — forked from maxivak/resize_nocrop_noscale
Crop and resize an image using MiniMagick in Ruby on Rails. Two approaches.
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 December 10, 2015 03:00 — forked from marcoow/authenticated_rest_adapter.js
custom REST adapter for ember-data that sends the authentication token in a header
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 July 3, 2015 05:07
SoftLayer API Test (Ruby)
#!/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
###
# Namespace
###
Semantic = window.Semantic = Ember.Namespace.create
UI_DEBUG: false
UI_PERFORMANCE: false
UI_VERBOSE: false
###
# Mixin
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 December 17, 2014 02:06
HTTP 서비스용 Git 저장소 만들기
#!/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 August 29, 2015 14:08
MS Outlook Macro for forwarding message to me by single click.
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