Skip to content

Instantly share code, notes, and snippets.

View mwm.graphql
schema {
query: Query
mutation: Mutation
subscription: Subscription
}
type Query {
coins: [Coin!]!
wallets(Ids:[ID!]) Wallet
}
@mikeifomin
mikeifomin / watch_simple_fswatch.sh
Last active Jan 9, 2019
watch_simple_fswatch.sh
View watch_simple_fswatch.sh
!#/bin/bash
fswatch -ro . | xargs -n 1 bash -c "go test"
@mikeifomin
mikeifomin / postgres_in_order.md
Created Dec 10, 2018
Postgres select IN order (great for GraphQL loaders)
View postgres_in_order.md
SELECT * FROM tbl WHERE id = ANY($1) ORDER BY array_position($1, id);
View wait_for_http.yml
- name: wait_for http
command: "curl --silent {{ url }}"
register: result
until: result.stdout.find("200 OK") != -1
retries: 60
delay: 1
changed_when: false
View install-server-ubuntu-nvidia-docker.sh
# 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
View router.coffee
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 Aug 30, 2015
Meteor timeout in server methods. #meteor #fibers #setTimeout
View gist:711db5193f42f44835ad
Meteor.wrapAsync(function (callback) {
Meteor.setTimeout(function () {
callback();
}, 1000);
})();
View gist:a7c9e2e6adede3cda171
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 Jun 13, 2014
Fresh ubuntu 14 install
View install for ubuntu 14
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 Mar 9, 2014
My simples in python, just for not forget
View gist:9446894
# abs path of current file
PATH_ABS = os.path.dirname(os.path.realpath(__file__))