Skip to content

Instantly share code, notes, and snippets.


Akarsh Satija AkarshSatija

Block or report user

Report or block AkarshSatija

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
AkarshSatija /
Created Apr 7, 2018 — forked from m14t/
Convert HTTPS github clones to use SSH
#-- Script to automate
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."
View temp.js
var sendgrid = require('sendgrid')(config.sendgridMailer.auth.key);
exports.bookMarkedArticle = function (req,res,cb) {
function(done) {
res.render('bookmarks/bookmark-invite', {
name: req.user.firstName,
article: req.article
}, function(err, emailHTML) {
View unfollowers.rb
# 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"
AkarshSatija / node raw HTML document on socket.js
Created Jun 9, 2016
node raw HTML document on socket.js
View node raw HTML document on socket.js
var net = require('net');
var server = net.createServer(function(socket) {
function onData(command) {
if (command == "exit") {
socket.on("connect", function(){console.log('connect')});
socket.on("data", function(d){console.log(d.toString())});
View nginx config
# You may add here your
# server {
# ...
# }
# statements for each of your virtual hosts to this file
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
View server.js
var http = require('http');
var data = {
"message":"My message","title":"My Title"
"registration_ids":["token goes here"]
AkarshSatija / gist:71a544c3d4d4ab1c34d7
Created Jul 17, 2015
diff file for Setting up oAuth2 server in MEAN.JS(
View gist:71a544c3d4d4ab1c34d7
diff --git a/app/controllers/oauth.server.controller.js b/app/controllers/oauth.server.controller.js
new file mode 100644
index 0000000..a3c0c7a
--- /dev/null
+++ b/app/controllers/oauth.server.controller.js
@@ -0,0 +1,208 @@
+'use strict';
+ * Module dependencies.


An introduction to curl using GitHub's API

The Basics

Makes a basic GET request to the specifed URI

AkarshSatija / getWeek.js
Last active Aug 29, 2015 — forked from dblock/getWeek.js
Get the week Number of the year
View getWeek.js
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
View gist:085959f1fb64080498e4
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 / {
You can’t perform that action at this time.