Skip to content

Instantly share code, notes, and snippets.

View hiquest's full-sized avatar
🎯
Focusing

Giannis hiquest

🎯
Focusing
View GitHub Profile
@hiquest
hiquest / nothis.jsx
Created October 5, 2018 09:25
No this in React
import React from 'react'
// ... other imports
import nothis from '../shared/nothis'
export default nothis({
willMount,
render,
})
@hiquest
hiquest / truthy.md
Last active August 4, 2018 11:16
Truthy check in JavaScript vs. Python vs. Ruby
Value JavaScript Ruby Python
null false false false
0 false true false
"" false true false
[] true true false
{} true true false

Keybase proof

I hereby claim:

  • I am hiquest on github.
  • I am yanis (https://keybase.io/yanis) on keybase.
  • I have a public key ASDGw1CrZ6iXLOwaIMGvLj4cEkMYgD4nVJVOF2fKWPGVmAo

To claim this, I am signing this object:

@hiquest
hiquest / count_hits.sh
Created January 10, 2016 10:37
Count how many times each endpoint has been hit
grep 'Started' production.log \
| grep -o '".*"' \
| sed --regexp-extended 's/[0-9]+/:id/' \
| sort \
| uniq -c \
| sort --reverse \
| more
@hiquest
hiquest / gist:3350ede53e80c4326c96
Created April 28, 2015 14:46
Make a pull request from command line (OSX ready)
#!/bin/sh
# This will open a browser window with pull-request
set -e
project=`git remote -v | grep origin | head -n 1 | awk '{print $2}' | sed 's/.*github.com.//' | sed 's/\.git//'`
branch=`git rev-parse --abbrev-ref HEAD`
url="https://github.com/$project/compare/$branch?expand=1"
open $url
@hiquest
hiquest / gist:63b6c123e21e2e9ecec9
Created February 12, 2015 12:09
Update all of your vim plugins in ~/.vim/bundle/
#!/bin/bash
set -e
ls ~/.vim/bundle |
xargs -n1 |
while read l; do
cd ~/.vim/bundle/$l && git pull
done
// http://www.html5rocks.com/en/tutorials/es6/promises/
function get(url) {
// Return a new promise.
return new Promise(function(resolve, reject) {
// Do the usual XHR stuff
var req = new XMLHttpRequest();
req.open('GET', url);
req.onload = function() {