Skip to content

Instantly share code, notes, and snippets.

// create the audio context (chrome only for now)
var context = new webkitAudioContext();
var audioBuffer;
var sourceNode;
var analyser;
var javascriptNode;
// get the context from the canvas to draw on
var ctx = $("#canvas").get()[0].getContext("2d");
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<T3DataStructure>
<meta type="array">
<langDisable>1</langDisable>
</meta>
<sheets>
<general>
<ROOT type="array">
<TCEforms>
<sheetTitle>Einstellungen</sheetTitle>
@dmitryd
dmitryd / checkboxes.txt
Created July 10, 2013 08:16
This example shows how to use the 'split' TypoScript function to create a set of checkboxes easily. There are three files total: general code, stdWrap helper and usage example.
temp.checkbox_with_split = COA
temp.checkbox_with_split {
# Define data
10 = LOAD_REGISTER
10 {
# Valid bits in the field
bits = 1,2,3,4,5,6,7
# Field name in the database. Don't move below other registers!
@ichabodcole
ichabodcole / Web Audio API - Sound Fading
Created July 3, 2013 18:40
Reference for fading in and out sounds with the Web Audio API
fadeTo: (value, fadeLength)->
fadeLength = fadeLength || @defaultfadeLength
currentTime = @ctx.currentTime
#time the fade should complete
fadeTime = currentTime + fadeLength
#set the start time
@masterGain.gain.setValueAtTime(@userVolume, currentTime)
@masterGain.gain.linearRampToValueAtTime(value, fadeTime)
fadeOut: (fadeLength)->
<?php
/***************************************************************
* Copyright notice
*
* (c) 2012 Torsten Schrade <Torsten.Schrade@adwmainz.de>
*
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
{namespace cr = Tx_Catalogueraisonee_ViewHelpers}
<f:if condition="{entries}">
<f:then>
<f:for each="{entries}" as="entry" iteration="iterator">
<cr:alphabet string="{entry.title}" length="1" />
<f:if condition="{iterator.isFirst}">
@maddy2101
maddy2101 / gist:5668835
Last active March 12, 2021 12:08
TCA, Model and Fluid Partial to display FAL images as a simple gallery using TYPO3 and Extbase 6.1
SQL:
images int(11) unsigned DEFAULT '0',
=======================================================
TCA
....
'images' => array(
'exclude' => 0,
'label' => 'images',
'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig(
'images',
@doomhz
doomhz / jslogger_console.js
Created May 26, 2013 15:43
Replace the browser console with JSLogger.
if (jslogger) {
if(!window.console) window.console = {};
var methods = ["log", "debug", "warn", "info"];
for(var i=0;i<methods.length;i++){
console[methods[i]] = function(){jslogger.log.apply(jslogger, arguments);};
}
}
@rowild
rowild / css_image_replacement_expl.css
Last active December 16, 2015 23:49
CSS: Image Replacement
/* Text hiding without indent */
.ir {
border: 0;
font: 0/0 a;
text-shadow:none;
color: transparent;
background-color: transparent;
}
@talltyler
talltyler / gist:5345894
Created April 9, 2013 14:01
This code gives the HTML canvas element JavaScript support for letter spacing. Don't confuse letter spacing with kerning http://en.wikipedia.org/wiki/Kerning This code is basically from http://stackoverflow.com/a/15509006
(function(){
var _fillText,
__slice = [].slice;
_fillText = CanvasRenderingContext2D.prototype.fillText;
CanvasRenderingContext2D.prototype.fillText = function() {
var args, offset, previousLetter, str, x, y,
_this = this;