Skip to content

Instantly share code, notes, and snippets.

View Ahrengot's full-sized avatar
🤟

Jens Ahrengot Boddum Ahrengot

🤟
View GitHub Profile
class SliderControl
constructor: (@el) ->
# Setup references
@progbar = @el.find '.progress'
@handle = @el.find '.handle'
@progX = @el.offset().left
@progW = @el.width()
@percent = 0
@progress = 0
@isDragging = no
// Generated by CoffeeScript 1.4.0
(function() {
var SliderControl, introAnimation,
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
SliderControl = (function() {
function SliderControl(el) {
this.el = el;
this.updateProgress = __bind(this.updateProgress, this);
class SliderControl
constructor: (@el) ->
# Setup references
@progbar = @el.find '.progress'
@handle = @el.find '.handle'
@progX = @el.offset().left
@progW = @el.width()
@percent = 0
@progress = 0
@isDragging = no
class SliderControl
constructor: (@el) ->
# Setup references
@progbar = @el.find '.progress'
@handle = @el.find '.handle'
@progX = @el.offset().left
@progW = @el.width()
@percent = 0
@progress = 0
@isDragging = no
define ['backbone', 'underscore', 'plugins/jquery.pep'], (Backbone, _) ->
Backbone.View.extend
className: "element"
initialize: ->
@render()
setSize: (w, h) ->
@el.style.width = @cmToPx(w) + "px"
@el.style.height = @cmToPx(h) + "px"
setImage: (image) ->
@el.style.backgroundImage = "url(#{image})"
@Ahrengot
Ahrengot / get-concert-timeframe.php
Created March 30, 2013 11:44
Takes a UNIX timestamp and returns a string with values like "next_six_months". The returned string can contain multiple (space dilimited) values like "next_weekend next_month next_six_months"
/*-----------------------------------------------------------------------------------*/
/* FIGURE OUT WHEN CONCERTS PLAY
/*-----------------------------------------------------------------------------------*/
function get_concert_timeframe($timestamp) {
// Time filter (next weekend, 30 days, next year etc.)
$time = '';
$next_monday = strtotime("next Monday");
$weekend_start = strtotime("next Friday");
$next_month = strtotime("+1 month")2;
$next_six_months = strtotime("+6 months");
@Ahrengot
Ahrengot / AudioPlayer.js
Last active December 15, 2015 06:59
SoundCloud based audio player
// Generated by CoffeeScript 1.6.1
(function() {
define(['soundcloudAPI'], function(SC) {
var AudioPlayer,
_this = this;
AudioPlayer = (function() {
function AudioPlayer(instruments, playerSelector) {
var _this = this;
@Ahrengot
Ahrengot / event.php
Last active October 23, 2016 00:44
PHP generated .ics calendar download
<?php
header("Content-Type: text/Calendar");
header("Content-Disposition: inline; filename=calendar.ics");
echo "BEGIN:VCALENDAR\n";
echo "VERSION:2.0\n";
echo "PRODID:-//Pumpehuset //NONSGML Pumpehuset//EN\n";
echo "METHOD:REQUEST\n"; // requied by Outlook
echo "BEGIN:VEVENT\n";
echo "UID:".date('Ymd').'T'.date('His')."-".rand()."-pumpehuset.dk\n"; // required by Outlok
echo "DTSTAMP:".date('Ymd').'T'.date('His')."\n"; // required by Outlook
/*-----------------------------------------------------------------------------------*/
/* FIGURE OUT WHEN CONCERTS PLAY
/*-----------------------------------------------------------------------------------*/
function get_concert_timeframe($timestamp) {
// Time filter (next weekend, 30 days, next year etc.)
$time = '';
$next_monday = strtotime("next Monday");
$weekend_start = strtotime("next Friday");
$next_month = strtotime("+1 month");
$next_six_months = strtotime("+6 months");
@Ahrengot
Ahrengot / dabblet.css
Created December 14, 2012 16:44
Untitled
.wrap {
margin: 2em;
width: 100%;
}
a {
font: bold 18px/1.2 sans-serif;
text-decoration: none;
text-align: center;
}