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
string.split_it = function(str, sep) | |
if str == nil then return nil end | |
assert(type(str) == "string", "str must be a string") | |
assert(type(sep) == "string", "sep must be a string") | |
return string.gmatch(str, "[^\\" .. sep .. "\n]+") | |
end | |
string.split = function(str, sep) | |
local ret = {} | |
for seg in string.split_it(str, sep) do | |
ret[#ret+1] = seg |
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/bash | |
set -e | |
function genfn { | |
printf "s%02d-%04d.ppm" $1 $2; | |
} | |
function print_usage { | |
echo "[Usage] $0 dark-frame [dcraw_option]" | |
} |
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/bash | |
set -e | |
shopt -s nocasematch | |
function print_usage { | |
echo "[Usage] $0 input-files dark-frame output-filename [dcraw_option]" | |
} | |
function print_header { | |
echo -e "\033[0;34m==> \033[0;35m$1\033[0m" |
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 searchLongRoute(waypoints) { | |
var route; | |
var unit = 10; | |
var unit_num = Math.ceil((waypoints.length+Math.ceil(waypoints.length/unit)-1)/unit); | |
for (var start_num = 0; start_num < waypoints.length-1;) { | |
var s = waypoints[start_num]; | |
var next_start = ((waypoints.length>=start_num+unit)?(start_num+unit):(waypoints.length))-1; | |
var e = waypoints[next_start]; | |
var w = waypoints.slice(start_num+1, next_start); |
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/bash | |
set -e | |
echo "## Unrar archive ##" | |
for f in $(find . -maxdepth 1 -type f -name "*.rar"); do | |
echo " - $f" | |
unrar x -o- -p- -xshareraws.blogspot.com.url -y -inul $f | |
done |
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
--- ../samizdatco-nginx-http-auth-digest-bd1c86a/ngx_http_auth_digest_module.c.orig 2011-12-29 09:00:32.000000000 +0900 | |
+++ ../samizdatco-nginx-http-auth-digest-bd1c86a/ngx_http_auth_digest_module.c 2012-10-17 16:47:17.000000000 +0900 | |
@@ -401,13 +401,13 @@ | |
http_method.len = r->method_name.len+1; | |
http_method.data = ngx_pcalloc(r->pool, http_method.len); | |
if (http_method.data==NULL) return NGX_HTTP_INTERNAL_SERVER_ERROR; | |
- p = ngx_cpymem(http_method.data, r->method_name.data, r->method_end - r->method_name.data+1); | |
+ p = ngx_cpymem(http_method.data, r->method_name.data, r->method_name.len); | |
- ha2_key.len = http_method.len + r->uri.len + 1; |
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 o=function(w,v){var i=new Blob([v]);var u=window.URL||window.webkitURL;var t=u.createObjectURL(i);var e=document.createElement("a");e.download=w;e.href=t;return e};var c=function(a){return unescape(escape(a).replace(/(%u3000|%20|%09)/g,""))};var r=document.getElementsByTagName("table")[10].innerText.trim();var d=document.getElementsByTagName("table")[11];var j=d.getElementsByTagName("tr");var s="";var n="";var h="";for(var g=0;g<j.length;g++){var l=j[g];if(l.attributes.length==0){var q=o("address.csv",n);q.innerText="[CSV Download]";l.children[0].insertBefore(q,l.children[0].firstChild);s=s+n;n="";continue}if(l.attributes[0].value=="#B0C4DE"){h=l.children[0].innerText}else{var p=l.children[1].innerText;var m=c(p.substring(0,3));p=c(p.substring(3));var f=m+","+p+","+m+" "+p;f+=","+r+","+h+",";f+=l.children[0].innerText.replace(/[A-Za-z0-9]/g,function(a){return String.fromCharCode(a.charCodeAt(0)-65248)});f+=","+l.children[2].innerText.replace(/\n/g,"");f+=","+c(l.children[3].innerTex |
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/bash | |
########################## ツリー表示スクリプト ########################### | |
# 第一引数に与えられたディレクトリがルートのディレクトリツリーを表示する。# | |
# また、ディレクトリの所有ユーザ名、グループ名、パーミッションを表示する。# | |
# シンボリックリンク先も辿る。 # | |
# # | |
# 引数1: ツリー表示したいディレクトリパス # | |
# 引数2: 走査する深度(オプション) # | |
# # |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" /> | |
<title>LimitlessLED control</title> | |
<style type="text/css"> | |
html { | |
-webkit-user-select: none; | |
-webkit-background-size: 10px 10px; |
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
Option Explicit | |
Dim Excel, Com | |
Set Excel = WScript.CreateObject("Excel.Application") | |
Excel.Visible = False | |
rem HWND_BROADCAST = 0xffff | |
rem WM_SETTINGCHANGE = 0x001a | |
rem SMTO_NOMAL = 0x0 |
OlderNewer