Skip to content

Instantly share code, notes, and snippets.

View AkarshSatija's full-sized avatar
:octocat:

Akarsh Satija AkarshSatija

:octocat:
View GitHub Profile
@AkarshSatija
AkarshSatija / curl.md
Last active August 29, 2015 14:22 — forked from btoone/curl.md

Introduction

An introduction to curl using GitHub's API

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin
@AkarshSatija
AkarshSatija / getWeek.js
Last active August 29, 2015 14:22 — forked from dblock/getWeek.js
Get the week Number of the year
function( d ) {
// Create a copy of this date object
var target = new Date(d.valueOf());
// ISO week date weeks start on monday
// so correct the day number
var dayNr = (d.getDay() + 6) % 7;
// Set the target to the thursday of this week so the
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /usr/share/nginx/html;
index index.html index.htm;
# Make site accessible from http://localhost/
server_name localhost;
location / {
@AkarshSatija
AkarshSatija / gist:c12bfaa16f444e73f488
Created April 2, 2015 06:32
//closure in loop eg 2
//closure in loop
var funcs = [];
var ret=[];
var flag=0;
function exec4(){console.log("exec4")}
for (var i = 0; i < 3; i++) {
funcs[i] = (function(index) {
return function() {
@AkarshSatija
AkarshSatija / closure in loop
Created March 14, 2015 04:31
closure in loop javascript
//closure in loop
var funcs = [];
var ret=[];
var flag=0;
function exec4(){console.log("exec4")}
for (var i = 0; i < 3; i++) {
funcs[i] = (function(index) {
return function() {
//In console
$(".user-actions.btn-group.not-following button.user-actions-follow-button").each(function(index,value) {
console.log(index)
})