Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
sudo apt-get install git
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
sudo python get-pip.py
sudo pip install google_images_download
#git clone https://github.com/hardikvasa/google-images-download.git
#cd google-images-download
googleimagesdownload -k "mosquito bite" -i mosquito_bite
@ruizjme
ruizjme / graphql_crawl.py
Created November 7, 2018 12:34
GraphQL crawl schema
def graphql_query(payload):
query = str(payload).replace("'",'%22')
r = requests.get("https://example.com/graphql?query={}".format(query))
return r.json()
payload = "{__schema{types{name}}}"
r = graphql_query(payload)
for t in [i['name'] for i in r['data']['__schema']['types']]:
print(t)
@ruizjme
ruizjme / transverse_dict.py
Created November 6, 2018 03:39
transverse python dict
def transverse_dict(d, indent=0, level=None, abstract=False):
"""Transverse dictionary to see underlying structure
indent: amount of indent when outputing to console
level: max depth when transversing
abstract: if True, prints the datatype for items
that are not lists or dicts.
if False, prints the items themselves
"""
#include <iostream>
using namespace std;
void printTruthTable () {
cout << "A B | X" << endl;
for (int i = 0; i <= 1; i++){
for (int j = 0; j <= 1; j++){
bool A = i;
@ruizjme
ruizjme / script-to-usb.py
Last active January 7, 2017 12:58
Populate usb drives in bulk for a conference giveaway.
#!/usr/bin/env python
import os
import shutil
import time
# DIRECTORY PATHS =========================
driveName = 'DISK_IMG'
drivePath = '../../Volumes/%s' % driveName
/*
MOD
POT
BUTTONS (toggle)
Smoothing
CONNECTIONS:
/*
* MIDI Control Change
*/
#include <MIDI.h>
MIDI_CREATE_DEFAULT_INSTANCE();
#define potPin A0 // define peripherals
/*
V5 - 2-11-15 - JR
This program plays a note at a given bpm through serial MIDI
-POT changes the speed notes are played (by multiples of the base tempo)
-PROXIMITY SENSOR changes the pitch of the notes played (notes within chord)
-BUTTONS select chord from an arrray of chords