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
foo(); // foo | |
function foo() { | |
console.log('foo'); | |
} | |
bar(); // TypeError: undefined is not a function | |
var bar = function() { | |
console.log('bar'); | |
} |
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 foo(n) { | |
if (n <= 1) return 1; | |
return n * arguments.callee(n - 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
(function (h) { | |
return new Array(7 - h.length).join("0") + h | |
})(((1 << 24) * Math.random() | 0).toString(16)); |
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
/** | |
* Author: tsmsogn | |
* Version: 0.0.1 | |
* Requires EaselJS 0.5.0 | |
* | |
* Distributed under the terms of the MIT license. | |
* http://www.opensource.org/licenses/mit-license.html | |
*/ | |
function SimpleCanvas() { | |
this.initialize.apply(this, arguments); |
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
<MTArchiveList archive_type="Monthly"> | |
<MTArchiveListHeader> | |
<dl> | |
<dt>月別アーカイブ</dt> | |
</MTArchiveListHeader> | |
<dd><a href="<$MTArchiveLink$>"><$MTArchiveTitle$></a></dd> | |
<MTArchiveListFooter> | |
</dl> | |
</MTArchiveListFooter> | |
</MTArchiveList> |
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
try { | |
window.removeEventListener('load', foo, false); | |
window.removeEventListener('load', bar, false); | |
} catch(e) { | |
window.detachEvent('onload', foo); | |
window.detachEvent('onload', bar); | |
} |
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 getRotatedPosition(x, y, rotation, referenceX, referenceY) { | |
if (isNaN(referenceX)) referenceX = 0; | |
if (isNaN(referenceY)) referenceY = 0; | |
var radian = rotation * (Math.PI / 180); | |
return { | |
x:x * Math.cos(radian) - y * Math.sin(radian) + referenceX - referenceX * Math.cos(radian) + referenceY * Math.sin(radian), | |
y:x * Math.sin(radian) + y * Math.cos(radian) + referenceY - referenceX * Math.sin(radian) - referenceY * Math.cos(radian) | |
}; |
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 | |
// requires php5 | |
define('UPLOAD_DIR', 'images/'); | |
$img = $_POST['img']; | |
$img = str_replace('data:image/png;base64,', '', $img); | |
$img = str_replace(' ', '+', $img); | |
$data = base64_decode($img); | |
$file = UPLOAD_DIR . uniqid() . '.png'; | |
$success = file_put_contents($file, $data); | |
print $success ? $file : 'Unable to save the file.'; |
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
var infoWindow = new google.maps.InfoWindow(); | |
var marker = (function(data) { | |
var latLng = new google.maps.LatLng(data.latitude, data.longitude); | |
var marker = new google.maps.Marker({ | |
position: latLng, | |
icon: markerImage | |
}); | |
google.maps.event.addListener(marker, 'click', function(){ |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<bitmap xmlns:android="http://schemas.android.com/apk/res/android" | |
android:src="@drawable/tiny_grid" | |
android:tileMode="repeat" /> |
OlderNewer