Skip to content

Instantly share code, notes, and snippets.

View softvar's full-sized avatar
:octocat:
Building stuff...

Varun Malhotra softvar

:octocat:
Building stuff...
View GitHub Profile
function hostReachable() {
// Handle IE and more capable browsers
var xhr = new ( window.ActiveXObject || XMLHttpRequest )( "Microsoft.XMLHTTP" );
var status;
// Open new request as a HEAD to the root hostname with a random param to bust the cache
xhr.open( "HEAD", "//" + window.location.hostname + "/?rand=" + Math.floor((1 + Math.random()) * 0x10000), false );
// Issue request and handle response
@softvar
softvar / Test.kv
Last active December 17, 2015 19:39
testing touch events
#:kivy 1.0
#:import kivy kivy
#:import win kivy.core.window
<cont>:
but: but
FloatLayout:
size:(600,600)
Button:
@softvar
softvar / main.py
Created May 30, 2013 08:28
diagrammer - changes in main.py for connections
import kivy
kivy.require('1.6.0')
import random
from kivy.app import App
from kivy.graphics import Color, Ellipse, Line, Rectangle
from kivy.properties import ListProperty, ObjectProperty
from kivy.uix.gridlayout import GridLayout
from kivy.uix.image import Image
#!/usr/local/bin/node
/* ProductHunt posts upvotes count and Emoji on change :)
* BitBar plugin
*
* by Varun Malhotra
* (c) 2016
* LICENSE - MIT
*
* Shows current votes count of each post and notification bell (🔔) on change
#!/usr/local/bin/node
/* Github repos stars count and Emoji on change :)
* BitBar plugin
*
* by Varun Malhotra
* (c) 2015
* LICENSE - MIT
*
* Shows current stars count of each repo and 🔔 on change
/*!
* jQuery JavaScript Library v1.6.4
* http://jquery.com/
*
* Copyright 2011, John Resig
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* Includes Sizzle.js
* http://sizzlejs.com/
@softvar
softvar / pr.md
Created August 5, 2018 10:29 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@softvar
softvar / pushcrew.js
Last active September 19, 2019 07:05
var env=location.search.split('env=')[1] ? location.search.split('env=')[1] : 'pushcrew';
var account_hash=location.search.split('hash=', 32)[1] ? location.search.split('hash=', 32)[1] : '9124e552b5bae794f8d75b23813e9d84';
if (account_hash.indexOf('&') > 0) {
account_hash = account_hash.split('&')[0];
}
(function(p,u,s,h){
p._pcq=p._pcq||[];
p._pcq.push(['_currentTime',Date.now()]);
s=u.createElement('script');
s.type='text/javascript';
@softvar
softvar / pb
Created February 4, 2020 20:17
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC3d0NgLvKUJudVqVUMG0mgTHfAsGk7A+DWiIe5lyE98u5QB3qyxgrYv+t3ly6Pf0wXDzxLMhsbh2Z3TZe/YP1PTMd8RZhVD4OPsze+UWxZ+f1zb4DrbE/ntuzU18SgmoJVjXpgdEw4pBW0T99Wz5SxLTtxQjb7p7pFWgvxhc5tSoZomHKT3GkyzszpaBb+pASxAq+p4WgF5oYK9q+c9H0c76ns8YpndQihktVFZz8rsMdgGVXecmyERTvr+agK2uoKYSXHtRLHiyvJa+/Ay0F85FCum6mIItuMUfKT9ZhdnDtxg8A4wcI7pGZc6aiV2SOD3xe85Pz35Tf0tVtEC9sZ varun2902@gmail.com