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
# Compare to https://github.com/entmike/What/blob/master/libs/What.js | |
import http #note, this lib doesn't exist in python, maybe BaseHTTPServer would work here? | |
from urlparse import urlparse | |
print([ | |
"", | |
"o `O o oO ", | |
"O o O OO ", | |
"o O o O oO ", |
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 Copying changed files | |
@xcopy \\webservername\d$\screwturn_wiki h:\screwturn_backup /E /Y /X /K /D | |
pause |
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 | |
DATE=`date +%Y%m%d` | |
if [ "$1" == "" ]; then | |
WORKDIR=~/Board | |
SERVER=prod | |
echo 'Pulling PRODUCTION log' | |
else | |
WORKDIR=~/BoardDev | |
SERVER=dev |
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 ******** STOPPING BOARD SERVICES ******** | |
@rem sc \\productionservername stop board7 | |
@rem sc stop board7 | |
@echo ******** CLONING PLANNING DATABASE FROM PROD TO DEV ******** | |
C: | |
CD \Board\Database | |
rmdir /s /q ".\database_name.dtbx" | |
dir | |
@pause |
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 pyodbc | |
cnxn = pyodbc.connect('DSN=production_rdmbs') | |
cursor = cnxn.cursor() | |
cursor.execute("SELECT [Trigger_Name] \ | |
,[Table_Ready] \ | |
,[Date_Modified] \ | |
FROM triggers_table_name") | |
rows = cursor.fetchall() |
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
$(document).ready -> | |
jobloader.initialize() | |
window.jobloader = | |
pulljobs: (callback) -> | |
$.getJSON '/jobs.json', | |
(data) -> | |
callback data | |
printjobs: (data) -> |
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/ruby | |
# Needed to figure out the daily load on our reporting server. Decided to hit the monthly log file | |
# and see how many lines per day were being written to it. This was a good excuse to test out some | |
# new Ruby learning. | |
logfile = ARGV[0] | |
101.upto(131) do |day| | |
day = day.to_s[1..2] | |
print "April #{day}:\t" |
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
1.upto(100) do |x| | |
return_value = '' | |
return_value << "Fizz" if x.modulo(3).zero? | |
return_value << "Buzz" if x.modulo(5).zero? | |
return_value << x.to_s if return_value.empty? | |
puts "[#{x}]\t#{return_value}" | |
end | |
""" | |
<< Results copied from an irb session >> |
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/ruby | |
require 'date' | |
PATH = "//server_name/and/folder_path/redacted" | |
EXTENSION = 'txt' | |
# Parse out a date from each filename, print per-day line counts | |
Dir["#{PATH}/*.#{EXTENSION}"].each do |log_file| | |
return_value = '' |
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
# See http://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#The_modern_algorithm | |
# written as one-liners because my REPL didn't like multiline functions this morning | |
# tested on CoffeeScript v1.0.1 | |
input = [0 .. 7] | |
swap = (input, x, y) -> [input[x], input[y]] = [input[y], input[x]] | |
rand = (x) -> Math.floor(Math.random() * x) | |
durst = (input) -> swap(input, i, rand(i)) for i in [input.length - 1 .. 1] | |
""" |