Skip to content

Instantly share code, notes, and snippets.

View 0bserver07's full-sized avatar
🦋
Doing Research Reproducibility & Program Synthesis

Yad Konrad 0bserver07

🦋
Doing Research Reproducibility & Program Synthesis
View GitHub Profile
@0bserver07
0bserver07 / env.py
Created June 12, 2017 18:09 — forked from logston/env.py
A snippet for getting Alembic to recognize multiple model classes in multiple modules
# Inspired by http://liuhongjiang.github.io/hexotech/2015/10/14/alembic-support-multiple-model-files/
def combine_metadata():
from sqlalchemy import MetaData
import models # models file into which all models are imported
model_classes = []
for model_name in models.__all__:
model_classes.append(getattr(models, model_name))
@0bserver07
0bserver07 / ImageMagick-snippets.md
Created November 21, 2016 03:17 — forked from MohamedAlaa/ImageMagick-snippets.md
ImageMagick Snippets

Remove white background color of an image in ImageMagick

$ convert  your.jpg  -transparent white  your.png

Flatten a transparent image with a white background:

@0bserver07
0bserver07 / README.md
Created June 29, 2016 20:26 — forked from rduplain/README.md
Connect to MSSQL using FreeTDS / ODBC in Python.

Goal: Connect to MSSQL using FreeTDS / ODBC in Python.

Host: Ubuntu 11.10 x86_64

Install:

sudo apt-get install freetds-dev freetds-bin unixodbc-dev tdsodbc
pip install pyodbc sqlalchemy

In /etc/odbcinst.ini:

@0bserver07
0bserver07 / gist:e2ac101aef7edd63fd15fcc6c760b9fd
Created May 26, 2016 17:00 — forked from entaroadun/gist:1653794
Recommendation and Ratings Public Data Sets For Machine Learning

Movies Recommendation:

Music Recommendation:

Products

index of products 25 first

curl -i -H "X-Spree-Token: YOUR_TOKEN_ID" http://0.0.0.0:3000/api/products.json

Show a product

curl -i -H "X-Spree-Token: YOUR_TOKEN_ID" http://0.0.0.0:3000/api/products/706676762.json

Modify a product

curl -i -X PUT -H "X-Spree-Token: YOUR_TOKEN_ID" -d "product[name]=Headphones" http://0.0.0.0:3000/api/products/706676762.json

@0bserver07
0bserver07 / zsh.md
Last active August 29, 2015 14:28 — forked from tsabat/zsh.md
Getting oh-my-zsh to work in Ubuntu
@0bserver07
0bserver07 / foo.log
Last active August 29, 2015 14:26 — forked from ibeex/foo.log
Flask logging example
A warning occurred (42 apples)
An error occurred
@0bserver07
0bserver07 / Ruby ORMs.md
Last active August 29, 2015 14:21 — forked from booch/Ruby ORMs.md

Ruby ORMs

Abstract

Rails is really a collection of pieces that can be put together to create a web app. You can enhance or replace many of the components - how you write views, how controllers work, and how you build models. While models are built on top of ActiveRecord in the

#!/usr/bin/ruby
#
# This script fixes /usr/local only.
#
# 6th January 2010:
# Modified the script to just fix, rather than install. - rpavlik
#
# 30th March 2010:
# Added a check to make sure user is in the staff group. This was a problem
# for me, and I think it was due to me migrating my account over several
#!/bin/bash
find . \( -iname '*.rb' -o -iname '*.css' -o -iname '*.js' -o -iname '*.erb' -o -iname '*.html' -o -iname '*.haml' -o -iname '*.scss' -o -iname '*.coffee' \) -exec wc -l {} + | sort -n