Skip to content

Instantly share code, notes, and snippets.

Nitin Khanna nitinthewiz

Block or report user

Report or block nitinthewiz

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
View feverFlat.opml
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
<!-- OPML generated by Fever -->
<head><title>Fever</title></head>
<body>
<outline type="rss" text="decoding.io/feed" title="decoding.io/feed" xmlUrl="decoding.io/feed/" htmlUrl=""/>
<outline type="rss" text="aworkinglibrary.com/library/rss" title="aworkinglibrary.com/library/rss" xmlUrl="http://aworkinglibrary.com/library/rss/" htmlUrl=""/>
<outline type="rss" text="blog.hugsformonsters.com/rss" title="blog.hugsformonsters.com/rss" xmlUrl="http://blog.hugsformonsters.com/rss" htmlUrl=""/>
<outline type="rss" text="daverupert.com/feed" title="daverupert.com/feed" xmlUrl="http://daverupert.com/feed/" htmlUrl=""/>
<outline type="rss" text="elliotjaystocks.com/blog/feed" title="elliotjaystocks.com/blog/feed" xmlUrl="http://elliotjaystocks.com/blog/feed/" htmlUrl=""/>
@nitinthewiz
nitinthewiz / weather.rb
Last active Jul 8, 2018
weather API for compass
View weather.rb
require 'date'
require 'httparty'
require 'json'
MY_COMPASS="https://compass"
COMPASS_LOCATION_READ_TOKEN=""
COMPASS_WEATHER_WRITE_TOKEN=""
DARK_SKY_API=""
data = JSON.parse(HTTParty.get(MY_COMPASS+'/api/last?token='+COMPASS_LOCATION_READ_TOKEN).body)
@nitinthewiz
nitinthewiz / game.js
Created Jun 12, 2017
superhex change your server to SA (South Africa)
View game.js
"use strict";
var superhex = function() {
function e(e) {
return 0 == e ? tn[0] : e == Xt ? tn[(Xt - 1) % (tn.length - 1) + 1] : Xt > 0 && e > Xt ? $e[(e - 2) % $e.length] : $e[(e - 1) % $e.length]
}
function t(e) {
return 0 == e ? nn[0] : e == Xt ? nn[(Xt - 1) % (nn.length - 1) + 1] : e > Xt ? et[(e - 2) % et.length] : et[(e - 1) % et.length]
}
@nitinthewiz
nitinthewiz / json.php
Created Jun 7, 2017
trying to create jsonfeed for nitinthewiz/TheLiveblog
View json.php
<?php
$configs = include('configs.php');
$results = file_get_contents('text.txt');
$feed_items = array();
$wp_comments = eval("return " . $results . ";");
$i=0;
foreach ($wp_comments as $livepost){
if($i==20) break;
@nitinthewiz
nitinthewiz / Asian Music chart HackAPI
Created Oct 27, 2016
Steps to get Asian Music chart
View Asian Music chart HackAPI
Steps to get Asian Music chart
1. Open http://www.bbc.co.uk/asiannetwork/chart/print
2. Fire up jQuerify using https://chrome.google.com/webstore/detail/jquerify/gbmifchmngifmadobkcpijhhldeeelkc
3. Run the below script in the console to get the tbl variable
var tbl = $('table tr:has(td)').map(function(i, v) {
var $td = $('td', this);
return {
id: ++i,
View gist:2ae690e1b46bf3f04d8a9a21750657a5
(work-python 2.7)$ pip freeze
Flask==0.9
Jinja2==2.6
PIL==1.1.7
Werkzeug==0.8.3
distribute==0.6.26
gevent==1.0b3
gevent-zeromq==0.2.5
greenlet==0.4.0
ipython==0.12.1
@nitinthewiz
nitinthewiz / app.py
Created Oct 23, 2016 — forked from notbanker/app.py
Bayesian calculation for twin Down Syndrome probabilities (Flask app)
View app.py
from flask import Flask, request, url_for
from scipy.optimize import bisect
import math
import numpy as np
app = Flask(__name__)
app.secret_key = 'Whatever'
@app.route('/')
def index():
@nitinthewiz
nitinthewiz / mplonflask.py
Created Oct 23, 2016 — forked from tkf/mplonflask.py
matplotlib on Flask
View mplonflask.py
import matplotlib
matplotlib.use('Agg')
from matplotlib import pyplot
import numpy
from flask import Flask, send_file
from cStringIO import StringIO
app = Flask(__name__)
@nitinthewiz
nitinthewiz / private.xml
Created Aug 18, 2016 — forked from DanSkeel/private.xml
Settings for Karabiner to enable Shift+Enter shortcut for newline in Messages app
View private.xml
<?xml version="1.0"?>
<!-- Documentation: https://pqrs.org/osx/karabiner/xml.html.en -->
<root>
<appdef>
<appname>Messages</appname>
<equal>com.apple.iChat</equal>
</appdef>
<item>
<name>Enable Shift+enter newline shortcut in Messages app</name>
<identifier>private.Messages.NewLine</identifier>
View gist:260780defd28739c50c05e1c1f83df53
def create_payload(url, start_year, stop_year, timelapse_level):
collapse_options = {'yearly': 'timestamp:4', 'monthly': 'timestamp:6'}
collapse = collapse_options[timelapse_level]
payload = {
'url': url,
'output': 'json',
'fl': 'timestamp,original',
'from': start_year,
You can’t perform that action at this time.