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 / fix_github_https_repo.sh
Created April 7, 2018 07:37 — forked from m14t/fix_github_https_repo.sh
Convert HTTPS github clones to use SSH
#/bin/bash
#-- Script to automate https://help.github.com/articles/why-is-git-always-asking-for-my-password
REPO_URL=`git remote -v | grep -m1 '^origin' | sed -Ene's#.*(https://[^[:space:]]*).*#\1#p'`
if [ -z "$REPO_URL" ]; then
echo "-- ERROR: Could not identify Repo url."
echo " It is possible this repo is already using SSH instead of HTTPS."
exit
fi
# Simple script to send you email when someone unfollows you on twitter.
#
# Replace email on line 24 with the email you want to receive notifications at, and
# twitter handle on line 23 with your own (or whomever you want to track unfollows for).
#
# Set up a crontab to check however often you like. If someone follows and then unfollows you
# very quickly (within the interval), you won't get an email.
#
# Requires that you can send mail from the command line of the environment where
# you're running the script using mailx, e.g. `echo "body" | mailx -s "subject" foo@bar.com
@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
error_reporting(E_ALL);
ini_set('error_reporting', E_ALL);
ini_set('display_errors',1);