- ** : exponentiation
- // : integer division (you only get the integer from the division)
- % : modulo, gives you the numerator of the fractional part of a division.
- **
- - (negation)
- * / // %
- + -
function throttle( fn, time ) { | |
var t = 0; | |
return function() { | |
var args = arguments, ctx = this; | |
clearTimeout(t); | |
t = setTimeout( function() { | |
fn.apply( ctx, args ); | |
}, time ); | |
}; |
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
/* | |
Shows if big or small numbers should be used first. | |
*/ | |
#include <stdio.h> | |
int main(int argc, char const *argv[]) | |
{ |
/* | |
Computes greatest common divisor of two numbers. | |
*/ | |
#include <stdio.h> | |
// function prototype | |
int gcd (int a, int b); |
// Gets user input for year and month, and then tells you the number of days in that month. | |
// Takes care of the leap year problem as well. | |
#include <stdio.h> | |
int main(int argc, const char * argv[]) | |
{ | |
int year, month, days; | |
#include <stdio.h> | |
#include <math.h> | |
int main(void) | |
{ | |
//number of seconds in a year. | |
int seconds_in_year; | |
seconds_in_year = 60*60*24*365; | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
</head> | |
<body> | |
<h1> Git is so great! </h1> | |
</body> |
for (var number = 0; number <= 12; number = number + 2) | |
print(number); |
do { | |
var input = prompt("Who are you?"); | |
} while (!input); |