Skip to content

Instantly share code, notes, and snippets.

View ivansabik's full-sized avatar

Iván ivansabik

  • Americas
View GitHub Profile
@johnteske
johnteske / index.html
Created January 5, 2017 18:49
Liquid number format with commas
{% include numberWithCommas.html number=1 %}
{% include numberWithCommas.html number=12 %}
{% include numberWithCommas.html number=123 %}
{% include numberWithCommas.html number=1234 %}
{% include numberWithCommas.html number=12345 %}
{% include numberWithCommas.html number=123456 %}
{% include numberWithCommas.html number=1234567 %}
{% include numberWithCommas.html number=12345678 %}
{% include numberWithCommas.html number=123456789 %}
{% include numberWithCommas.html number=1234567890 %}
@twolfson
twolfson / README.md
Created February 5, 2015 21:22
Toggling between `alembic` databases

alembic is great but lacks an out of the box way to set up running migrations against a specific database (e.g. development, test, production). The following adjustments to its env.py and alembic.ini allow us to target a specific database:

Example:

alembic -x db=development upgrade head

env.py:

@sirkkalap
sirkkalap / Install-Docker-on-Linux-Mint.sh
Last active December 8, 2022 18:38
Install Docker on Linux Mint
##########################################
# To run:
# curl -sSL https://gist.githubusercontent.com/sirkkalap/e87cd580a47b180a7d32/raw/d9c9ebae4f5cf64eed4676e8aedac265b5a51bfa/Install-Docker-on-Linux-Mint.sh | bash -x
##########################################
# Check that HTTPS transport is available to APT
if [ ! -e /usr/lib/apt/methods/https ]; then
sudo apt-get update
sudo apt-get install -y apt-transport-https
fi
@bsweger
bsweger / useful_pandas_snippets.md
Last active April 19, 2024 18:04
Useful Pandas Snippets

Useful Pandas Snippets

A personal diary of DataFrame munging over the years.

Data Types and Conversion

Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)

@sanderhouttekier
sanderhouttekier / install_robomongo.sh
Created April 28, 2014 06:13
This file installs robomongo on your ubuntu / mint linux install
#!/bin/bash -e
# Script for installing Robomongo on Ubuntu.
# Copyright 2013 Binary Birch Tree
# http://www.binarybirchtree.com
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
@fabriceleal
fabriceleal / gist:7803969
Last active February 22, 2024 09:21
Decent enough macro for exporting csvs from Excel.
' http://support.microsoft.com/kb/291296/en-us
' http://superuser.com/questions/130592/how-do-you-force-excel-to-quote-all-columns-of-a-csv-file
' - change integer to long indexing
' http://stackoverflow.com/questions/2524703/save-text-file-utf-8-encoded-with-vba
' - output utf8 content
Sub QuoteCommaExport()
' Dimension all variables.
Dim DestFile As String
Dim FileNum As Integer
@Niklas9
Niklas9 / non-async-tests-mongoose.js
Last active June 29, 2016 17:51
using wait.for to do synchronous gets from MongoDB using Mongoose
var mongoose = require('mongoose');
var wait = require('wait.for');
mongoose.connect('localhost', 'non_async_tests');
var itemSchema = new mongoose.Schema({
name: String
});
var Item = mongoose.model("Item", itemSchema);
@willurd
willurd / web-servers.md
Last active April 26, 2024 18:00
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@christianroman
christianroman / test.py
Created May 30, 2013 16:02
Bypass Captcha using 10 lines of code with Python, OpenCV & Tesseract OCR engine
import cv2.cv as cv
import tesseract
gray = cv.LoadImage('captcha.jpeg', cv.CV_LOAD_IMAGE_GRAYSCALE)
cv.Threshold(gray, gray, 231, 255, cv.CV_THRESH_BINARY)
api = tesseract.TessBaseAPI()
api.Init(".","eng",tesseract.OEM_DEFAULT)
api.SetVariable("tessedit_char_whitelist", "0123456789abcdefghijklmnopqrstuvwxyz")
api.SetPageSegMode(tesseract.PSM_SINGLE_WORD)
tesseract.SetCvImage(gray,api)
print api.GetUTF8Text()
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active April 19, 2024 11:00
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application: