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
//URL regexp | |
\/\/api\.jellow\.club\/1\.0\/users\/profile | |
if (!follewedList) { | |
var follewedList = new Set() | |
} | |
(($request, $response, $done) => { | |
const JELLOW_ID = 'YOUR_JELLOW_ID' | |
const requestUrl = $request.url |
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
const params = {} | |
query.replace(/([^=?#&]*)=([^?#&]*)/g, function(e, $1, $2) { | |
params[decodeURIComponent($1)] = decodeURIComponent($2) | |
}) |
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
convert transparent-img1.png transparent-img2.png transparent-img3.png -channel Alpha favicon.ico |
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
I think you should tranfer image in base64 to image with blob, because when you use base64 image, it take a lot of log lines or a lot of line will send to server. With blob, it only the file. You can use this code bellow: | |
dataURLtoBlob = (dataURL) -> | |
# Decode the dataURL | |
binary = atob(dataURL.split(',')[1]) | |
# Create 8-bit unsigned array | |
array = [] | |
i = 0 | |
while i < binary.length | |
array.push binary.charCodeAt(i) |
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
var n = 9 | |
var r = n/2 | |
function range(i){ | |
var left = -r + i | |
var right = -r + i + 1 | |
if( left < - r ){ | |
left = -r | |
} |
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
<html> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=UTF-8" /> | |
<link href="./css/index.css" rel="stylesheet" type="text/css" /> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> | |
<script type="text/javascript"> | |
$(document).ready(function() { | |
$("#enzan").click( function() { | |
var a = $("#start").val(); |
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
function randomArray(array){ | |
function swap(obj, a, b) { | |
var tmp = obj[a]; | |
obj[a] = obj[b]; | |
obj[b] = tmp; | |
} | |
var length = array.length; | |
var rand = function(){ | |
return Math.round(Math.random() * (length - 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
define(('__proto__' in {} ? ['zepto'] : ['jquery']), function($) { | |
return $; | |
}); |
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
var clickOrTouch = (('ontouchend' in window)) ? 'touchend' : 'click'; | |
$('#element').on(clickOrTouch, function() { | |
// do something | |
}); |
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
const double ALPHA = 0.05; | |
resultSpeed = ALPHA * currentSpeed + (1.0 - ALPHA) * resultSpeed; |
NewerOlder