Skip to content

Instantly share code, notes, and snippets.

View wmantly's full-sized avatar

William Mantly wmantly

View GitHub Profile
var SlackBot = require('slackbots');
var todos = {} // object to hold the users lits
var userList = [];
var commands = {
echo: function(data){
return bot.postMessage(data.channel, data.payload, params)
},
add: function(data){
Color_Off='\e[0m' # Text Reset
# Regular Colors
Black='\e[0;30m' # Black
Red='\e[0;31m' # Red
Green='\e[0;32m' # Green
Yellow='\e[0;33m' # Yellow
Blue='\e[0;34m' # Blue
Purple='\e[0;35m' # Purple
Cyan='\e[0;36m' # Cyan
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
# C extensions
*.so
# Distribution / packaging
.Python
env/
def post(self, request):
code = request.POST.get('code').replace('"','\\"')
res = subprocess.getoutput("python3 -c \""+ code + "\"")
context = {'code': code, 'res': res}
return render(request, self.template, context)
@wmantly
wmantly / install.sh
Last active November 15, 2015 03:22
#!/bin/bash
wget -O install.sh 'https://3230d63b5fc54e62148e-c95ac804525aac4b6dba79b00b39d1d3.ssl.cf1.rackcdn.com/Anaconda3-2.4.0-Linux-x86_64.sh';
chmod +x install.sh;
./install.sh;
(function(){
window.bbQuery = function(selector){
//can only select one element by id. Make it able to select ids, classes, and by plain tag name ie. "header"
//and return multiple elements when more than one is selected
//example usage: bbQuery("#lol") - bbQuery(".container") - bbQuery("h1")
// checks to see if there are spaces in the selector, then parse it for multi node matches.
if( /\s/.test(selector) ) return new Element( selectors['multi'](selector) );
// breaks the selector match from string, then set what kind of match to perform.
@wmantly
wmantly / git.sh
Last active August 27, 2015 22:08
# do this when ever u start working on a git repo
git clone https://github....
cd <repo name>
git checkout -b amos
# do this when you have work to add
git add --all :/
git commit -m "what u did here"
git push origin amos
<VirtualHost *:80>
ServerAdmin [email protected]
# ServerName dev.718it.biz
ServerName dev.718it.biz
DocumentRoot /stuff0/dev
<Directory />
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride AuthConfig FileInfo
Require all granted
@classmethod
def all(cls,*args):
c.execute('SELECT * FROM {}' .format(cls.__name__))
complete_data = c.fetchall()
column_name = c.description
names_of_columns = []
for i in range(0,len(column_name)):
col = (column_name[i][0])
names_of_columns.append(col)
rows = []
import sqlite3
class Model:
def __init__( self, **kwargs ):
for key, value in kwargs.items():
setattr( self, key, value )
def __connect():
conn = sqlite3.connect( 'babyorm.db' )