Skip to content

Instantly share code, notes, and snippets.

View chrisciampoli's full-sized avatar

Christopher Ciampoli chrisciampoli

View GitHub Profile

Retainer Contract for SOFA


Between myself: Christopher Ciampoli

and you: The Society for Financial Awareness

Summary:

I’ll always do my best to fulfill your needs and meet your expectations, but it’s important to have things written down so that we both know what’s what, who should do what and when, and what will happen if something goes wrong. In this contract you won’t find any complicated legal terms or long passages of unreadable text. I’ve no desire to trick you into signing something that you might later regret. What I do want is what’s best for both parties, now and in the future.

java -jar selenium-server-standalone-2.48.2.jar -Dwebdriver.chrome.driver=~/Downads/chromedriver
@chrisciampoli
chrisciampoli / setup_selenium.sh
Created October 20, 2015 23:38 — forked from curtismcmullan/setup_selenium.sh
Setup Selenium Server on Ubuntu 14.04
#!/bin/bash
# Following the guide found at this page
# http://programmingarehard.com/2014/03/17/behat-and-selenium-in-vagrant.html
echo "\r\nUpdating system ...\r\n"
sudo apt-get update
# Create folder to place selenium in
@chrisciampoli
chrisciampoli / removeem
Created April 27, 2015 20:45
Remove KEYS from PHP to JSON
private function fix_keys($array) {
$numberCheck = false;
foreach ($array as $k => $val) {
if (is_array($val)){
$array[$k] = $this->fix_keys($val);
}
if(is_numeric($k)){
$numberCheck = true;
}
}
@chrisciampoli
chrisciampoli / sortem
Created April 22, 2015 23:57
Sort them~
var downloadables = document.getElementsByClassName('download-links');
for (var op = 0;op < downloadables.length;++op) {
var list = downloadables[op];
var items = list.childNodes
console.log(items);
var itemsArr = [];
for (var i in items) {
if (items[i].nodeType == 1) {
function AngleCalc() {
function fromTime(min, hour){
var minPercent = minutesToPercent(min),
hrPercent = hoursToPercent(hour, minPercent),
minDegree = percentageToDegree(minPercent),
hrDegree = percentageToDegree(hrPercent),
smallAngle = smAngle(minDegree, hrDegree),
largeAngle = lgAngle(minDegree, hrDegree);
@chrisciampoli
chrisciampoli / jquery.custom-calendar.js
Last active August 29, 2015 14:11
jQuery Calendar Plugin (Custom Cal)
/**
The basic premise of this plugin is that you start out with a header
which displays the month/week, and the next/prev buttons. You are
then free to setup you own rendering of the actual calendar week
in a div of your choosing. Sample usage as follows:
Your calendar control header: <div id="cal-header"><h4 id="week-title"></h4></div>
Calendar initialize: $('#cal-header').chriscal({
'body': define your calendar body here,
'next_btn': define your next button to change to next week,
@chrisciampoli
chrisciampoli / gist:4ae0f87510a696939593
Last active August 29, 2015 14:10
Custom Calendar
sctr.addModule('calendar', function() {
/**
Creates a 7 day week
@param prev
@param next
TODO: move prev, next into their own methods to update curr
*/
var bindSortable, checkImage, checkWeek, initWeek, processResults, renderWeek, saveSchedule, updatePool;
@chrisciampoli
chrisciampoli / meta.js
Created November 2, 2014 06:09
Get image sizes from meta
function getMeta(url, fn) {
var sizes = {};
$('<img />').attr("src", url).load(function() {
var dims = {
w: this.width,
h: this.height
};
$(this).trigger({
type: "imgLoaded",
height: dims.h,
@chrisciampoli
chrisciampoli / scaled.php
Created October 15, 2014 18:29
Create a scaled image from PHP
/**
* Creates scaled version of source image, optionally cropping.
* Handles scaling and centering in target size properly.
*
* $options = array(
* 'upload_dir' => thumbnail destination directory (required)
* 'thumb_name' => thumbnail filename in destination directory (required)
* 'dst_width' => target image width (required)
* 'dst_height' => target image height (required)
* 'target_format' => format to save to, defaults to source format, one of 'imagejpeg','imagegif','imagepng'