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() { | |
$(".selectpicker").on("loaded.bs.select", function(e) { | |
if ($(this).val() > 0) { | |
$(this).selectpicker('setStyle', 'btn-warning', 'add'); | |
} | |
}).on("changed.bs.select", function(e) { | |
if ($(this).val() > 0) { | |
$(this).selectpicker('setStyle', 'btn-warning', 'add'); | |
} else { | |
$(this).selectpicker('setStyle', 'btn-warning', 'remove'); |
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 -*- | |
import re, requests, httplib, urllib, json | |
from flask import Flask, render_template, session, request, jsonify, current_app | |
from flask_wtf import Form | |
from wtforms import Field, StringField, SubmitField | |
from wtforms.validators import DataRequired, Regexp | |
from wtforms.widgets import TextInput, HTMLString |
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 flask import Flask, request, render_template, current_app | |
from flask_wtf import Form | |
from wtforms.validators import DataRequired | |
from wtforms import SelectField, SelectMultipleField, SubmitField | |
app = Flask(__name__) |
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 SetTimeOfDayColors() | |
let g:Favcolorschemes = ["darkblue", "morning", "shine", "evening"] | |
let g:CurrentHour = (strftime("%H") + 0) / 6 | |
if g:colors_scheme !~ g:Favcolorschemes[g:CurrentHour] | |
execute "colorscheme " . g:Favcolorschemes[g:CurrentHour] | |
redraw | |
endif | |
endfunction |
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/sh - | |
# Read a text stream on standard input, and output a list of | |
# the n (default: 25) most frequently occurring words and | |
# their frequency counts, in order of descending counts, on | |
# standard output. | |
# | |
# Usage: | |
# wf [n] | |
tr -cs A-Za-z\' '\n' | # Replace nonletters with newlines |
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 pyPdf | |
from StringIO import StringIO | |
#---------------------------------------------------------------------- | |
def mergePDFs(pdfOne, pdfTwo): | |
""" | |
Merge PDFs | |
""" | |
tmp = StringIO() | |
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
require 'benchmark' | |
require 'bcrypt' | |
password = 'Shh...' | |
amount = 100 | |
Benchmark.bmbm(20) do |run| | |
run.report("Bcrypt(10)") do | |
amount.times do |
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 -*- | |
# Usage: | |
# export gmail_username=xxx | |
# export gmail_password=yyy | |
# ruby gmail.rb | |
require 'rubygems' | |
require 'mail' |