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
map(lambda n:'fizzbuzz' if n%15==0 else 'fizz' if n%3==0 else 'buzz' if n%5==0 else str(n), range(1, 101)) |
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 count=0; | |
var id=setInterval(function() { | |
var evt=document.createEvent("MouseEvents"); | |
evt.initMouseEvent("click",true,true,window,0,0,0,0,0,false,false,false,false,0,null); | |
document.getElementById("more").dispatchEvent(evt); | |
if(++count > 300) { | |
alert('end'); | |
clearInterval(id); | |
} |
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
# Convert CRLF to LF in a folder recursively. | |
import sys, os | |
if len(sys.argv) < 2: | |
raise RuntimeError("No folder specified to convert.") | |
def iterfiles(basedir): | |
for (path, dirs, files) in os.walk(basedir): | |
for fn in files: |
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 | |
/* ↓PHPのechoの変態な書き方 */ | |
?>ねもい<?php |
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 ob_start(); ?> | |
echo 'ねもい'; | |
<?php eval(ob_get_clean()); /* ここまでくるとさすがに無理しすぎ */ |
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
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAZCAYAAAAiwE4nAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABZ0RVh0Q3JlYXRpb24gVGltZQAwNC8yMC8xMf5OkcQAAAAcdEVYdFNvZnR3YXJlAEFkb2JlIEZpcmV3b3JrcyBDUzQGstOgAAAGqUlEQVRIiaWWa4yU1RnH/885721mZ3aW7bBcusvKShEaUVLAaKVKdYN1tZcUbRqjbWpsQtNYE0hoU6L9UlJjUpo2TWwx9VMT2xBjIlUjgmDptqxdLgEXRNd1l72xOzs793kv5z3n6YdZVmDRpPFJni/vufzy///POXmJmfFp5f/uDs/qaPo+Yv2wzvm3mVw0G5f0fm9N6vfOT3pzn7rwM4quB5z98YaEu8J7RrZZPdZS50auRcl4widzKUSY16pepcEwEi9k2ux92Rf6a/8P0LreR5mU94HwC+EJEAHa1+BQg0MDrWDHAa8NC3rvyAS3Z4GdnxsoXPGA8ATIk2BtwKEGQgMTMbQGdAyYCLgwFJx8+eUtO6qT3JVuE7/c870j5evtt3fkbmf0aPIr03/hUwuAZ2gxde1e1U0egVyaV8YhQysgjgGjgDBGeFTGfdkivxREtNGJ5bZfHdr6d8ehd2ymSc+SDkN01Q3fWaXU1qjMpamPa5sWADu2d64jm26ghARJwAQxOGpATQxo1VBXDfjE9B+XID2FW4UtIGyxlCzxlJDiKZsEbCkRGcCwgQqA4mCw7/DYsaS4Tn73kysgPAEwz9vJETfUzSnMz8YHVqXcjYGCbXsE6QFCAhKAFAQQEDMjFoAqMvLnav8FEC4ACod6yBMgj8DKgAMNDgyMYug5hVEMXJhVb7uz/E1lCLZLkA5B0CfNDMQMxMQIZ0x56Hj+NAD/KmDukfVfIFvcJlMCVkJAKEBoCRkDRjHiOTvrEY8efbzpUlxBN1kNmHQASQSBRmsGNDPiCPAn4t |
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 | |
/** | |
* Request continuation | |
* | |
* This utility provides a very short lifetime (and navigation closed) session. | |
* Confirmation page shown after user input form should hold previously poted | |
* data and passes them to the next request. Those data would live in only two | |
* requests, so they should be in request scope. | |
* It's bad idea to use cookie or _SESSION to implement for confirmation page! | |
* |
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 | |
/** | |
* Simple text templating | |
* | |
* before: "hello,{{name}}" | |
* given: array('name'=>'world') | |
* after: "hello,world" | |
*/ | |
function fill_text_template($template, $vars) { | |
$target = array(); |
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 | |
PINOCO_VER="0.5.2" | |
PINOCO_URL_BASE="https://github.com/downloads/tanakahisateru/pinoco" | |
PHPTAL_VER="1.2.2" | |
PHPTAL_URL_BASE="http://phptal.org/files" | |
if [ ! -d _download ]; then | |
mkdir _download | |
curl -o _download/empty-project.tgz -L ${PINOCO_URL_BASE}/empty-project.tgz |
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 | |
require_once 'PHPTAL.php'; | |
// namespace def | |
class MYNS_Namespace extends PHPTAL_Namespace | |
{ | |
public function __construct() | |
{ | |
// namespace | |
parent::__construct('myns', 'http://xml.zope.org/namespaces/mytal'); |
OlderNewer