Skip to content

Instantly share code, notes, and snippets.

View nithinkashyapn's full-sized avatar
🎯
Focusing

Nithin Kashyap nithinkashyapn

🎯
Focusing
View GitHub Profile
@joshinat0r
joshinat0r / index.js
Last active November 6, 2023 15:26
Umami API wrapper
const umami = require('./umami.js');
const api = await umami({
url: 'https://app.umami.is',
username: 'username',
password: 'password',
website: 1, // internal website-id
})
const stats = await api.getStats()
@maxko87
maxko87 / top_github_users_in_india.txt
Last active August 11, 2021 04:03
Top Github users in India, by number of followers
Run here: https://developer.github.com/v4/explorer/
query GetUsers{
search(query:"location:india", first: 100, type: USER, ) {
userCount
pageInfo {
endCursor
hasNextPage
}
edges {
@wemersonjanuario
wemersonjanuario / saveas.js
Created December 23, 2017 03:18 — forked from rreimi/saveas.js
Ajax blob save as.. file download
var url = 'http://www.pdf995.com/samples/pdf.pdf';
var fileName = 'pdf.pdf';
var xhr = new XMLHttpRequest();
xhr.open('GET', url, true);
xhr.responseType = 'blob';
xhr.onprogress = function(pe) {
console.log('progress');
if (pe.lengthComputable) {
console.log((pe.loaded / pe.total) * 100);
@msharp
msharp / aws-lambda-unzipper.py
Created February 6, 2017 22:52
unzip archive from S3 on AWS Lambda
import os
import sys
import re
import boto3
import zipfile
def parse_s3_uri(url):
match = re.search('^s3://([^/]+)/(.+)', url)
if match:
return match.group(1), match.group(2)
@nikmartin
nikmartin / A: Secure Sessions Howto
Last active July 29, 2025 11:54
Secure sessions with Node.js, Express.js, and NginX as an SSL Proxy
Secure sessions are easy, but not very well documented.
Here's a recipe for secure sessions in Node.js when NginX is used as an SSL proxy:
The desired configuration for using NginX as an SSL proxy is to offload SSL processing
and to put a hardened web server in front of your Node.js application, like:
[NODE.JS APP] <- HTTP -> [NginX] <- HTTPS -> [PUBLIC INTERNET] <-> [CLIENT]
Edit for express 4.X and >: Express no longer uses Connect as its middleware framework, it implements its own now.