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
<?php | |
ini_set('display_error', 1); | |
error_reporting(E_ALL & ~E_NOTICE); | |
class skyDriveDL { | |
// Location | |
private $loc; | |
// File | |
private $file; | |
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
#encoding: UTF-8 | |
class SkydriveGetter | |
attr_reader :fullLocation, :file | |
def initialize(id, file) | |
id = URI.decode(id) if id.include?('%') | |
@loc = id | |
@file = file |
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
<?php | |
/** | |
* Library Extension :: Extension of PHP STL. | |
**/ | |
function kDate($_addHyphen = false) { | |
return date($_addHyphen ? 'Y-m-d' : 'Ymd'); | |
} | |
function kDatetime() { |
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
#-*- coding: utf-8 -*- | |
import re | |
class MinifyMiddleware(object): | |
spaces = re.compile(r'^\s+', re.MULTILINE) | |
comments = re.compile(r'(\<!--\s*.*?((--\>)|$))', re.MULTILINE) | |
blank_attrs = re.compile(r'(\s\w+\=[\'|"]{2})', re.MULTILINE) | |
tag_types = re.compile(r'(\stype\=[\'|"]text\/\w+[\'|"])', re.MULTILINE) | |
def process_response(self, request, response): |
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
<?php | |
function find_entry($dir, $orign_dir='') { | |
if(!is_dir($dir)) return null; | |
$d = dir($dir); | |
$result = ""; | |
while($entry = $d->read()) { | |
if($entry != "." && $entry != "..") { | |
if(is_dir($dir . "/" . $entry)) { |
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
/* | |
* 정확히 AppleGothic만 다른 글꼴로 바꾸는 사용자 스타일 시트 | |
* | |
* 애플고딕을 쓰도록 명시적으로 지정한 사이트에서도 원하는 글꼴로 바꿀 수 있게 해주는 방법이며, | |
* 영문 글꼴이나 다른 한글 글꼴까지 몽땅 하나로 통일해서 써야 했던 font-family를 강제로 지정하는 방식과는 달리 | |
* 정확히 애플고딕만 다른 글꼴로 바꿔서 사용하는 매우 깔끔한 방법입니다. :) | |
* | |
* 사용 방법: | |
* Safari는 아무 곳에나 저장해두고 환경설정 > 고급 > 스타일 시트에서 파일 선택 | |
* Google Chrome은 ~/Library/Application Support/Google/Chrome/Default/User StyleSheets/Custom.css |
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 | |
# | |
# First: Filename (*.html, *.rb, *.py and etc) | |
# Second: Find | |
# Third: Replacement | |
$pwd = Dir.pwd | |
$args = [] | |
ARGV.each { |arg| $args.push(arg) } | |
if $args.size < 3 |
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
function setGetParam() { | |
var url = arguments[2] || location.href; | |
if (arguments[0] instanceof Object) { // hash object | |
for(var arg in arguments[0]) { | |
if (!arg || !arguments[0][arg]) continue; | |
url = setGetParam(arg, arguments[0][arg], url); | |
} | |
} else if (typeof arguments[0] === 'string' && arguments[1]) { | |
paramName = arguments[0]; |
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
'3423112'.replace(/\d(?=(?:\d{3})+$)/g,'$&,') | |
"3,423,112" | |
'3423112'.replace(/(?!^)(?=(?:\d{3})+$)/g,',') | |
"3,423,112" |
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
#!/bin/sh | |
### BEGIN INIT INFO | |
## END INIT INFO | |
# You will need to modify these.. | |
APP="app_name" | |
APP_DIR="/var/www/${APP}" | |
CONFIG_FILE="${APP_DIR}/config/sidekiq.yml" | |
REQUIRE="${APP_DIR}/config/workers.rb" | |
PID_FILE="${APP_DIR}/tmp/sidekiq.pid" |
OlderNewer