Skip to content

Instantly share code, notes, and snippets.

@aisipos
aisipos / gilded_rose.py
Created Apr 15, 2020
Python example solution Gilded Rose code Kata to http://codingdojo.org/kata/GildedRose/
View gilded_rose.py
import logging
import inspect
from dataclasses import dataclass, field
from typing import List, ClassVar
import pytest
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger('rose')
View keybase.md

Keybase proof

I hereby claim:

  • I am aisipos on github.
  • I am aisipos (https://keybase.io/aisipos) on keybase.
  • I have a public key ASD-ZBCV-bWLgrbYByevZNFD5_2rMEunMnZnM3EGqtfgpgo

To claim this, I am signing this object:

@aisipos
aisipos / migration_sql.rb
Last active Aug 26, 2019
Patch Rails ActiveRecord Migrations to output migration scripts
View migration_sql.rb
namespace :db do
[ :migrate, :rollback ].each do |n|
namespace n do |migration_task|
original_task = migration_task.instance_variable_get("@scope").to_a.reverse.join ":"
[:with_sql, :to_sql ].each do |t|
desc "Run migration, and generated SQL" if t == :with_sql
desc "Generate migration SQL" if t == :to_sql
View Play audio in the IPython Notebook.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View mozilla-npm-config.sh
# npm mirroring, courtesy @jbuck and Mozilla.
# See https://github.com/jbuck/npm-readonly-mirror
curl npmrc.zeke.xxx >> .npmrc
git add .npmrc
git commit -m "mozilla .npmrc"
git push heroku master
@aisipos
aisipos / shiboken2.txt
Created Dec 28, 2013
rm /usr/local/bin/python3.2* brew install -v --with-python3 shiboken
View shiboken2.txt
==> Downloading http://download.qt-project.org/official_releases/pyside/shiboken-1.2.1.tar.bz2
Already downloaded: /Library/Caches/Homebrew/shiboken-1.2.1.tar.bz2
==> Verifying shiboken-1.2.1.tar.bz2 checksum
tar xf /Library/Caches/Homebrew/shiboken-1.2.1.tar.bz2
==> Patching
/usr/bin/patch -f -p1 -i 000-homebrew.diff
patching file ext/sparsehash/google/sparsehash/sparseconfig.h
brew: PYTHONPATH=/usr/local/Cellar/shiboken/1.2.1/lib/python2.7/site-packages:/usr/local/Cellar/shiboken/1.2.1/libexec/lib/python2.7/site-packages
==> cmake -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/shiboken/1.2.1 -DCMAKE_BUILD_TYPE=None -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_VERBOSE_MAKEFILE=ON -Wno-dev -DBUILD_TESTS=ON -DPYTHON_INCLUDE_DIR='/usr/local/opt/python/Frameworks/Python.framework/Versions/2.7/Headers' -DPYTHON_LIBRARY='/usr/local/opt/python/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/libpython2.7.dylib' ..
-- The C compiler identification is Clang 5.0.0
@aisipos
aisipos / shiboken.txt
Created Dec 27, 2013
brew install shiboken --with-python3
View shiboken.txt
==> Downloading http://download.qt-project.org/official_releases/pyside/shiboken-1.2.1.tar.bz2
Already downloaded: /Library/Caches/Homebrew/shiboken-1.2.1.tar.bz2
==> Verifying shiboken-1.2.1.tar.bz2 checksum
tar xf /Library/Caches/Homebrew/shiboken-1.2.1.tar.bz2
==> Patching
/usr/bin/patch -f -p1 -i 000-homebrew.diff
patching file ext/sparsehash/google/sparsehash/sparseconfig.h
brew: PYTHONPATH=/usr/local/Cellar/shiboken/1.2.1/lib/python2.7/site-packages:/usr/local/Cellar/shiboken/1.2.1/libexec/lib/python2.7/site-packages
==> cmake -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/shiboken/1.2.1 -DCMAKE_BUILD_TYPE=None -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_VERBOSE_MAKEFILE=ON -Wno-dev -DBUILD_TESTS=ON -DPYTHON_INCLUDE_DIR='/usr/local/opt/python/Frameworks/Python.framework/Versions/2.7/Headers' -DPYTHON_LIBRARY='/usr/local/opt/python/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/libpython2.7.dylib' ..
-- The C compiler identification is Clang 5.0.0
@aisipos
aisipos / brew_pyside_error.txt
Created Dec 27, 2013
Debug output for trying to brew install pyside
View brew_pyside_error.txt
This file has been truncated, but you can view the full file.
brew --config
HOMEBREW_VERSION: 0.9.5
ORIGIN: https://github.com/Homebrew/homebrew.git
HEAD: e126ec926b38ccfcc7c46d3ba32b85afd1ba63d2
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: quad-core 64-bit haswell
OS X: 10.9.1-x86_64
Xcode: 5.0.2
@aisipos
aisipos / jitbit.py
Created Jun 26, 2013
My solutions to jitbit's SQL interview questions: http://www.jitbit.com/news/181-jitbits-sql-interview-questions/ Uses SQLAlchemy to populate a sqlite DB with random data to try out the queries with.
View jitbit.py
"""
A module to populate a DB schema using sqlalchemy for the problems on this webpage:
http://www.jitbit.com/news/181-jitbits-sql-interview-questions/
Questions and my answers:
List employees (names) who have a bigger salary than their boss
select e.name from Employees as e
join Employees as b on e.BossId = b.EmployeeID
where e.Salary < b.Salary
@aisipos
aisipos / gist:5340011
Created Apr 8, 2013
Output of `pip install -v -v -v --force --upgrade pip`
View gist:5340011
» pip install -v -v -v --force --upgrade pip
Downloading/unpacking pip
Running setup.py egg_info for package pip
Running command python setup.py egg_info
running egg_info
writing requirements to pip-egg-info/pip.egg-info/requires.txt
writing pip-egg-info/pip.egg-info/PKG-INFO
writing top-level names to pip-egg-info/pip.egg-info/top_level.txt
writing dependency_links to pip-egg-info/pip.egg-info/dependency_links.txt
writing entry points to pip-egg-info/pip.egg-info/entry_points.txt
You can’t perform that action at this time.