Skip to content

Instantly share code, notes, and snippets.

@dakom
dakom / Hard Noise
Created July 25, 2014 06:52
Shows data as audio and visual
/*Hard Noise
Feel free to use this program as you wish, though if you borrow a
significant peice of code please add a comment giving me credit :)
This program traverses through the directory tree from where it is run
and for each file it finds it shows the data as audio and visual..it
then starts back over at the beginning of the directory tree. During
runtime, the user may press 'b' to break out of the current directory.
It also allows the user to specify a volume level as an argument,
save the images as bitmap files in order as well as specify a
package
{
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.display.Shape;
import flash.events.TimerEvent;
import flash.geom.Matrix;
import flash.utils.Timer;
import starling.display.Image;
ffmpeg -i input.mkv -c:v copy -c:a copy output.mp4
@dakom
dakom / Unity Touch Test
Created November 12, 2014 10:13
Test Unity touch info even if not hitting current collider
//http://answers.unity3d.com/questions/425478/onmousedown-not-firing.html
void Update () {
if (Input.GetMouseButtonDown (0)) { Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit hit; if (Physics.Raycast(ray, out hit)) { Debug.Log ("Name = " + hit.collider.name); Debug.Log ("Tag = " + hit.collider.tag); Debug.Log ("Hit Point = " + hit.point); Debug.Log ("Object position = " + hit.collider.gameObject.transform.position); Debug.Log ("--------------"); } }
}
@dakom
dakom / gist:b9c2faaadbf005e4ccc5
Last active August 29, 2015 14:16
Open a bunch of files named in "list.txt" at once (files should be full paths with newline- opened with notepad++)
@echo off
setlocal enableextensions enabledelayedexpansion
set LIST=
for /f %%x in (list.txt) do (
set LIST=!LIST! "%%x"
)
echo %LIST%
"C:\Program Files (x86)\Notepad++\notepad++" %LIST%
git reset HEAD~3
git add .
git commit -m "README updates"
git push origin master
RESULT:
! [rejected] master -> master (non-fast-forward)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ramda/0.22.1/ramda.min.js"></script>
class extends React.Component {
private canRender: boolean = false;
private latestData: any;
constructor(props) {
super(props);
let nJobs = 0;
let lastRenderTime: number;
props.someObservableThing.listen(data => {
@dakom
dakom / Sodium-Loaders.ts
Last active February 27, 2018 16:51
Sodium loaders (wrapping loader-helpers)
//Copied from https://github.com/dakom/sodium-loaders
import {
loadXhrFactory, LoaderXhr, LoaderXhrRequest, LoaderXhrResponse, LOADER_TYPE_XHR,
loadImageFactory, LoaderImage, LoaderImageRequest, LoaderImageResponse, LOADER_TYPE_IMAGE,
loadTextureFactory, LoaderTexture, LoaderTextureRequest, LoaderTextureResponse, LOADER_TYPE_TEXTURE,
LoaderResponseAny,
LoaderRequestAny,
LoaderCallbackAny,
LoaderAny,