Skip to content

Instantly share code, notes, and snippets.

View codemickeycode's full-sized avatar

Micaela Reyes codemickeycode

View GitHub Profile
@codemickeycode
codemickeycode / sublimetext
Created May 6, 2017 06:21
sublimetext-config.txt
// Settings in here override those in "Default/Preferences.sublime-settings",
// and are overridden in turn by file type specific settings.
{
"draw_white_space": "all",
"font_size": 10,
"rulers":
[
79,
100,
120
@codemickeycode
codemickeycode / django-tenants-research.md
Last active September 7, 2016 01:39
Multi-tenancy Implementation for Django

Multi-tenancy Implementation for Django

  • Notes on how to use django-tenants library:
    • Data Architecture
    • Domain setup / URL routing for root and per tenant
    • App structure
    • Limitations

django-tenants

def find_anagrams(dictionary):
n = len(dictionary)
for i in xrange(n):
for j in xrange(i + 1, n):
a = dictionary[i]
b = dictionary[j]
if sorted(a) == sorted(b):
yield a
def find_anagrams2(dictionary):
@codemickeycode
codemickeycode / gist:c71e859a39894956ceec
Last active August 29, 2015 14:19
Pythagorean Triplet
A Pythagorean triplet is a set of three natural numbers, a < b < c, for which,
a^2 + b^2 = c^2
For example, 3^2 + 4^2 = 9 + 16 = 25 = 5^2.
There exists exactly one Pythagorean triplet for which a + b + c = 1000.
Find the product abc.
@codemickeycode
codemickeycode / ListComprehension.py
Last active August 29, 2015 14:17
Python - List
#long version
list = []
for x in range(0,10):
x = x+10
list.append(x)
print "list: "
print list
#short version
list_comprehension = [x+10 for x in range(0,10)]
@codemickeycode
codemickeycode / ListComprehension
Last active August 29, 2015 14:17
Java - List
import java.util.ArrayList;
public class ListComprehension {
public static void main (String[] args) {
ArrayList<Integer> list = new ArrayList<Integer>();
//for (i in Range.between(0, 10)){
for(int x = 0; x < 10; x++){
int num = x + 10;
@codemickeycode
codemickeycode / dev-machine-setup
Last active August 29, 2015 14:09
Dev Machine Setup
# Upgrade update
# ssh keys, chmod ssh keys, bashrc
```
copy all your ssh keys to your home folder
$ chmod 600 ~/.ssh/* && chmod 644 ~/.ssh/*.pub && chmod 664 ~/.ssh/config
copy .bashrc to your home folder
```
# install your usual dependencies