Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Ianis Triandafilov hiquest

🎯
Focusing
Block or report user

Report or block hiquest

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 Wrapping xhr with native javascript Promise
// 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() {
@hiquest
hiquest / nothis.jsx
Created Oct 5, 2018
No this in React
View nothis.jsx
import React from 'react'
// ... other imports
import nothis from '../shared/nothis'
export default nothis({
willMount,
render,
})
@hiquest
hiquest / truthy.md
Last active Aug 4, 2018
Truthy check in JavaScript vs. Python vs. Ruby
View truthy.md
Value JavaScript Ruby Python
null false false false
0 false true false
"" false true false
[] true true false
{} true true false
View keybase.md

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 Jan 10, 2016
Count how many times each endpoint has been hit
View count_hits.sh
grep 'Started' production.log \
| grep -o '".*"' \
| sed --regexp-extended 's/[0-9]+/:id/' \
| sort \
| uniq -c \
| sort --reverse \
| more
@hiquest
hiquest / gist:3350ede53e80c4326c96
Created Apr 28, 2015
Make a pull request from command line (OSX ready)
View gist:3350ede53e80c4326c96
#!/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 Feb 12, 2015
Update all of your vim plugins in ~/.vim/bundle/
View gist:63b6c123e21e2e9ecec9
#!/bin/bash
set -e
ls ~/.vim/bundle |
xargs -n1 |
while read l; do
cd ~/.vim/bundle/$l && git pull
done
You can’t perform that action at this time.