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
function go24 () { | |
osascript &>/dev/null <<EOF | |
set commands to {"cd /Users/cristianrojas/www/24mm_react; npm start", "cd /Users/cristianrojas/www/24mm_react; npm test", "cd /Users/cristianrojas/www/24mm_react; git status"} | |
set commands to commands & {"workon api_24mm; sh run.sh", "workon api_24mm; sh celery.sh", "workon api_24mm; sh beat.sh", "workon api_24mm; git status"} | |
tell application "iTerm2" | |
repeat with command in commands | |
tell current window to create tab with default profile | |
tell current session of current window to write text command | |
end repeat | |
end tell |
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
const express = require('express'); | |
const bodyParser = require('body-parser') | |
const path = require('path'); | |
const app = express(); | |
app.use(express.static(path.join(__dirname, 'build'))); | |
app.get('/*', function (req, res) { | |
res.sendFile(path.join(__dirname, 'build-copy', 'index.html')); | |
}); |
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
# Tavtrac API Docs | |
| |
## Login | |
Post user credentials in to Login endpoint to get `auth_token` data. the user is required to be `School Admin`. | |
| |
With the auth_token data, you must send that token in the [HTTP Authorization request header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization) with this sintax | |
| |
**Example** | |
```Javascript | |
"Authorization": "Token {auth_token}" |
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
# We're going to setup a new ssh-key on our server in order to login into it with a .pem file. | |
ssh-keygen -b 1024 -f [key-name] -t rsa | |
# If you don't have an .ssh folder, create it, then add your public key to the list of authorized_keys | |
cat totto.pub >> .ssh/authorized_keys | |
# Then copy the contents of the private file (not .pub) into a .pem file in your computer |
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
#-*- coding: utf-8 -*- | |
from django import forms | |
from django.contrib import admin | |
from django.contrib.flatpages.admin import FlatpageForm, FlatPageAdmin | |
from django.contrib.flatpages.models import FlatPage | |
from ckeditor.widgets import CKEditorWidget | |
class CkeditorFlatpageForm(FlatpageForm): | |
content = forms.CharField(widget=CKEditorWidget()) | |
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
# Type in the console: | |
sudo visudo | |
# Then add the following line to the document and save it | |
# Replace [username] with your username | |
[username] ALL=(ALL) NOPASSWD: ALL |
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
Meanwhile, a workaround is to restart watch when Gruntfile.js is modified. Here is a quick hack to do it. | |
Set the "nospawn" option of watch to true. | |
Add the following task in your Gruntfile.js: | |
grunt.registerTask('exit', 'Just exits.', function() { | |
process.exit(0); | |
}); | |
Put this as a target of your watch: |
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
Meanwhile, a workaround is to restart watch when Gruntfile.js is modified. Here is a quick hack to do it. | |
Set the "nospawn" option of watch to true. | |
Add the following task in your Gruntfile.js: | |
grunt.registerTask('exit', 'Just exits.', function() { | |
process.exit(0); | |
}); | |
Put this as a target of your watch: |
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
# Something in lines of http://stackoverflow.com/questions/348630/how-can-i-download-all-emails-with-attachments-from-gmail | |
# Make sure you have IMAP enabled in your gmail settings. | |
# Right now it won't download same file name twice even if their contents are different. | |
import email | |
import getpass, imaplib | |
import os | |
import sys | |
detach_dir = '.' |
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
to add the postgis template: | |
cd /usr/local/Cellar/postgis/2.0.0/share/postgis/ | |
createdb -E UTF8 template_postgis | |
createlang -d template_postgis plpgsql | |
psql -d postgres -c "UPDATE pg_database SET datistemplate='true' WHERE datname='template_postgis';" | |
psql -d template_postgis -f postgis.sql | |
psql -d template_postgis -f spatial_ref_sys.sql | |
psql -d template_postgis -c "GRANT ALL ON geometry_columns TO PUBLIC;" | |
psql -d template_postgis -c "GRANT ALL ON geography_columns TO PUBLIC;" |
NewerOlder