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
/* | |
* created by Rui Santos, http://randomnerdtutorials.com | |
* | |
* Complete Guide for Ultrasonic Sensor HC-SR04 | |
* | |
Ultrasonic sensor Pins: | |
VCC: +5VDC | |
Trig : Trigger (INPUT) - Pin11 | |
Echo: Echo (OUTPUT) - Pin 12 | |
GND: GND |
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 ( | |
a, // A Nodelist whichto use as root | |
b, // iterate-placeholder | |
c, // elem-placeholder | |
d, // tags-placeholder | |
e, // tag-placeholder | |
f // parent-placeholder | |
) { | |
for (b = 0; c = a[b++]; |
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
/** | |
* [BreakBlock description] | |
*/ | |
function BreakBlock(row, col){ | |
this.data = []; | |
this.position = [ 0, 0 ]; | |
this.direction = BreakBlock.DIRECTION.NE; | |
}; | |
BreakBlock.AXIS = { |
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
App({ | |
/** | |
* [request description] | |
* @param {[type]} method [description] | |
* @param {[type]} url [description] | |
* @param {[type]} data [description] | |
* @param {[type]} header [description] | |
* @return {[type]} [description] | |
*/ |
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
for(var n=8888,c=0; n; c+=(n=n>>1)&1){ c; }; |
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
<style> | |
body{ | |
margin: 100px; | |
text-align: center; | |
} | |
[tooltip]{ | |
position: relative; | |
} |
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 fn(n){ | |
// if(n > 100) return n; | |
// return fn(n + (n + 1)); | |
// }; | |
function pad(s, n){ | |
while(n--) s = '0' + s; | |
return s; | |
}; |
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
for(var y=0;y<=10;y++){ | |
var arr = []; | |
for(var x=0;x<5;x++) arr.push( Math.max(0, Math.round((y / 2) - x)) ); | |
console.log('%j\t> ', y, arr); | |
} |
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 charset="utf8" /> | |
<meta name="viewport" content="width=device-width"> | |
<title>MaoYan Toolbox</title> | |
<style> | |
body{ | |
width: 50%; | |
margin: auto; | |
text-align: center; |
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
#!/bin/bash | |
# | |
# example: | |
# | |
# curl -s https://gist.githubusercontent.com/song940/332b80f24e7f203987eff11fc6765bd8/raw/progressbar.sh | sh | |
# | |
function ProgressBar(){ | |
let max=$1 |