Skip to content

Instantly share code, notes, and snippets.

View alalonde's full-sized avatar

Alec LaLonde alalonde

View GitHub Profile
@alalonde
alalonde / deleteAllChannels.mjs
Created January 23, 2023 23:41
Delete all channels in stream.io chat
import { StreamChat } from 'stream-chat';
const serverClient = StreamChat.getInstance(
'<api key>',
'<api secret>',
);
(async () => {
while (true) {
let channelIds = [];
@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",
    
@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}",
did:3:kjzl6cwe1jw14bd54usdo8ix7xixt22ebs5z99cvbcip5d9puu0unenqiz0y4js
#!/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");
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)[];
}
<?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>
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]);
@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);
@alalonde
alalonde / gist:2650080
Created May 10, 2012 00:33
Tilestache config
{
"cache": {
"name": "Test"
},
"layers": {
"ww2e": {
"provider": {
"name": "vector",
"driver": "postgis",
"parameters": {