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 flask import Flask, request | |
import sqlite3 | |
import json | |
app = Flask(__name__) | |
@app.route('/get') | |
def get(): | |
conn = sqlite3.connect('my_magic.db') | |
q = request.args.get('q') | |
print(q) |
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 json | |
import requests | |
r = requests.get('http://127.0.0.1:5000/get?q=select * from users limit 2') | |
json_obj = json.dumps(r.json()) | |
jsonfinal = json.loads(json_obj) | |
for mis in jsonfinal: | |
col = [] |
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
[alias] | |
lg1 = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all | |
lg2 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all | |
lg = !"git lg1" |
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
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteRule ^/error100$ 100 [L,R=100] | |
RewriteRule ^/error101$ 101 [L,R=101] | |
RewriteRule ^/error102$ 102 [L,R=102] | |
RewriteRule ^/error200$ 200 [L,R=200] | |
RewriteRule ^/error201$ 201 [L,R=201] | |
RewriteRule ^/error202$ 202 [L,R=202] | |
RewriteRule ^/error203$ 203 [L,R=203] | |
RewriteRule ^/error204$ 204 [L,R=204] |
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
sudo apt-get install wicd-curses | |
sudo systemctl disable dhcpcd | |
sudo /etc/init.d/dhcpcd stop | |
sudo wicd-curses |
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
brew cask install osxfuse | |
brew tap homebrew/fuse | |
brew install ntfs-3g | |
sudo mv /sbin/mount_ntfs /sbin/mount_ntfs.bak | |
sudo ln -s /usr/local/sbin/mount_ntfs /sbin/mount_ntfs |
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
echo 'config.vm.synced_folder ".", "/vagrant", type: "virtualbox"' >> Vagrantfile | |
vagrant plugin install vagrant-vbguest | |
vagrant destroy && vagrant up |
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 flask import Flask | |
from flask import jsonify | |
app = Flask(__name__) | |
@app.route("/") | |
def hello(): | |
return jsonify({'message' : 'Hello!'}) | |
@app.route("/date") | |
def getDate(): | |
import datetime |
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
/// <reference path="angular.d.ts" /> | |
/// <reference path="angular-route.d.ts" /> | |
/// <reference path="angular-sanitize.d.ts" /> | |
/// <reference path="bootstrap.d.ts" /> | |
/// <reference path="moment.d.ts" /> | |
/// <reference path="moment-duration-format.d.ts" /> | |
/// <reference path="d3.d.ts" /> | |
/// <reference path="underscore.d.ts" /> | |
var bosunApp = angular.module('bosunApp', [ | |
'ngRoute', |
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
## BOSUN | |
RewriteRule /alerting/static/js/bosun.js /var/www/html/my-static/js/bosun.js [L] | |
<Location /alerting> | |
AddOutputFilterByType SUBSTITUTE text/html text/plain text/xml text/css text/javascript application/javascript application/json | |
Substitute "s#href=\"/#href=\"/alerting/#ni" | |
Substitute "s#ng-href=\"/#ng-href=\"/alerting/#ni" | |
Substitute "s#src=\"/#src=\"/alerting/#ni" | |
Substitute "s#data-path=\"/#data-path=\"/alerting/#ni" | |
Substitute "s#MYHOST/#MYHOST/alerting/#ni" |
OlderNewer