- キャンペーンデータ管理
- 最適化
- アカウント管理
- ユーティリティ
This file contains hidden or 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
_rake() { | |
local cache='./.rake_tasks' | |
local generate_cache='rake --silent --tasks 2> /dev/null | cut -f 2 -d " " > ${cache}' | |
__updated_at(){ echo $(stat -f "%m" $1) } | |
if [ -f './Rakefile' ]; then | |
if [ ! -f ${cache} ] || \ | |
[ "$( cat ${cache} | wc -l )" = "0" ] || \ | |
[ $( __updated_at ${cache} ) -lt $( __updated_at './Rakefile' ) ] || \ | |
[ -f './Gemfile' -a $( __updated_at ${cache} ) -lt $( __updated_at './Gemfile' ) ]; then |
This file contains hidden or 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/bash | |
current=$(osascript -e "output volume of (get volume settings)") | |
if [ ${#@} -eq 0 ];then | |
echo "current volume: $current" | |
exit | |
fi | |
set=$current | |
num=10 |
This file contains hidden or 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/expect | |
set timeout 10 | |
spawn ssh [lindex $argv 0] | |
expect { | |
"Last login" { | |
send [lrange $argv 1 $argc]\n | |
send exit\n | |
} | |
timeout { |
This file contains hidden or 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
" vimscript | |
" functionじゃないrcファイルとかをまるごとfunctionとして再定義する | |
" 動的なfunction生成できる | |
" 下の例だと、外部ファイルの内容をまるまる function にする | |
function! s:define_function(funcname, file) dict | |
let l:file = readfile(a:file) | |
let l:def = "function! s:" . a:funcname . "() dict\n" | |
for i in l:file | |
let l:def .= i . "\n" | |
endfor |
This file contains hidden or 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
class String | |
def cabmridge | |
tmp = [] | |
split(' ').each do |word| | |
tmp2 = [] | |
chars = word.chars | |
first = chars.shift | |
last = chars.pop | |
tmp.push tmp2.push(first).concat(chars.shuffle).push(last).join('') |
This file contains hidden or 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
package main | |
import "fmt" | |
func main() { | |
for i := 1; i < 100; i++ { | |
fmt.Println(fizzbuzz(i)) | |
} | |
} |
This file contains hidden or 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 | |
class ParentClass | |
{ | |
private $privateProperty = 'inParent'; | |
public function __get($name) | |
{ | |
if (property_exists(get_class($this), $name)) { | |
return $this->$name; | |
} |
OlderNewer