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
var vol = 20; | |
var t = 0; | |
function playSample(id) { | |
$("#player").stop(); | |
vol = 20; | |
stopSample(); | |
$("#player").setFile("yourfile.mp3"); | |
fadeIn(); |
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
[alias] | |
co = checkout | |
br = branch | |
ci = commit | |
st = status | |
deploytag = "!git tag deploy-`date \"+%Y%m%d%H%M\"` && git push --tags" | |
switch = !legit switch \"$@\" | |
branches = !legit branches | |
sprout = !legit sprout \"$@\" | |
unpublish = !legit unpublish \"$@\" |
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
/* lazyload.js (c) Lorenzo Giuliani | |
* MIT License (http://www.opensource.org/licenses/mit-license.html) | |
* | |
* expects a list of: | |
* `<img src="blank.gif" data-src="my_image.png" width="600" height="400" class="lazy">` | |
*/ | |
!function(window){ | |
var $q = function(q, res){ | |
if (document.querySelectorAll) { |
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
inputs = %w[ | |
CollectionSelectInput | |
DateTimeInput | |
FileInput | |
GroupedCollectionSelectInput | |
NumericInput | |
PasswordInput | |
RangeInput | |
StringInput | |
TextInput |
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
$('.jp-volume-bar').mousedown(function() { | |
var parentOffset = $(this).offset(), | |
width = $(this).width(); | |
$(window).mousemove(function(e) { | |
var x = e.pageX - parentOffset.left, | |
volume = x/width | |
if (volume > 1) { | |
$("#JPID").jPlayer("volume", 1); | |
} else if (volume <= 0) { | |
$("#JPID").jPlayer("mute"); |
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
class PagesController < ApplicationController | |
def contact | |
if request.post? #POST | |
logger.info("I am a POST") | |
@entrant=Entrant.new(entrant_params) | |
@event = Event.find(1) |
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
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button 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
// Handle previous/next navigation | |
$(function() { | |
// Requires jQuery 1.7+ to utilize the new "on" event attachment | |
$("#contentPadding").on("click", "a.prev, a.next", function (event) { | |
$.pjax({ | |
"url": $(this).attr("href"), | |
"fragment": "#contentPadding", | |
"container": "#contentPadding", | |
"complete": function(data) { | |
// Update the className on the BODY tag |
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/local/bin/perl | |
use strict; | |
use warnings; | |
my $pi = 3.1415; | |
my $focDist = 700; #e.g. 10000mm = 1m Focus Distance | |
my $cropFactor = 1.6; | |
my $focLen = 24*1.6; #e.g. 50mm | |
my $actualFocLen = $focLen * $cropFactor; | |
my $fstop = 2.8; # 1, 1.4 , 2 , 2.8, 4, 5.6 |
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
# Author: Pieter Noordhuis | |
# Description: Simple demo to showcase Redis PubSub with EventMachine | |
# | |
# Update 7 Oct 2010: | |
# - This example does *not* appear to work with Chrome >=6.0. Apparently, | |
# the WebSocket protocol implementation in the cramp gem does not work | |
# well with Chrome's (newer) WebSocket implementation. | |
# | |
# Requirements: | |
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby |
OlderNewer