Skip to content

Instantly share code, notes, and snippets.

Edward Kim haruair

Block or report user

Report or block haruair

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
@haruair
haruair / dice_result.js
Created Jun 17, 2013
게임코디 주사위 결과정리 북마클릿
View dice_result.js
(function() {
var jq = document.createElement('script'); jq.type = 'text/javascript'; jq.async = false;
jq.src = '//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(jq, s);
var dice_result_gen = function(){
if(jQuery("#dice_result").length != 0) return false;
var dice_img = jQuery("img[src^=\"/dice_\"]");
var list = [];
if(dice_img.length == 0) return false;
View giant_gamecodi.js
(function() {
var jq = document.createElement('script'); jq.type = 'text/javascript'; jq.async = false;
jq.src = '//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(jq, s);
var giant_gamecodi = function(){
var giant_name = jQuery("#giant-name").val() || "진격의 고양이";
var giant_hp = parseInt(jQuery("#giant-hp").val()) || 730666;
View sshow_load_img.js
function sshow_load_img1(src, loaded) {
/* NOT possible to document.createElement('canvas').getContext('2D').drawImage( img or img.get() ) */
var img = $("<img />").attr('src', src )
.load(function() {
if (!this.complete || typeof this.naturalWidth == "undefined" || this.naturalWidth == 0) {
alert('broken image!');
} else {
if (loaded) loaded(img);
}
});
View ratebutton.m
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=824136867"]];
@haruair
haruair / gist:9971560
Created Apr 4, 2014
GIt commit name update
View gist:9971560
git filter-branch -f --commit-filter '
if [ "$GIT_COMMITTER_NAME" = "old-name" ];
then
GIT_COMMITTER_NAME="new-name";
GIT_AUTHOR_NAME="new-name";
GIT_COMMITTER_EMAIL="email@domain.name";
GIT_AUTHOR_EMAIL="email@domain.name";
git commit-tree "$@";
else
@haruair
haruair / maps3.js
Created Apr 18, 2014
Daum map API v3 with DOM
View maps3.js
(function (e, d) {
if (typeof d == "object") {
for (var f in d) {
if (d.hasOwnProperty(f)) {
e[f] = e[f] || d[f], arguments.callee(e[f], d[f]);
}
}
}
})(this, {
daum: {
@haruair
haruair / zipdeploy
Last active Aug 29, 2015
Git diff the extract as a zip file
View zipdeploy
#!/bin/bash
NOW=$(date +"%Y-%m-%d-%H%M%S")
DIFF=$(git diff --name-only deploy HEAD)
TOPLEVEL=$(git rev-parse --show-toplevel)
CURRENT=$(pwd)
if [ -z "$DIFF" ]
then
echo "😝 Sorry no diff in there."
else
cd "$TOPLEVEL"
@haruair
haruair / Person.js
Last active Aug 29, 2015
defineProperty test
View Person.js
"use strict";
var Person = function(name){
var _name = name || "Unknown";
Object.defineProperty(this, "name", {
get: function(){ return "My name is " + _name; },
set: function(newvalue){ _name = newvalue; }
});
@haruair
haruair / scrapbook.php
Created Oct 4, 2014
Scrapbook plugin for Wordpress
View scrapbook.php
<?php
/**
* @package Haruair
* @version 1.0
*/
/*
Plugin Name: Scrapbook
Description: scrapbook custom type plugin
Author: haruair
Version: 1.0
View chmoddefault
#!/bin/bash
# put this file into /usr/bin
# set the file as correct permission
read -r -p "Are you sure? [y/N] " response
case $response in
[yY][eE][sS]|[yY])
find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;
;;
*)
You can’t perform that action at this time.