- bootstrap with typeahead
- jquery
This will use bootstrap with typeahead to create an autocomplete search.
| class LocShortener | |
| @@shortening_file = 'shortening.yaml' | |
| @@shortenings = {} | |
| yamlstr = File.read(@@shortening_file) | |
| YAML.load(yamlstr).each {|k,v| @@shortenings[Regexp.new(k,Regexp::IGNORECASE)] = v} | |
| class << self | |
| def shortenings | |
| @@shortenings |
| #!/bin/bash | |
| unload() { | |
| kextstat | grep "org.virtualbox.kext.VBoxUSB" > /dev/null 2>&1 && sudo kextunload -b org.virtualbox.kext.VBoxUSB | |
| kextstat | grep "org.virtualbox.kext.VBoxNetFlt" > /dev/null 2>&1 && sudo kextunload -b org.virtualbox.kext.VBoxNetFlt | |
| kextstat | grep "org.virtualbox.kext.VBoxNetAdp" > /dev/null 2>&1 && sudo kextunload -b org.virtualbox.kext.VBoxNetAdp | |
| kextstat | grep "org.virtualbox.kext.VBoxDrv" > /dev/null 2>&1 && sudo kextunload -b org.virtualbox.kext.VBoxDrv | |
| } | |
| load() { |
| #!/usr/bin/env ruby | |
| # very simple csv to xml convert, targeted for ruby 2.0 + | |
| # depends on activesupport 4 gem which add #to_xml method to hash and array | |
| require 'csv' | |
| require "active_support/core_ext" | |
| if ARGV.length < 1 || ARGV[0] == "-h" | |
| puts "usage : ruby csv2xml.rb myfile.csv > myfile.xml" |
| #!/usr/bin/env python | |
| """dbf2csv.py | |
| DRAFT 4/14/2015 PS Bills, ICER | |
| example python code to read DBF and write to standard CSV. | |
| Requires dbfread python package installed ( http://dbfread.readthedocs.org ) | |
| and Python 2.7 or greater | |
| Example usage : | |
| python dbconvert.py MYFILE.DBF |
| #!/usr/bin/env python | |
| import numpy | |
| import sys | |
| import timeit | |
| try: | |
| import numpy.core._dotblas | |
| print( 'FAST BLAS') | |
| except ImportError: | |
| print( 'slow blas') |
| #!/bin/bash | |
| # examine all files names in current directory and emit a 'mv' command to rename | |
| # if the filename has non alphanumeric in it, other than dot or underscore | |
| # first loop all files, could use find for this, since loop isn'te recursive | |
| for f in *.*; do | |
| # if filename has bad chars | |
| if [[ $f =~ [^a-zA-Z0-9_\.] ]]; then |
| # fix names | |
| # toy program that looks for non-windows-friendly file names on an OS X system and emits "mv" commands to rename them. | |
| # checks that files are uniquely named. Does not check for length of file path | |
| # run the mv commands to make the changes | |
| # TEST before using; no guarantees; in Public domain | |
| import re | |
| import os, sys | |
| # | |
| # illegal chars |
| #!/usr/bin/env python | |
| import sys | |
| import urllib2 | |
| from xml.etree import ElementTree as ET | |
| def getforecast(zipcode): | |
| """gets current forecast from wunderground""" | |
| url='http://api.wunderground.com/auto/wui/geo/ForecastXML/index.xml?query={}' | |
| forecastxml = urllib2.urlopen(url.format(zipcode)).read() |