Skip to content

Instantly share code, notes, and snippets.

View ichim-david's full-sized avatar

David Ichim ichim-david

  • Romania
View GitHub Profile
--- django_test_manage.py.orig 2014-10-21 21:50:06.000000000 -0700
+++ django_test_manage.py 2014-10-21 22:59:51.000000000 -0700
@@ -2,16 +2,42 @@
import os
import sys
+import re
from django.core.management import ManagementUtility
@ichim-david
ichim-david / trello-css-guide.md
Created October 11, 2015 19:37 — forked from bobbygrace/trello-css-guide.md
Trello CSS Guide

Trello CSS Guide

“I perfectly understand our CSS. I never have any issues with cascading rules. I never have to use !important or inline styles. Even though somebody else wrote this bit of CSS, I know exactly how it works and how to extend it. Fixes are easy! I have a hard time breaking our CSS. I know exactly where to put new CSS. We use all of our CSS and it’s pretty small overall. When I delete a template, I know the exact corresponding CSS file and I can delete it all at once. Nothing gets left behind.”

You often hear updog saying stuff like this. Who’s updog? Not much, who is up with you?

This is where any fun you might have been having ends. Now it’s time to get serious and talk about rules.

Writing CSS is hard. Even if you know all the intricacies of position and float and overflow and z-index, it’s easy to end up with spaghetti code where you need inline styles, !important rules, unused cruft, and general confusion. This guide provides some architecture for writing CSS so it stays clean and ma

@ichim-david
ichim-david / requirements.txt
Created February 18, 2016 11:52 — forked from alanhamlett/requirements.txt
WakaTime's requirements.txt Python dependencies
-e git://github.com/kennethreitz/inbox.py.git@551b4f44b144564504c687cebdb4c543cb8e9adf#egg=inbox
alembic==0.8.3
amqp==1.4.9
anyjson==0.3.3
boto==2.39.0
braintree==3.20.0
cairosvg==1.0.19
celery==3.1.20
@ichim-david
ichim-david / README.md
Created March 3, 2016 09:57 — forked from magnetikonline/README.md
IE 7/8/9/10/11 Virtual machines from Microsoft - Linux w/VirtualBox installation notes.
@ichim-david
ichim-david / gist:9eb8e8f4978260dab75177ed8873410e
Created April 21, 2016 14:36 — forked from mjpieters/gist:2506986
plone.app.async decorator template
_decoratedFunctions = {}
class _AsyncSomething(object):
"""Async job decorator
Tracks decorated function via a global mapping instead of storing
the function directly to remain pickleable.
"""
_name = ''
@ichim-david
ichim-david / README.md
Created May 27, 2016 14:45
Circular imports in Python 2 and Python 3: when are they fatal? When do they work?

When are Python circular imports fatal?

In your Python package, you have:

  • an __init__.py that designates this as a Python package
  • a module_a.py, containing a function action_a() that references an attribute (like a function or variable) in module_b.py, and
  • a module_b.py, containing a function action_b() that references an attribute (like a function or variable) in module_a.py.

This situation can introduce a circular import error: module_a attempts to import module_b, but can't, because module_b needs to import module_a, which is in the process of being interpreted.

But, sometimes Python is magic, and code that looks like it should cause this circular import error works just fine!

@ichim-david
ichim-david / vpn_psk_bingo.md
Created June 2, 2016 07:36 — forked from kennwhite/vpn_psk_bingo.md
Most VPN Services are Terrible
@ichim-david
ichim-david / FontFix RubyMine
Created January 30, 2017 12:41 — forked from leemour/FontFix RubyMine
Fixing font anti-aliasing for Ubuntu.
# Change Java Runtime:
sudo update-alternatives --config java
# Delete Open-JDK
sudo apt-get purge openjdk-\* icedtea-\* icedtea6-\*
# Change fonts - remove hinting:
http://askubuntu.com/questions/32624/ugly-fonts-in-netbeans-how-can-i-make-it-use-the-system-font
# Change RubyMine AntiAliasing first:
(function($, window, undefined) {
var InfiniteScroll = function() {
this.initialize = function() {
this.setupEvents();
};
this.setupEvents = function() {
$(window).on(
'scroll',
this.handleScroll.bind(this)
@ichim-david
ichim-david / local-storage.js
Created May 2, 2017 11:59 — forked from GianlucaGuarini/local-storage.js
A simple script to deal safely with the localStorage
/**
* Deal with the localStorage avoiding odd issues due to paranoids that have disabled it by default
*/
const ls = window.localStorage
/**
* Call any method on the localStorage avoiding to throw errors
* @param {string} method - method we want to call
* @param {array} args - serialized params that will be proxied to the method we are going to call
* @returns {null|string} whatever the method call will return