Skip to content

Instantly share code, notes, and snippets.

View andilabs's full-sized avatar
👨‍💻
still in love with coding!

Andrzej Kostanski andilabs

👨‍💻
still in love with coding!
View GitHub Profile
@PhE
PhE / highcharts.ipynb
Created May 31, 2013 16:59
ipython notebbok highcharts integration
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nanusdad
nanusdad / git-init-repo-from-dir
Created October 28, 2013 23:12
GitHub - initialize from existing directory
Create the remote repository, and get the URL such as
git@github.com:/youruser/somename.git or https://github.com/youruser/somename.git
If your local GIT repo is already set up, skips steps 2 and 3
Locally, at the root directory of your source, git init
Locally, add and commit what you want in your initial repo
@rodrigogadea
rodrigogadea / flower.sh
Created January 3, 2014 01:30
Quick and Dirty bash script to daemonize Flower - i.e. /etc/init.d/flower
#!/bin/bash
NAME=flower
DESC="flower daemon"
# Name of the projects settings module.
export DJANGO_SETTINGS_MODULE="yourproject.settings"
# Path to virtualenv
ENV_PYTHON="/home/youruser/.virtualenvs/yourvirtualenv/bin/python"
@movEAX
movEAX / gist:d128a9602cf93e3dba2e
Created August 31, 2014 16:21
Postgresql: PL/Python trigger for logging row changes.
CREATE EXTENSION plpython2u;
-- TODO:
-- 1) Кэш соединения с ZMQ
-- 2) Найти оптимальный способ сериализаци данных
-- 3) Рассмотреть вариант с LISTEN/NOTIFY и PGQ
CREATE OR REPLACE FUNCTION row_trigger()
RETURNS TRIGGER
AS $$
import json, zmq
@gwillem
gwillem / ansible-bootstrap-ubuntu-16.04.yml
Created June 16, 2016 21:59
Get Ansible to work on bare Ubuntu 16.04 without python 2.7
# Add this snippet to the top of your playbook.
# It will install python2 if missing (but checks first so no expensive repeated apt updates)
# gwillem@gmail.com
- hosts: all
gather_facts: False
tasks:
- name: install python 2
raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal)
@arunoda
arunoda / gist:7790979
Last active February 16, 2024 14:05
Installing SSHPass

Installing SSHPASS

SSHPass is a tiny utility, which allows you to provide the ssh password without using the prompt. This will very helpful for scripting. SSHPass is not good to use in multi-user environment. If you use SSHPass on your development machine, it don't do anything evil.

Installing on Ubuntu

apt-get install sshpass

Installing on OS X

@chantastic
chantastic / on-jsx.markdown
Last active March 20, 2024 01:03
JSX, a year in

Hi Nicholas,

I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I led the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:

The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can't

@mdo
mdo / 00-intro.md
Last active March 24, 2024 08:04
Instructions for how to affix an Ikea Gerton table top to the Ikea Bekant sit-stand desk frame.

Ikea Bekant standing desk with Gerton table top

@dukebody
dukebody / json_field.py
Last active March 28, 2024 11:44
JSON field for WTForms that converts between the form string data and a dictionary representation, with validation
from wtforms import fields
import json
class JSONField(fields.StringField):
def _value(self):
return json.dumps(self.data) if self.data else ''
def process_formdata(self, valuelist):
if valuelist:
"""
Django ORM Optimization Tips
Caveats:
* Only use optimizations that obfuscate the code if you need to.
* Not all of these tips are hard and fast rules.
* Use your judgement to determine what improvements are appropriate for your code.
"""
# ---------------------------------------------------------------------------