| GitHub | Hatena | Google+ | |
|---|---|---|---|
<style> |
|||
<link> |
? | ? | |
<div> |
YES | YES | |
<h1> |
YES | YES | |
<br> |
YES | YES |
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
| import sys | |
| import time | |
| import ctypes | |
| import subprocess | |
| CTRL_C_EVENT = 0 | |
| CTRL_BREAK_EVENT = 1 | |
| if len(sys.argv) == 1: | |
| for i in range(2): |
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
| Windows Registry Editor Version 5.00 | |
| [HKEY_CLASSES_ROOT\7-Zip.001\shell] | |
| @="extract" | |
| [HKEY_CLASSES_ROOT\7-Zip.001\shell\extract] | |
| @="Extract to Folder" | |
| [HKEY_CLASSES_ROOT\7-Zip.001\shell\extract\command] | |
| @="\"C:\\Program Files\\7-Zip\\7zG.exe\" x \"%1\" -o*" | |
| [HKEY_CLASSES_ROOT\7-Zip.7z\shell] |
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
| /** | |
| * escaperegexpchar.js | |
| * Escape the regular expression string (ES5 compliant). | |
| * Escape string can be passed to the () new RegExp(). | |
| * | |
| * @version 1.0.2 | |
| * @author think49 | |
| * @url https://gist.github.com/think49/7691225 | |
| * @license http://www.opensource.org/licenses/mit-license.php (The MIT License) | |
| * @see <a href="http://es5.github.io/#x15.10.1">15.10.1 Patterns - Annotated ES5.1</a> |
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 | |
| //write kazua | |
| function convGtJDate($src) { | |
| list($year, $month, $day) = explode('/', $src); | |
| if (!@checkdate($month, $day, $year) || $year < 1869 || strlen($year) !== 4 | |
| || strlen($month) !== 2 || strlen($day) !== 2) return false; | |
| $date = str_replace('/', '', $src); | |
| if ($date >= 19890108) { | |
| $gengo = '平成'; |
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/env python3 | |
| import sys | |
| import fontforge | |
| def main(file): | |
| for font in fontforge.fontsInFile(file): | |
| f = fontforge.open(u'%s(%s)' % (file, font)) | |
| f.generate('%s.ttf' % font) |
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
| import win32serviceutil | |
| import win32service | |
| import win32event | |
| import servicemanager | |
| import socket | |
| import time | |
| import logging | |
| logging.basicConfig( | |
| filename = 'c:\\Temp\\hello-service.log', |
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
| // 現在実行中のスクリプトタグを取得 | |
| var currentScript = document.currentScript || (function() { | |
| var nodeList = document.getElementsByTagName('script') | |
| return nodeList.item(nodeList.length - 1) | |
| }()) | |
| var text = currentScript.text // text で内部テキストが取得できる。 | |
| //=> "\n ここのテキストを取得したい\n " |
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/bash | |
| # | |
| # Usage: mpegts2h264.sh <src.ts> <dst.mp4> | |
| # | |
| program_no=$(ffmpeg -i $1 2>&1 | grep Program | head -n 1 | awk '{ print $2 }') | |
| video_sid=$(ffmpeg -i $1 2>&1 | grep Stream | grep Video | sed -e "s/^.*Stream #0:0\[0x\([0-9a-f][0-9a-f][0-9a-f]\)\].*$/\1/g") | |
| audio_sid=$(ffmpeg -i $1 2>&1 | grep Stream | grep Audio | sed -e "s/^.*Stream #0:1\[0x\([0-9a-f][0-9a-f][0-9a-f]\)\].*$/\1/g") | |
| gst-launch-1.0 filesrc location=./$1 ! progressreport ! \ |
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
| /* | |
| * RC4 symmetric cipher encryption/decryption | |
| * | |
| * @license Public Domain | |
| * @param string key - secret key for encryption/decryption | |
| * @param string str - string to be encrypted/decrypted | |
| * @return string | |
| */ | |
| function rc4(key, str) { | |
| var s = [], j = 0, x, res = ''; |