Skip to content

Instantly share code, notes, and snippets.

View alalonde's full-sized avatar

Alec LaLonde alalonde

View GitHub Profile
@alalonde
alalonde / gist:2240025
Created March 29, 2012 17:08
Concatenate audio files
AudioInputStream audioInputStream = AudioSystem.getAudioInputStream(clipIterator.next());
if(clipIterator.hasNext()) {
AudioInputStream secondInputStream = AudioSystem.getAudioInputStream(clipIterator.next());
SequenceInputStream clipsStream = new SequenceInputStream(audioInputStream, secondInputStream);
if(clipIterator.hasNext()) {
AudioInputStream thirdInputStream = AudioSystem.getAudioInputStream(clipIterator.next());
clipsStream = new SequenceInputStream(clipsStream, thirdInputStream);
audioInputStream = new AudioInputStream(clipsStream, audioInputStream.getFormat(),
audioInputStream.getFrameLength() + secondInputStream.getFrameLength() +
@alalonde
alalonde / gist:2650080
Created May 10, 2012 00:33
Tilestache config
{
"cache": {
"name": "Test"
},
"layers": {
"ww2e": {
"provider": {
"name": "vector",
"driver": "postgis",
"parameters": {
@alalonde
alalonde / TileLayer.TileJSON.js
Created May 10, 2012 23:52 — forked from DGuidi/TileLayer.TileJSON.js
Leaflet TileCanvas -- Using x/y/z rather than bounding box for URLs
L.TileLayer.TileJSON = L.TileLayer.Canvas.extend({
options: {
debug: false
},
tileSize: 256,
initialize: function (options) {
L.Util.setOptions(this, options);
function AttachmentCtrl($scope, $location, $timeout, Docs) {
$(function() {
$('#detail-form-doc').fileupload({
dataType: 'json',
url: '/angular-ib/app/fileupload?id=' + $location.search().id,
add: function(e, data) {
$scope.$apply(function(scope) {
// Turn the FileList object into an Array
for (var i = 0; i < data.files.length; i++) {
$scope.project.files.push(data.files[i]);
<?xml version="1.0" ?>
<RETS ReplyCode="0" ReplyText="Operation Success.">
<METADATA>
<METADATA-LOOKUP_TYPE Resource="Property" Lookup="Status" Version="1.00.00046" Date="2016-09-12T14:21:33Z">
<LookupType>
<MetadataEntryID>101</MetadataEntryID>
<LongValue>A-Active</LongValue>
<ShortValue>A</ShortValue>
<Value>A</Value>
</LookupType>
declare module 'twilio-video' {
// this actually returns a CancelablePromise
export function connect(token: string, options: ConnectOptions): Promise<Room>;
export function createLocalTracks(options?: CreateLocalTracksOptions): Promise<LocalTrack[]>;
export interface ConnectOptions {
name: string;
tracks: (LocalTrack | MediaStreamTrack)[];
}
#!/usr/bin/env npx ts-node --compiler-options {"module":"commonjs"}
import {createDomain} from "../connect";
import {IdbStorageAdapter} from "../../main/storage/idb/";
import {RealTimeModel} from "../../main";
import {OfflineModelDownloadCompletedEvent} from "../../main/model/events/OfflineModelDownloadCompletedEvent";
// tslint:disable-next-line
require("fake-indexeddb/auto");
did:3:kjzl6cwe1jw14bd54usdo8ix7xixt22ebs5z99cvbcip5d9puu0unenqiz0y4js
@alalonde
alalonde / launch.json
Created April 12, 2022 17:35
MetaGame debugging with VSCode
{
"configurations": [
...,
{
"type": "node",
"request": "attach",
"name": "Attach to backend",
"protocol": "inspector",
"port": 4322,
"localRoot": "${workspaceRoot}",
@alalonde
alalonde / README.md
Last active October 13, 2022 00:24
Converting a node.js Typescript monorepo over to ESM modules
  • update package.json of dependent modules (e.g. utils):
      "type": "module",
      "main": "dist/index.mjs",
      "types": "dist/index.d.mts",
    
  • Install new eslint plugins:
      "eslint-plugin-node": "^11.1.0",
      "eslint-import-resolver-typescript": "^3.5.1",