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
| <? | |
| include_once 'prototype.php'; | |
| use Prototype\Klass; | |
| class TestPrototype extends PHPUnit_Framework_TestCase{ | |
| public function test_sample(){ | |
| $Person = Klass::create(function($first, $last){ | |
| $this->_first = $first; | |
| $this->_last = $last; |
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
| <? | |
| include_once 'closure.php'; | |
| use closure\name; | |
| class NamedParameterTest extends PHPUnit_Framework_TestCase{ | |
| public function test_named_parameter(){ | |
| $increment = name::parameter(function($x, $y, $z){ | |
| return [$x+1, $y+1, $z+1]; | |
| }); |
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
| // using node.js | |
| exports.mixin = new function(){ | |
| function mixin(klass, trait){ | |
| var new_class = function(){}; | |
| new_class.prototype = new function(){ | |
| var f = function(){} | |
| f.prototype = klass.prototype; | |
| return extend(new f, trait); | |
| }; | |
| return new_class; |
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
| // original: | |
| // http://userscripts.org/scripts/show/12584 | |
| (function(window, load){ | |
| if (this.chrome && !load){ | |
| var source = '(' + arguments.callee.toString() + ')(this, true);'; | |
| var script = document.createElement('script'); | |
| script.appendChild(document.createTextNode(source)); | |
| document.body.appendChild(script); |
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
| % cabal-dev install && yesod --dev devel | |
| Resolving dependencies... | |
| cabal: Could not resolve dependencies: | |
| trying: yesod-example-0.0.0 (user goal) | |
| trying: warp-1.2.2 (dependency of yesod-example-0.0.0) | |
| trying: lifted-base-0.1.1.1 (dependency of warp-1.2.2) | |
| trying: base-unicode-symbols-0.2.2.4 (dependency of lifted-base-0.1.1.1) | |
| next goal: http-conduit (dependency of yesod-example-0.0.0) | |
| rejecting: http-conduit-1.5.0.2, 1.5.0.1, 1.5.0 (conflict: yesod-example => | |
| http-conduit>=1.4 && <1.5) |
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
| <? | |
| use x7c1\plater\collection\immutable\Range; | |
| class SampleRangeTest extends \PHPUnit_Framework_TestCase{ | |
| public function test_memory(){ | |
| foreach(new range(1, 700000) as $i){ | |
| //Memory: 2.50Mb | |
| } | |
| } | |
| } | |
| // see also |
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
| class TestController < ApplicationController | |
| def oauth_consumer | |
| @oauth_consumer ||= OAuth::Consumer.new( | |
| ENV["CONSUMER_KEY"], | |
| ENV["CONSUMER_SECRET"], | |
| :site => "http://twitter.com" | |
| ) | |
| end |
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
| <?xml version="1.0"?> | |
| <root> | |
| <list> | |
| <item> | |
| <name>Kana to Escape</name> | |
| <identifier>private.swap_kana_and_escape</identifier> | |
| <autogen>--KeyToKey-- KeyCode::JIS_KANA, KeyCode::ESCAPE</autogen> | |
| </item> | |
| <item> | |
| <name>Shift to EISUU/KANA</name> |
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
| $(document).ready(function(){ | |
| var bye = function(){ | |
| alert("bye!"); | |
| $("#google_afc_user").css({ height: '0px', overflow: 'hidden' }); | |
| } | |
| $("#sample_button").click(bye); | |
| //$("#google_afc_user").css({ display: 'block !important' }); | |
| }); |
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
| // ==UserScript== | |
| // @name damnfullscreen | |
| // @namespace http://x7c1.hatenablog.com/damnfullscreen | |
| // @include http://*.hatenablog.com/* | |
| // ==/UserScript== | |
| (function(window, load){ | |
| if (this.chrome && !load){ | |
| var source = '(' + arguments.callee.toString() + ')(this, true);'; | |
| var script = document.createElement('script'); |
OlderNewer