Skip to content

Instantly share code, notes, and snippets.

View steezeburger's full-sized avatar

jesse snyder steezeburger

View GitHub Profile
@steezeburger
steezeburger / UploadController.php
Last active August 29, 2015 14:13
Laravel controller for uploading files requiring certain mimetypes
<?php
class UploadController extends BaseController {
public function upload() {
// Getting POST data
$file = array('image' => Input::file('image'));
$rules = array('image' => 'required|mimes:jpeg,bmp,png',);
// doing the validation, passing post data, rules and the messages
@steezeburger
steezeburger / photo_grid.css
Created January 14, 2015 17:27
Photo Grid in CSS
@media screen and (min-width:40em) {
.field-type-image .field-item {
width: 33.33333%;
}
.field-type-image .field-item:nth-child(3n+1) {
clear: left;
}
.field-type-image .field-item:nth-child(odd) {
clear: none;
}
@steezeburger
steezeburger / functions.php
Last active August 29, 2015 14:14
This sets a pages og:image property to the 'featured image' of that page. Facebook uses og:image when displaying images for posts to Facebook.
<?php
// Adding the Open Graph in the Language Attributes
function add_opengraph_doctype( $output ) {
return $output . '
xmlns:og="http://opengraphprotocol.org/schema/"
xmlns:fb="http://www.facebook.com/2008/fbml"';
}
add_filter('language_attributes', 'add_opengraph_doctype');
@steezeburger
steezeburger / splitter.sh
Last active November 10, 2022 09:55
Bash script for splitting large CSV files into 100 lines while keeping the header.
#!/bin/bash
FILENAME=file-to-split.csv
HDR=$(head -1 ${FILENAME})
split -l 100 ${FILENAME} xyz
n=1
for f in xyz*
do
if [[ ${n} -ne 1 ]]; then
echo ${HDR} > part-${n}-${FILENAME}.csv
fi
@steezeburger
steezeburger / svg-group-animations.js
Created November 10, 2015 16:50
Grouped SVG path animations with Snap SVG
var s = Snap('#id-of-svg');
var fly0 = s.group(s.selectAll('.fly0'));
var fly_path0 = s.path("m0,0c-1,0 -1.29289,0.29289 -2,1c-0.70711,0.70711 -2.29289,-0.70711 -3,0c-0.70711,0.70711 -0.29289,1.29289 -1,2c-0.70711,0.70711 -1,1 -1,2c0,1 -1.70711,1.29289 -1,2c0.70711,0.70711 2,0 3,0c1,0 2,0 3,0c1,0 1.29289,-0.29289 2,-1c0.70711,-0.70711 2.29289,0.70711 3,0c0.70711,-0.70711 0.29289,-1.29289 1,-2c0.70711,-0.70711 2,-1 2,-2c0,-1 0.29289,-1.29289 1,-2c0.70711,-0.70711 1.29289,-0.29289 2,-1c0.70711,-0.70711 2,0 3,0c1,0 2,0 3,0c1,0 2,0 2,-1c0,-1 0,-2 0,-3c0,-1 -0.29289,-1.29289 -1,-2c-0.70711,-0.70711 -1,-1 -2,-1c-1,0 -2.29289,0.70711 -3,0c-0.70711,-0.70711 -1,-1 -2,-1c-1,0 -2,0 -3,0c-1,0 -1,1 -2,1c-1,0 -1.29289,0.29289 -2,1c-0.70711,0.70711 0.29289,1.29289 1,2c0.70711,0.70711 0.29289,1.29289 1,2c0.70711,0.70711 0.29289,1.29289 1,2c0.70711,0.70711 2,0 2,1c0,1 0,2 0,3c0,1 0,2 0,3c0,1 -1.07613,0.61731 -2,1c-1.30656,0.5412 -1.29289,1.29289 -2,2c-0.70711,0.70711 -2,0 -2,-1c0,-1 -1,-1 -1,-2c0,-1 0,-2 0,-3l0,-1l0,-1l-1,-1
(function() {
'use strict';
angular
.module('angularStateHeatmap')
.directive('stateHeatmap', stateHeatmap);
function stateHeatmap() {
var directive = {
restrict: 'EA',
@steezeburger
steezeburger / flexbox-helpers.scss
Last active June 14, 2019 08:18
Flexbox Helper Classes written in SCSS
/*
* Custom Flexbox Helper Classes
*/
.flex {
display: flex;
&.cell {
flex: 1;
}
&.equal-sizing {
[{
"id": "16079",
"name": "Shoshone County",
"val": 0
}, {
"id": "33017",
"name": "Strafford County",
"val": 0
}, {
"id": "16073",
import superagent from 'superagent';
import { Promise } from 'bluebird';
import config from '../config';
const methods = ['get', 'post', 'put', 'patch', 'del'];
function formatUrl(path) {
const adjustedPath = path[0] !== '/' ? '/' + path : path;
return config.apiHost + adjustedPath;
}
import System.Environment
import Data.List ((\\))
containsAll :: String -> String
containsAll = (['a' .. 'z'] \\)
main = do
(toTest:args) <- getArgs
print $ containsAll toTest