Skip to content

Instantly share code, notes, and snippets.

View mikeifomin's full-sized avatar

mike mikeifomin

View GitHub Profile
schema {
query: Query
mutation: Mutation
subscription: Subscription
}
type Query {
coins: [Coin!]!
wallets(Ids:[ID!]) Wallet
}
@mikeifomin
mikeifomin / watch_simple_fswatch.sh
Last active January 9, 2019 16:31
watch_simple_fswatch.sh
!#/bin/bash
fswatch -ro . | xargs -n 1 bash -c "go test"
@mikeifomin
mikeifomin / postgres_in_order.md
Created December 10, 2018 13:06
Postgres select IN order (great for GraphQL loaders)
SELECT * FROM tbl WHERE id = ANY($1) ORDER BY array_position($1, id);
@mikeifomin
mikeifomin / wait_for_http.yml
Created October 8, 2016 10:20
Ansible wait_for http
- name: wait_for http
command: "curl --silent {{ url }}"
register: result
until: result.stdout.find("200 OK") != -1
retries: 60
delay: 1
changed_when: false
# this is just a reminder, NOT WORKING as a install script
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get update &&
sudo apt-get install nvidia-367
sudo apt-get install apt-transport-https ca-certificates
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
Router.onBeforeAction ->
userId = Meteor.userId()
if @route?.options?.roles
if Roles.userIsInRole userId,@route.options.roles
@next()
else
@render("pageAccessDenied")
else if @route?.options?.authRequire
@mikeifomin
mikeifomin / gist:711db5193f42f44835ad
Created August 30, 2015 13:37
Meteor timeout in server methods. #meteor #fibers #setTimeout
Meteor.wrapAsync(function (callback) {
Meteor.setTimeout(function () {
callback();
}, 1000);
})();
@mikeifomin
mikeifomin / gist:a7c9e2e6adede3cda171
Last active August 29, 2015 14:23
cuDNN install
export LD_LIBRARY_PATH=`pwd`:$LD_LIBRARY_PATH
export LIBRARY_PATH=$LIBRARY_PATH:$LD_LIBRARY_PATH
export PATH=$PATH:$LD_LIBRARY_PATH
for caffe build with cuDNN in ubuntu 14.04
@mikeifomin
mikeifomin / install for ubuntu 14
Created June 13, 2014 11:16
Fresh ubuntu 14 install
apt-get update
apt-get upgrade
apt-get install -y git wget
apt-get install -y node nodejs-legacy npm
npm i -g yo
apt-get install python-setuptools python-pip
pip install virtualenv fabric
@mikeifomin
mikeifomin / gist:9446894
Created March 9, 2014 12:13
My simples in python, just for not forget
# abs path of current file
PATH_ABS = os.path.dirname(os.path.realpath(__file__))