Skip to content

Instantly share code, notes, and snippets.

View gabrielgilini's full-sized avatar
🍻

Gabriel Gilini gabrielgilini

🍻
View GitHub Profile
@gabrielgilini
gabrielgilini / gist:c427e7a699c449068282
Created April 17, 2015 21:31
Fire GA tags based on % of the YT video watched
var player = new YT.Player(container.find('iframe')[0]);
var firedPlay = false;
var progressFired = {25: false, 50: false, 75: false};
player.addEventListener('onStateChange', function (e) {
var duration = player.getDuration();
switch (e.data) {
case YT.PlayerState.PLAYING:
container.data('played', true);
if (!firedPlay) {
#!/bin/bash
for file in *.psd
do
convert "${file}[0]" -flatten -format jpg "$(basename -s .psd -- "$file").jpg"
done
#!/bin/zsh
# VARIABLES
file1=image1.jpg
file2=image2.jpg
file3=image3.jpg
video1="output/video1.mov"
video2="output/video2.mov"
video3="output/video3.mov"
part1=part1.mov
define(['underscore', 'jquery'], function (_, $) {
'use strict';
var Slider = function (wrapperEl, options) {
var $wrapperEl = this.$wrapperEl = $(wrapperEl);
var $listEl = this.$listEl = $wrapperEl.find('ul');
var $items = this.$items = $listEl.children();
options = this.options = $.extend(true, {
animation: {
duration: 600,
ease: 'swing'
$(function () {
if ($("body#careers").length == 0) {
return;
}
var getHash = function ($anchor) {
var hash = $anchor.prop('hash');
if (typeof hash != 'string') {
hash = '#' + $anchor.prop('href').split('#').pop();
}
ManagersController#index
GET /api/v1/managers.json
In:
-
Out:
{
"managers": [
{"id": 1, "first_name": "John", "last_name": "Doe"},
{"id": 2, "first_name": "Jane", "last_name": "Doe"}
ManagersController#index
GET /api/v1/managers.json
In:
-
Out:
{
"managers": [
{"id": 1, "first_name": "John", "last_name": "Doe"},
{"id": 2, "first_name": "Jane", "last_name": "Doe"}
ManagersController#index
GET /api/v1/managers.json
In:
-
Out:
{
"managers": [
{"id": 1, "first_name": "John", "last_name": "Doe"},
{"id": 2, "first_name": "Jane", "last_name": "Doe"}
diff --cc app/concerns/flowable.rb
index 70cc56b,36d5f98..0000000
--- a/app/concerns/flowable.rb
+++ b/app/concerns/flowable.rb
@@@ -161,7 -161,7 +161,11 @@@ module Flowabl
all_patients = all_patients.where(id: patient_ids) if patient_ids.any?
patients_without_warnings = Patient.where("1 = 2") if send_via.empty?
++<<<<<<< HEAD
+ patients_without_warnings ||= Patient.where(provider_id: provider_id).where(conditions.to_a.join(" OR ")).where(filters.keys.join(" AND "), *filters.values)
{"program": {
"id": 42, // When editing this will be set
"settings": {
"name": "Program Example #1",
"authors": "John Doe, Jane Doe",
"description": "This is an example of the JSON generated by the Program Creation Tool canvas",
"parameters_of_interest": ["some param of interest", "other param of interest"],
"status": "draft"
},
"start_question": 1,