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 download_all_checked(frm){ | |
// if we got this far, we should try to download | |
// all the checked boxes. | |
for (var i = 0; i < document.frmbook.elements.length; i++) { | |
var e = document.frmbook.elements[i]; | |
if( e.name == 'allbox' ){ | |
continue; | |
} |
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
// Initializing Variables | |
var selection = prompt("Do you choose rock, paper or scissors?"); | |
var PLAYS = ['scissors', 'paper', 'rock']; | |
var mine = PLAYS.indexOf(selection); | |
if(mine < 0) { | |
console.log("Bad play!!"); | |
return; |
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 compare(me, comp) { | |
var plays = ["scissors", "paper", "rock", "lizard", "spock"]; | |
var mine = plays.indexOf(me); | |
var computer = plays.indexOf(comp); | |
if (mine === computer) | |
return "You Tie"; |
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
{% macro form_field(field) -%} | |
{% set with_label = kwargs.pop('with_label', False) %} | |
{% set placeholder = '' %} | |
{% if not with_label %} | |
{% set placeholder = field.label.text %} | |
{% endif %} | |
<div class="control-group {% if field.errors %}error{% endif %}"> | |
{% if with_label %} | |
<label for="{{ field.id }}" class="control-label"> | |
{{ field.label.text }}{% if field.flags.required %} *{% endif %}: |
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 sqlalchemy.ext.declarative import declarative_base | |
from sqlalchemy.sql.functions import coalesce | |
from sqlalchemy.orm import sessionmaker | |
from sqlalchemy import Column, Integer, String, select | |
from sqlalchemy import create_engine | |
from sqlalchemy import func | |
engine = create_engine('sqlite:///:memory:', echo=True) | |
Base = declarative_base() |
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
Object.prototype.handlers = function() { | |
var handlers = $.map($._data(this, 'events'), function(events, name) { | |
var fname = eval("function " + name + "() {}; "+name); | |
return $.map(events, function(event) { | |
var h = new fname(); | |
h["handler"] = event.handler; | |
return h; | |
}) |
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
#!/usr/bin/env sh | |
## Port map and set static address for Natted VM Fusion box | |
## Box must be running and this script needs to be run as sudo | |
## Restart VMware after | |
## | |
## sudo sh fusionportmap.sh | |
VMRUN="/Applications/VMware Fusion.app/Contents/Library/vmrun" | |
VMS=$("${VMRUN}" list | tail -n +2) |
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
<!DOCTYPE html> | |
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--> | |
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]--> | |
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]--> | |
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]--> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
<title>Sort SHit</title> | |
<meta name="description" content=""> |
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 | |
apt-get -y update | |
apt-get install -y awscli | |
RSA_FINGERPRINT=$(ssh-keygen -l -f /etc/ssh/ssh_host_rsa_key.pub) | |
ECDSA_FINGERPRINT=$(ssh-keygen -l -f /etc/ssh/ssh_host_ecdsa_key.pub) | |
export AWS_DEFAULT_REGION=us-east-1 | |
export AWS_ACCESS_KEY_ID=Fillthisin |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
OlderNewer