Skip to content

Instantly share code, notes, and snippets.

View bartek's full-sized avatar
🐗

Bartek Ciszkowski bartek

🐗
View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bartek
bartek / pre-commit
Created December 10, 2018 14:02 — forked from pbhandari/pre-commit
pre commit hook for running pylint
#!/bin/sh
DESIRED_VENV=compass
if [ -z $VIRTUAL_ENV ] || [ "`basename $VIRTUAL_ENV`" != "$DESIRED_VENV" ]; then
echo You\'re not in the $DESIRED_VENV virtualenv, \`workon $DESIRED_VENV\` to fix.
exit 1
fi
RCFILE="`git rev-parse --show-toplevel`"/.pylintrc
@bartek
bartek / tutorial.md
Created July 25, 2018 01:21 — forked from swalkinshaw/tutorial.md
Designing a GraphQL API

Tutorial: Designing a GraphQL API

This tutorial was created by Shopify for internal purposes. We've created a public version of it since we think it's useful to anyone creating a GraphQL API.

It's based on lessons learned from creating and evolving production schemas at Shopify over almost 3 years. The tutorial has evolved and will continue to change in the future so nothing is set in stone.

@bartek
bartek / dns tuning ssh login speedup vagrant
Created September 19, 2016 14:02 — forked from jedi4ever/dns tuning ssh login speedup vagrant
speeding up DNS/SSH connections in vagrant
- Tune /etc/ssh/sshd_config
UseDNS no # Disable DNS lookups
GSSAPIAuthentication no # Disable negotation of slow GSSAPI
don't forget to restart it, use a script provider to set it , or create it with veewee or snapshot it
- Tune Vagrantfile
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
@bartek
bartek / gist:0e751057c78b82689be4
Created November 19, 2015 02:14 — forked from jberkus/gist:6b1bcaf7724dfc2a54f3
Finding Unused Indexes
WITH table_scans as (
SELECT relid,
tables.idx_scan + tables.seq_scan as all_scans,
( tables.n_tup_ins + tables.n_tup_upd + tables.n_tup_del ) as writes,
pg_relation_size(relid) as table_size
FROM pg_stat_user_tables as tables
),
all_writes as (
SELECT sum(writes) as total_writes
FROM table_scans
# Prompt Colors
RED="\[\033[0;31m\]"
PINK="\[\033[1;31m\]"
YELLOW="\[\033[1;33m\]"
GREEN="\[\033[0;32m\]"
LT_GREEN="\[\033[1;32m\]"
BLUE="\[\033[0;34m\]"
WHITE="\[\033[1;37m\]"
PURPLE="\[\033[1;35m\]"
CYAN="\[\033[1;36m\]"
@bartek
bartek / index.js
Created June 12, 2015 19:45
requirebin sketch
// require() some stuff from npm (like you were using browserify)
// and then hit Run Code to run it on the right
var request = require('superagent'),
_ = require('lodash')
function collectResponse(err, resp) {
var results = document.getElementById('results')
_.each(resp.body.results, function(item) {
var child = document.createElement("div")
child.innerHTML = item.product_line + " -- " + item.departures_start_date
@bartek
bartek / index.js
Created June 9, 2015 14:05
requirebin sketch
// require() some stuff from npm (like you were using browserify)
// and then hit Run Code to run it on the right
var request = require('superagent'),
_ = require('lodash')
function collectResponse(err, resp) {
var results = document.getElementById('results')
_.each(resp.body.results, function(item) {
var child = document.createElement("div")
child.innerHTML = item.product_line + " -- " + item.departures_start_date

Learn you a browserify

We want to learn:

  • What is NPM
  • Dependencies installation
  • Initially package.json for your project
  • Project workflow:
    • Begin writing code
  • Require dependencies
@bartek
bartek / -
Created October 8, 2014 17:09
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6WH/85Y1ShcZWCq29dLpapwe2q7g3pSScybaJuYGO0gxfCDWEYr8+kadw5GB7vIQJvUcK+XLgurWRtjrVYMIfuWsHW1VG8Aq2GEh3UiWbew8l07xcAQTRhdWboZnYszf+72jkK72do42sp5GblQKp6iFtml6sEgL2BtpJojdkrs8j8wocAmFAgdYKmkcPTGRhxCP7actWd7rNyn0Tc4GW5kQLyzajQoEMLjtzVNniXqIue2/iydoQCCKLGGsWLQ0VQCXzb++30atda4dzdGy0tQBMV4osYcXKNSuroCK29v8vLhtpVrfAY9k3IAxJsyu0Qd7Wr931F5Rqlso0gNKwQ== [email protected]