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
(version 1) | |
(allow default) | |
(debug deny) | |
(define (home-subpath home-relative-subpath) | |
;; should be able to use something like (param "HOME_DIR") here, but it's not working for me | |
(subpath (string-append "/Users/pete" home-relative-subpath))) | |
;; can't write anywhere or read /Users by default | |
(deny file-write*) |
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
ls: | |
ls -l /Library/Preferences/SystemConfiguration/ | |
backup: | |
sudo mv /Library/Preferences/SystemConfiguration/com.apple.airport.preferences.plist ~/projects/wifi-backup | |
sudo mv /Library/Preferences/SystemConfiguration/com.apple.network.eapolclient.configuration.plist ~/projects/wifi-backup | |
sudo mv /Library/Preferences/SystemConfiguration/com.apple.wifi.message-tracer.plist ~/projects/wifi-backup | |
sudo mv /Library/Preferences/SystemConfiguration/NetworkInterfaces.plist ~/projects/wifi-backup | |
sudo mv /Library/Preferences/SystemConfiguration/preferences.plist ~/projects/wifi-backup |
In this guide I will go through all the steps to create a VPS, secure it and deploy a Django application. This is a summarized document from this digital ocean doc
Any commands with "$" at the beginning run on your local machine and any "#" run when logged into the server
Use this link and get $10 free. Just select the $5 plan unless this a production app.
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
from django.apps import AppConfig | |
class ForumConfig(AppConfig): | |
name = 'forum' | |
# This function is the only new thing in this file | |
# it just imports the signal file when the app is ready | |
def ready(self): | |
import your_app_name.signals |
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
#!/bin/bash | |
# source: https://gist.github.com/francoisromain/58cabf43c2977e48ef0804848dee46c3 | |
# and another script to delete the directories created by this script | |
# project-delete.sh: https://gist.github.com/francoisromain/e28069c18ebe8f3244f8e4bf2af6b2cb | |
# Call this file with `bash ./project-create.sh project-name` | |
# - project-name is mandatory | |
# This will creates 4 directories and a git `post-receive` hook. |
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
""" | |
This is a simple proof of concept demonstrating how I like to handle files during tests. | |
Setup | |
----- | |
wget http://hbn.link/1NoLHf0 | |
virtualenv .venv | |
source .venv/bin/activate | |
pip install django django-inmemorystorage |
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 random | |
from datetime import datetime, timedelta | |
min_year=1900 | |
max_year=datetime.now().year | |
start = datetime(min_year, 1, 1, 00, 00, 00) | |
years = max_year - min_year+1 | |
end = start + timedelta(days=365 * years) |
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
Title | Author | Genre | Height | Publisher | |
---|---|---|---|---|---|
Fundamentals of Wavelets | Goswami, Jaideva | signal_processing | 228 | Wiley | |
Data Smart | Foreman, John | data_science | 235 | Wiley | |
God Created the Integers | Hawking, Stephen | mathematics | 197 | Penguin | |
Superfreakonomics | Dubner, Stephen | economics | 179 | HarperCollins | |
Orientalism | Said, Edward | history | 197 | Penguin | |
Nature of Statistical Learning Theory, The | Vapnik, Vladimir | data_science | 230 | Springer | |
Integration of the Indian States | Menon, V P | history | 217 | Orient Blackswan | |
Drunkard's Walk, The | Mlodinow, Leonard | science | 197 | Penguin | |
Image Processing & Mathematical Morphology | Shih, Frank | signal_processing | 241 | CRC |
NewerOlder