This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
MIT License | |
Copyright (c) 2018 Mitchel Cabuloy | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install mongo | |
brew install mongodb | |
#create the path in which mongo will store databases (it is recommended not to change this path) | |
sudo mkdir -p /data/db | |
#give us permissions over data/db: | |
# get our name | |
whoami | |
# get ownership: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# All in environment | |
pip freeze --local | xargs -n1 pip install -U | |
#Also saving previous values | |
pip freeze --local | tee before_upgrade.txt | xargs -n1 pip install -U | |
#Just outdated | |
pip list --outdated --format=freeze --local | xargs -n1 pip install -U |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# from — https://mths.be/macos | |
### General UI/UX ### | |
# Disable the sound effects on boot | |
sudo nvram SystemAudioVolume=" " | |
### Keyboard ### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
url(r'^logout/$', 'django.contrib.auth.views.logout', {'next_page': '/'}), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pip install boto3 | |
import boto3 | |
client = boto3.client('ses', | |
aws_access_key_id='XXXXXXXXXXXXXXXX', | |
aws_secret_access_key='XXXXXXXXXXXXXXXX', | |
region_name='us-east-1') | |
try: | |
response = client.send_email(Source='from@emaildomain.com', | |
Destination={'ToAddresses':['toemail@address.com']}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String.prototype.toSeconds = function () { | |
if (!this) return null; | |
var hms = this.split(':'); | |
return (+hms[0]) * 60 * 60 + (+hms[1]) * 60 + (+hms[2] || 0); | |
} | |
String.prototype.toHHMMSS = function () { | |
if (!this) return null; | |
var sec_num = parseInt(this, 10); | |
var hours = Math.floor(sec_num / 3600); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
from django.db.models.loading import get_model | |
def dump(qs, outfile_path): | |
""" | |
Takes in a Django queryset and spits out a CSV file. | |
Usage:: | |
>> from utils import dump2csv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<select name="select1" onmousedown="if(this.options.length>8){this.size=8;}" onchange='this.size=0;' onblur="this.size=0;"> | |
<option value="1">This is select number 1</option> | |
<option value="2">This is select number 2</option> | |
<option value="3">This is select number 3</option> | |
<option value="4">This is select number 4</option> | |
<option value="large">This is select number asdf asf saf asdf sa12</option> | |
<option value="5">This is select number 5</option> | |
<option value="6">This is select number 6</option> | |
<option value="7">This is select number 7</option> | |
<option value="8">This is select number 8</option> |
NewerOlder