This file contains hidden or 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 binascii import crc32 | |
from app import models, db | |
from os import path | |
import inflect | |
import yaml | |
MAX_ID = 1073741823 # 2 ** 30 -1 | |
inf = inflect.engine() |
This file contains hidden or 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
query = some_model.query.filter_by(a=b) | |
count_q = query.statement.with_only_columns([db.func.count()]).order_by(None) | |
count = query.session.execute(count_q).scalar() | |
return count |
This file contains hidden or 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 cryptography.fernet import Fernet | |
from sqlalchemy.ext.mutable import MutableDict | |
from sqlalchemy.types import TypeDecorator, BINARY | |
secret_key = 'change me!' | |
class EncryptedTypeBase(TypeDecorator): | |
impl = BINARY | |
def process_bind_param(self, value, dialect): |
This file contains hidden or 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 $ = require('jquery'); | |
class Modal { | |
constructor($trigger) { | |
this.trigger = $trigger; | |
this.target = $trigger.data('target'); | |
this.id = this.target.slice(1); | |
if (!$(this.target).length) { |
This file contains hidden or 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
(add-hook 'before-save-hook 'time-stamp) | |
(setq time-stamp-pattern "8/Time-stamp:[ \t]+\\\\?[\"<]+%:y-%02m-%02d %3a %02H:%02M\\\\?[\">]") |
This file contains hidden or 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 requests_oauthlib import OAuth2Session | |
from flask import Flask, request, redirect, session, url_for | |
from flask.json import jsonify | |
import os | |
app = Flask(__name__) | |
# This information is obtained upon registration of a new GitHub | |
client_id = "<your client key>" |
This file contains hidden or 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
sudo apt-get update && apt-get install vim wget build-essential -y | |
sudo apt-get install guile-2.0 guile-2.0-dev hdf5-* -y | |
export LDFLAGS="-L/usr/local/lib -lm" | |
export CPPFLAGS="-I/usr/local/include" | |
export LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH" | |
export PATH=/lib64/mpich/bin:$PATH | |
cd ~ && wget http://www.fftw.org/fftw-3.3.4.tar.gz && tar -zxf fftw-3.3.4.tar.gz | |
cd ~/fftw-3.3.4 && ./configure && make && sudo make install |
This file contains hidden or 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
{ | |
"items": [{ | |
"91B4717C-D8F7-427E-9A7D-9E9D3D9989E8": { | |
"p": { | |
"md": 1455251561.220994, | |
"tt": "testing012 -- testing 0121212" | |
}, | |
"e": "Task2", | |
"t": 1 | |
} |
This file contains hidden or 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
login | |
curl -H "Host: cloud.culturedcode.com" -H "Content-Type: application/json; charset=UTF-8" -H "Proxy-Connection: keep-alive" -H "Accept: */*" -H "User-Agent: ThingsMac/20803501mas (x86_64; OS X 10.11.3; en_US)" -H "Authorization: Password pppppwwwwdddd" -H "Accept-Language: en-us" --compressed https://cloud.culturedcode.com/version/1/account/user%40exmaple.com | |
get key | |
curl -H "Host: cloud.culturedcode.com" -H "Content-Type: application/json; charset=UTF-8" -H "Proxy-Connection: keep-alive" -H "Accept: */*" -H "User-Agent: ThingsMac/20803501mas (x86_64; OS X 10.11.3; en_US)" -H "Authorization: Password pppppwwwwdddd" -H "Accept-Language: en-us" --compressed https://cloud.culturedcode.com/version/1/account/user%40exmaple.com/own-history-keys | |
get index | |
curl -H "Host: cloud.culturedcode.com" -H "Content-Type: application/json; charset=UTF-8" -H "Proxy-Connection: keep-alive" -H "Accept: */*" -H "User-Agent: ThingsMac/20803501mas (x86_64; OS X 10.11.3; en_US)" -H "Accept-Language: en-us" --compressed https: |
This file contains hidden or 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
acl SSL_ports port 443 | |
acl Safe_ports port 80 | |
acl Safe_ports port 21 | |
acl Safe_ports port 443 | |
acl Safe_ports port 70 | |
acl Safe_ports port 210 | |
acl Safe_ports port 1025-65535 | |
acl Safe_ports port 280 | |
acl Safe_ports port 488 | |
acl Safe_ports port 591 |