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 | |
while getopts dyh OPT | |
do | |
case $OPT in | |
"d" ) | |
flag_d=1 | |
;; | |
"y" ) | |
flag_y="-y" |
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 | |
header('Content-Type: application/json'); | |
$secret = 'パスワード'; | |
$repo = 'リポジトリの名前'; | |
function generate_response($code) { | |
$response = array( | |
'200' => array( | |
'status' => 'success', | |
'errors' => null |
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
#how to use in template | |
# | |
#{{ page.tag }}'s post' | |
#<a href="{{site.url}}{{ page.tag_previous.url }}">« {{ page.tag_previous.title }}</a> | |
#<a href="{{site.url}}{{ page.tag_next.url }}">{{ page.tag_next.title }} »</a> | |
# | |
module Jekyll | |
class TagAwarePreviousNextGenerator < Generator | |
safe true |
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 python3 | |
# libvte-2.90-9 | |
from gi.repository import Gtk, Vte, GLib | |
class VteWindow(Gtk.Window): | |
def __init__(self): | |
Gtk.Window.__init__(self) # now self means Gtk.Window object | |
# Create a virtual terminal |
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
javascript:(function(){var%20e=function(t,n,r,i,s){var%20o=[1340913,5798130,5000562,5283307,5168011,1469845,5181843,5267827,5592619,3956242];var%20i=i||0,u=0,n=n||[],r=r||0,s=s||0;var%20a={'a':97,'b':98,'c':99,'d':100,'e':101,'f':102,'g':103,'h':104,'i':105,'j':106,'k':107,'l':108,'m':109,'n':110,'o':111,'p':112,'q':113,'r':114,'s':115,'t':116,'u':117,'v':118,'w':119,'x':120,'y':121,'z':122,'A':65,'B':66,'C':67,'D':68,'E':69,'F':70,'G':71,'H':72,'I':73,'J':74,'K':75,'L':76,'M':77,'N':78,'O':79,'P':80,'Q':81,'R':82,'S':83,'T':84,'U':85,'V':86,'W':87,'X':88,'Y':89,'Z':90,'0':48,'1':49,'2':50,'3':51,'4':52,'5':53,'6':54,'7':55,'8':56,'9':57,'\/':47,':':58,'?':63,'=':61,'-':45,'_':95,'&':38,'$':36,'!':33,'.':46};if(!s||s==0){t=o[0]+t}for(var%20f=0;f<t.length;f++){var%20l=function(e,t){return%20a[e[t]]?a[e[t]]:e.charCodeAt(t)}(t,f);if(!l*1)l=3;var%20c=l*(o[i]+l*o[u%o.length]);n[r]=(n[r]?n[r]+c:c)+s+u;var%20p=c%(50*1);if(n[p]){var%20d=n[r];n[r]=n[p];n[p]=d}u+=c;r=r==50?0:r+1;i=i==o.length-1?0:i+1}if(s==140){var%20v |
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
javascript:(function(){EN_CLIP_HOST='http://www.evernote.com';try{var%20x=document.createElement('SCRIPT');x.type='text/javascript';x.src=EN_CLIP_HOST+'/public/bookmarkClipper.js?'+(new%20Date().getTime()/100000);document.getElementsByTagName('head')[0].appendChild(x);}catch(e){location.href=EN_CLIP_HOST+'/clip.action?url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title);}})() |
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 | |
# RSS を配信していないホームページで、指定したhtmlに更新(変化)があった場合に、メールでお知らせする | |
# cron で利用する | |
url=http://hogehoge.ne.jp | |
title="「ほげほげ」で更新がありました" | |
to=to@example.com | |
from=from@example.com |
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
;; OS で直接開きたいファイルかどうかを判定する | |
(defun os-open-file-p (file) | |
(if (file-regular-p file) | |
(let ((ext (file-name-extension file)) | |
;; OS で起動したいファイルの拡張子一覧 | |
(os-open-file-suffixes '("doc" "docx" | |
"xls" "xlsx" | |
"ppt" "pptx" | |
"mdb" "mdbx" | |
"vsd" "vdx" "vsdx" |
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
(defun trim (string &optional needle) | |
"Remove needle at the beginning and endding of string." | |
(let ((n (if needle needle "[ \t\n\r]+")) | |
(s (if (string-match (concat "\\`" n) string) ; "\`" バッファや文字列の先頭 | |
(replace-match "" t t string) | |
string))) | |
(if (string-match (concat n "+\\'") s) ; "\'" バッファや文字列の末尾 | |
(replace-match "" t t s) | |
s))) |
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
(add-hook 'kill-emacs-hook 'frame-size-save); Emacs終了時 | |
(add-hook 'window-setup-hook 'frame-size-resume); Emacs起動時 | |
(defun frame-size-save () | |
(set-buffer | |
(find-file-noselect (expand-file-name "~/.emacs.d/.framesize"))) | |
(erase-buffer) | |
(insert (concat | |
"(set-frame-width (selected-frame) " | |
(int-to-string (frame-width)) | |
") (set-frame-height (selected-frame) " |
OlderNewer