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
/* | |
Copyright 2011 Martin Hawksey | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, software |
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
Regex for matching ALL Japanese common & uncommon Kanji (4e00 – 9fcf) ~ The Big Kahuna! | |
([一-龯]) | |
Regex for matching Hirgana or Katakana | |
([ぁ-んァ-ン]) | |
Regex for matching Non-Hirgana or Non-Katakana | |
([^ぁ-んァ-ン]) | |
Regex for matching Hirgana or Katakana or basic punctuation (、。’) |
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 python | |
""" | |
Very simple HTTP server in python (Updated for Python 3.7) | |
Usage: | |
./dummy-web-server.py -h | |
./dummy-web-server.py -l localhost -p 8000 | |
Send a GET request: |
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
<div class="check-container"><span id="check"></span></div> | |
{{#Question}} | |
<p>{{Question}}</p> | |
{{/Question}} | |
{{#Image}} | |
<p class="image">{{Image}}</p> | |
{{/Image}} |
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
""" | |
This script was used to create the figures for http://jrsmith3.github.io/sample-logs-the-secret-to-managing-multi-person-projects.html from a PDF file containing some old CMU sample logs. | |
""" | |
import PyPDF2 | |
from wand.image import Image | |
import io | |
import os | |
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
for image in `grep --color=never -Po 'data:image/[^;]*;base64,\K[a-zA-Z0-9+/]*' foo.html`; do echo -n "$image" | base64 -di > `mktemp image_XXXX`; 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
mail_address = '' | |
password = '' | |
from selenium import webdriver | |
UA = 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:25.0) Gecko/20100101 Firefox/25.0' | |
PHANTOMJS_ARG = {'phantomjs.page.settings.userAgent': UA} | |
driver = webdriver.PhantomJS(desired_capabilities=PHANTOMJS_ARG) | |
url = 'https://www.google.com/accounts/Login?hl=ja&continue=http://www.google.co.jp/' |
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 | |
# Settings | |
outfolder="converted" | |
codec="libx264" | |
maxres="448" | |
#filter="crop=floor(in_w/2)*2:floor(in_h/2)*2:0:0:exact=1,colorspace=bt601-6-625:range=pc:irange=tv:iall=bt601-6-625:format=yuv444p12,zscale=rin=full:tin=601:t=linear,scale=if(gt(iw\,ih)\,min($maxres\,floor((iw+1)/2)*2)\,-2):if(gt(iw\,ih)\,-2\,min($maxres\,floor((ih+1)/2)*2)),zscale=rin=full:r=limited:tin=linear:t=601" | |
filter="scale=if(gt(iw\,ih)\,min($maxres\,floor((iw+1)/2)*2)\,-2):if(gt(iw\,ih)\,-2\,min($maxres\,floor((ih+1)/2)*2)):out_color_matrix=bt601:out_range=tv:flags=accurate_rnd+full_chroma_inp+full_chroma_int+bicublin" | |
preset="veryslow" | |
profile="high" |
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
<div id="correctAnswer" style="display:none"></div> | |
<script> | |
//Script for modifying 'Show Answer' behavior for Input types. | |
var htmlTextNodes = []; | |
var innerHTMLText = []; | |
var htmlNodeLength =document.getElementById('typeans').childNodes.length; | |
var typedAnswer; | |
var correctAnswer; | |
var firstBr = null; | |
var secondBr; |
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
import urllib.parse | |
def urlencode(str): | |
return urllib.parse.quote(str) | |
def urldecode(str): | |
return urllib.parse.unquote(str) | |
str = '{"name": "Kinkin"}' |
OlderNewer