I hereby claim:
- I am shobhit on github.
- I am shobhit (https://keybase.io/shobhit) on keybase.
- I have a public key ASCKYhA9dZyuhgAfNe63VAjf3JTiYsJ3CIC69soXskP3Jgo
To claim this, I am signing this object:
const getCssSelectorShort = (el) => { | |
let path = [], parent; | |
while (parent = el.parentNode) { | |
let tag = el.tagName, siblings; | |
path.unshift( | |
el.id ? `#${el.id}` : ( | |
siblings = parent.children, | |
[].filter.call(siblings, sibling => sibling.tagName === tag).length === 1 ? tag : | |
`${tag}:nth-child(${1+[].indexOf.call(siblings, el)})` | |
) |
const getCssSelector = (el) => { | |
let path = [], parent; | |
while (parent = el.parentNode) { | |
path.unshift(`${el.tagName}:nth-child(${[].indexOf.call(parent.children, el)+1})`); | |
el = parent; | |
} | |
return `${path.join(' > ')}`.toLowerCase(); | |
}; |
<!DOCTYPE html> | |
<html> | |
<head> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script> | |
<title>Download SVG</title> | |
<style type="text/css"> | |
a{ | |
cursor: pointer; | |
text-decoration: underline; | |
color: black; |
#!/bin/bash | |
echo "Hi! lets change our mac address." | |
echo "Step 1: hold down option key, click wifi logo. Note the mac address" | |
echo "Step 2: click 'disconnect from network' " | |
echo "Step 3: note which ethernet adapter lines up with the mac address you just saw" | |
read -p 'Step 4: Which device lined up would you like to change? (hit return for en0) ' ether_adapter | |
if [ -z $ether_adapter ] | |
then |
{ | |
"basics": { | |
"name": "Shobhit Jain", | |
"label": "Full Stack Developer", | |
"email": "[email protected]", | |
"phone": "+91-8880145930", | |
"summary": "Started career from a small startup called mygola.com which got acquired by makemytrip.com. From chrome-extension to large scale apps i have worked on lots of technologies and interesting projects. I love to get challenged by difficult problems and try to get innovative solutions", | |
"location": { | |
"address": "B508, Manar Elegance", | |
"postalCode": "560102", |
from collections import defaultdict, deque | |
class Graph(object): | |
def __init__(self): | |
self.nodes = set() | |
self.edges = defaultdict(list) | |
self.distances = {} | |
def add_node(self, value): |
I hereby claim:
To claim this, I am signing this object:
<?xml version="1.0" encoding="utf-8"?> | |
<set xmlns:android="http://schemas.android.com/apk/res/android" | |
android:shareInterpolator="false"> | |
<translate | |
android:fromXDelta="0%" android:toXDelta="100%" | |
android:duration="350"/> | |
</set> |
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
# Load Json into a Python object | |
import urllib2 | |
import json | |
req = urllib2.Request("http://localhost/sensors/temperature.json") | |
opener = urllib2.build_opener() | |
f = opener.open(req) | |
json = json.loads(f.read()) | |
print json | |
print json['unit'] |