Skip to content

Instantly share code, notes, and snippets.

View aakashlpin's full-sized avatar

Aakash Goel aakashlpin

View GitHub Profile
@wilsonpage
wilsonpage / swr.ts
Last active March 28, 2025 09:35
An implementation of stale-while-revalidate for Cloudflare Workers
export const CACHE_STALE_AT_HEADER = 'x-edge-cache-stale-at';
export const CACHE_STATUS_HEADER = 'x-edge-cache-status';
export const CACHE_CONTROL_HEADER = 'Cache-Control';
export const CLIENT_CACHE_CONTROL_HEADER = 'x-client-cache-control';
export const ORIGIN_CACHE_CONTROL_HEADER = 'x-edge-origin-cache-control';
enum CacheStatus {
HIT = 'HIT',
MISS = 'MISS',
REVALIDATING = 'REVALIDATING',
/*jshint esversion: 6 */
const ATR = require('technicalindicators').ATR;
const HA = require('technicalindicators').HeikinAshi;
const moment = require('moment');
const _ = require('underscore-node');
const Log = require('../util/logger');
var calculateSTR = function(result, { multiplier = 3, period = 7, is_ha = true } = {}) {
let open = [],
"""
Simple Moving Average implemented using KiteConnect Python library. -- [https://kite.trade](kite.trade)
Rainmatter (c) 2016
License
-------
This GIST is licensed under the MIT License
"""
from kiteconnect import KiteConnect

[based on a true story]

So. Your friend's about to teach you how to make a website. Great!

You make a file, and you save it as 'index.html'. Why it's called 'index' isn't really explained to you, but whatever.

You type the following.

hello world
@dloman
dloman / xvfb.service
Last active April 22, 2022 23:12
sytemd xvfb
[Unit]
Description=X Virtual Frame Buffer Service
After=network.target
[Service]
ExecStart=/usr/bin/Xvfb :1 -screen 0 1024x768x24 -ac +extension GLX +render -noreset
[Install]
WantedBy=multi-user.target
@threepointone
threepointone / async-disto.js
Last active March 22, 2016 10:16
async action creators in disto
/* global fetch*/
import {Dis, act} from 'disto';
let {dispatch, register} = new Dis();
function timeout(t){
return new Promise(resolve =>
setTimeout(()=> resolve(true), t));
}
@apnerve
apnerve / gaana.js
Created July 13, 2014 21:06
download songs from gaana.com
var tracks = [];$('.album_songlist .playcol').map(function(index, track) {tracks[index] = $(track).data('value')});var getURL = function(track_id) {$.post('http://gaana.com//streamprovider/get_stream_data_v1.php', {track_id:track_id}, function(data){console.log($.parseJSON(data).stream_path)})};tracks.map(getURL);
@addyosmani
addyosmani / LICENSE.txt
Last active April 8, 2024 20:15 — forked from 140bytes/LICENSE.txt
Offline Text Editor in < 140 bytes (115 bytes). Powered by localStorage & contentEditable
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Copyright (C) 2014 ADDY OSMANI <addyosmani.com>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
anonymous
anonymous / jsbin.cowijeda.html
Created March 25, 2014 19:43
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
</body>
</html>
@nnarhinen
nnarhinen / Gruntfile.js
Last active February 11, 2020 09:39
Support html5 pushState (or angular.js html5mode) in a yeoman (grunt-contrib-connect) application.
module.exports = function (grunt) {
// show elapsed time at the end
require('time-grunt')(grunt);
// load all grunt tasks
require('load-grunt-tasks')(grunt);
//MODIFIED: add require for connect-modewrite
var modRewrite = require('connect-modrewrite');
grunt.initConfig({