Skip to content

Instantly share code, notes, and snippets.

-- When you need to find the submitted datetime of the second interaction submitted by each and every doc in our database
LEFT JOIN (
SELECT *
FROM (
SELECT
ROW_NUMBER() OVER(PARTITION BY [PhysicianID] ORDER BY [WhenSubmitted]) AS ROW,
[PhysicianID],
[WhenSubmitted]
FROM [dbo].[Recording]
) AS tmp
var gulp = require('gulp'),
minify = require('gulp-minify-css'),
rename = require('gulp-rename'),
sass = require('gulp-sass'),
concat = require('gulp-concat'),
sourcemaps = require('gulp-sourcemaps'),
autoprefixer = require('gulp-autoprefixer');
var config = {
publicDir: './src/main/webapp/static'
@chasewoodford
chasewoodford / VendorController.java
Last active November 17, 2015 22:54
Copy to clipboard helper in Java
// Convert Address object to StringBuilder
StringBuilder sb = new StringBuilder();
sb.append(vendorService.getVendorBillingAddress(vendor).getLine1()).append("\r\n");
sb.append(vendorService.getVendorBillingAddress(vendor).getLine2()).append("\r\n");
sb.append(vendorService.getVendorBillingAddress(vendor).getCity()).append("\r\n");
sb.append(vendorService.getVendorBillingAddress(vendor).getPostalCode()).append("\r\n");
sb.append(vendorService.getVendorBillingAddress(vendor).getCountry()).append("\r\n");
// Cast StringBuilder to string, trim it down and remove any empty lines
StringSelection stringSelection = new StringSelection(sb.toString().trim().replaceAll("(?m)^\r?\n", ""));
@chasewoodford
chasewoodford / weight-tracker.php
Last active October 25, 2020 03:42
Populate Google Charts via PHP database query
<html>
<head>
<title>Weight Tracker</title>
</head>
<body>
<?php
$username = "";
$password = "";
$hostname = "";
@chasewoodford
chasewoodford / script.rb
Created August 23, 2014 23:46
Ruby Twitter User Feed Scrapper
# Code from Codecademy - Twitter API course (http://www.codecademy.com/en/tracks/twitter)
require 'rubygems'
require 'oauth'
require 'json'
# Now you will fetch /1.1/statuses/user_timeline.json,
# returns a list of public Tweets from the specified
# account.
baseurl = "https://api.twitter.com"
path = "/1.1/statuses/user_timeline.json"
@chasewoodford
chasewoodford / transcriptShaper
Last active December 30, 2015 04:49
VBscript for MS Word macro to re-shape transcripts that come in as plain text. Assumes speaker codes start each line and have a tab strike between speaker code and body of transcript. Will overwrite any existing file. Possibly useful for creating quick outlines of text formatted not already formatted as an outline.
Sub transcriptShaper()
'
' Verilogue Transcript Shaper Macro
' Author: cwoodford
'
'
'Store the filename off
Dim strName As String
strName = ActiveDocument.Name
@chasewoodford
chasewoodford / _colors.scss
Last active December 26, 2015 00:09
Simple Sass @for loop to build color classes for gradient text. Generated by SassMeister.com.
// ----
// Sass (v3.3.0.rc.1)
// ----
@for $i from 1 through 5 {
.color-#{($i)} {
color: (adjust-hue(#ff0000,($i*10)));
}
}
@chasewoodford
chasewoodford / _grid.scss
Last active December 25, 2015 23:39
Simple Sass @for loop to build grid classes at 5% width intervals. Generated by SassMeister.com.
// ----
// Sass (v3.3.0.rc.1)
// ----
@for $i from 1 through 20 {
.grid-#{($i * 5)} {
width: ($i * 5%);
}
}
@chasewoodford
chasewoodford / gist:6170110
Created August 7, 2013 00:12
Tomeij's Sass media query mixin
$devices: tablet 768px, phone 320px;
@mixin respond-to($respond-to) {
@each $device in $devices {
@if nth($device, 1) == $respond-to {
@media (max-width: nth($device, 2)) {
@content;
}
}
}
@chasewoodford
chasewoodford / watcher.rb
Created October 11, 2012 23:03
Sass multiple directory watcher ruby
#######
# Watches files for changes and runs a command if anything was changed.
#
# Modified from https://gist.github.com/286060
#
# Example:
# ruby watcher.rb **/*.scss "sass --update sass:compiled"
#######
trap('INT') { exit! }