Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@elsassph
elsassph / index.php
Last active February 21, 2023 12:18
Create a VoiceChatAPI room from Slack
<?php
// first create a new voice chat room:
$options = array(
'http' => array(
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
'method' => 'POST',
'content' => http_build_query(array()),
)
@elsassph
elsassph / SkyboxLite.as
Created September 6, 2012 18:21
Sample Away3D Lite Stage3DRenderer
package
{
import away3dlite.containers.View3D;
import away3dlite.core.render.Renderer;
import away3dlite.core.render.Stage3DRenderer;
import away3dlite.events.MouseEvent3D;
import away3dlite.materials.BitmapMaterial;
import away3dlite.primitives.Plane;
import away3dlite.primitives.Skybox6;
import flash.display.Shape;
@elsassph
elsassph / JQ.hx
Created June 29, 2012 05:53
jQuery shorthand for haxe 'using'
class JQ
{
static public inline function select(j:js.Dom.HtmlDom):js.JQuery
{
return new js.JQuery(j);
}
static public inline function query(j:String):js.JQuery
{
return new js.JQuery(j);
@elsassph
elsassph / cmdbash-here.reg
Created March 13, 2012 08:59
Command and Bash prompt here
REGEDIT4
[HKEY_CLASSES_ROOT\Directory\shell\BashHere]
@="Open &Bash prompt here"
[HKEY_CLASSES_ROOT\Directory\shell\BashHere\command]
@="c:\\cygwin\\bin\\bash.exe --login -c \"cd '%1' ; exec /bin/bash -rcfile ~/.bashrc\""
[HKEY_CLASSES_ROOT\Drive\shell\BashHere]
@="Open &Bash prompt here"
@elsassph
elsassph / README.MD
Created February 26, 2012 17:32
Patch for Titanium VideoPlayer requestThumbnailImagesAtTimes

VideoPlayer.requestThumbnailImagesAtTimes(times, flag, callback) is all broken:

  • the callback is required although indicated to be optional in the doc
  • this callback is called once, effectively returning only the first thumbnail.

This feature was re-implementated so that it returns all the thumbnails in one event. All the times/thumbnails are added to the event object as indexed properties:

function thumbnailsCallback(e) { var i = 0; while(e["thumbnail" + i]) {

@elsassph
elsassph / titanium-build.json
Created January 5, 2012 13:38
Sublime Text 2 build file for Titanium
{
"cmd": "/usr/local/bin/titanium.sh run --platform=iphone",
"shell": true,
"selector": "source.js",
"working_dir": "${project_path:${folder}}"
}
@elsassph
elsassph / sublimelinter-settings.json
Created January 5, 2012 13:22
My SublimeLinter's settings
[...]
/*
The minimum delay in seconds (fractional seconds are okay) before
a linter is run when the "sublimelinter" setting is true. This allows
you to have background linting active, but defer the actual linting
until you are idle. When this value is greater than the built in linting delay,
errors are erased when the file is modified, since the assumption is
you don't want to see errors while you type.
*/
@elsassph
elsassph / 10squares.hx.js
Created December 30, 2011 09:49 — forked from xitij2000/10squares.hx.js
haXe code to print squares of first 10 numbers.
Main.main = function() {
js.Lib.document.write(Main.square(10).join(","));
}
Main.square = function(n) {
var result = [];
var _g = 0;
while(_g < n) {
var i = _g++;
result.push(i * i);
}