Skip to content

Instantly share code, notes, and snippets.

@igaln
igaln / bytearray to rmagick to s3
Created April 19, 2011 16:37
saving a bitmap shot from Flash AS3 with RMagick to Sinatra to Heroku to Amazon s3
post "/newtest/:filename/:title" do
image = Magick::Image.from_blob(request.body.read).first
puts image.inspect
@title = params[:title]
@filename = params[:filename]
n = VideoThread.new
n.title = @title
n.created_at = Time.now
n.updated_at = Time.now
n.save
@igaln
igaln / gist:6358682
Created August 27, 2013 20:25
Take a column value of comma delimited strings, compare it to another table ids to retrieve values belonging to each delimeted value, group them back into a comma delimited string, and store them in a column using GROUP_CONCAT
SELECT v2m6q_npg_plants.name, GROUP_CONCAT(v2m6q_npg_plants_seasons.name) as seasons FROM v2m6q_npg_plants, v2m6q_npg_plants_seasons WHERE find_in_set(v2m6q_npg_plants_seasons.id, v2m6q_npg_plants.seasons)>0
GROUP BY name
@igaln
igaln / Grid.cs
Created August 16, 2017 20:09
Procedural Mesh with Perlin noise
using UnityEngine;
[RequireComponent(typeof(MeshFilter), typeof(MeshRenderer))]
public class Grid : MonoBehaviour {
public float xOrg;
public float yOrg;
public float scale = 0.1F;
public int xSize, ySize;
@igaln
igaln / UnityAssetBundleBuilder.cs
Created January 19, 2018 19:27 — forked from tkyaji/UnityAssetBundleBuilder.cs
[Unity] Build Asset Bundle, and upload to AWS-S3
using UnityEngine;
using UnityEngine.Networking;
using UnityEditor;
using System.Collections.Generic;
using System.IO;
using System.Security.Cryptography;
using System.Text;
using System;
@igaln
igaln / gist:6f099a7492686ad41c674d4e6bfdfaa2
Created June 26, 2018 15:42
Opencv Processing Camera Filter
import gab.opencv.*;
import processing.video.*;
import java.awt.*;
Capture video;
OpenCV opencv;
PImage img, thresh, blur, adaptive;
void setup() {
@igaln
igaln / ProceduralFloor
Created September 17, 2019 03:48
Unity C# Procedural Floor using Perlin Noise
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ProceduralFloor : MonoBehaviour
{
//prefab to instantiate
public GameObject floorTile;