Skip to content

Instantly share code, notes, and snippets.

@kezzardrix
kezzardrix / bug_caused_from_ofEnalbePointSprite.md
Last active October 9, 2017 02:27
Bugs caused from ofEnablePointSprites

#ofEnablePointSprites()使うと色々ハマる

ofEnablePointSprite()の中身は

glEnable(GL_POINT_SPRITE);
glTexEnvi(GL_POINT_SPRITE, GL_COORD_REPLACE, GL_TRUE); ← こいつが元凶くさい
glEnable(GL_VERTEX_PROGRAM_POINT_SIZE);

glTexEnvi~にGL_POINT_SPRITEを設定するとポイントスプライト用の特殊なテクスチャ座標ができる。 が、これを呼んでるとvaryingがバグることがある。

@jmuspratt
jmuspratt / mediaName
Last active August 24, 2023 14:42
exiftool : rename files in current dir to YYYY-MM-DD-HH-MM-SS-1.ext
# Function for your .zshrc file
# Requirements: install the package manager Homebrew (http://brew.sh), then install exiftool (type brew install exiftool in Terminal.app).
# Renames image and MOV files according to EXIF capture date, using YYYY-MM-DD-HH-MM-SS.ext format.
# Files shot within the same second get copy number added (-1,-2, etc.).
# Video files require a different, so we run exiftool 3 times:
# 1. Exclude MOV files and rename the image files with <CreateDate>.
# 2. Target MOV files and rename them with MediaCreateDate (for iPhone videos).
# 3. Target MOV files and rename them with DateTimeOriginal (for Fuji camera videos).
@jeffcrouse
jeffcrouse / poco_http_post_headers.cpp
Last active February 9, 2023 03:36
Poco HTTPPOST request with headers
#include <Poco/Net/HTTPClientSession.h>
#include <Poco/Net/HTTPRequest.h>
#include <Poco/Net/HTTPResponse.h>
#include <Poco/StreamCopier.h>
#include <Poco/Path.h>
#include <Poco/URI.h>
#include <Poco/Exception.h>
using namespace Poco::Net;
using namespace Poco;
@maxkfranz
maxkfranz / tokyo-railways.json
Created October 27, 2014 17:47
tokyo-railways.json
This file has been truncated, but you can view the full file.
{
"format_version" : "1.0",
"generated_by" : "cytoscape-3.1.1",
"target_cytoscapejs_version" : "~2.1",
"data" : {
"selected" : true,
"__Annotations" : [ "" ],
"shared_name" : "main_islands_japan(1)",
"SUID" : 20760,
"name" : "tokyo_only"
@BloodAxe
BloodAxe / Eigen2CV.h
Created August 16, 2014 19:43
This header file contains code snippet for easy mapping Eigen types to OpenCV and back with minimal overhead.
/**
* @brief Mapping functions from Eigen data types to OpenCV
* @author Eugene Khvedchenya <ekhvedchenya@gmail.com>
* @details This header file contains code snippet for easy mapping Eigen types to OpenCV and back with minimal overhead.
* @more computer-vision.talks.com/articles/mapping-eigen-to-opencv/
* Features:
* - Mapping plain data types with no overhead (read/write access)
* - Mapping expressions via evaluation (read only acess)
*
* Known issues:
@dergachev
dergachev / ubuntu-eol.md
Last active December 7, 2023 22:26
What to do when your ubuntu distro is End-of-Life

Let's say you're using Ubuntu 13.04 (Raring Ringtail, released in April 2013) and it just went End-of-Life on you, because it's supported for only 6 months, and the deprecated packages are taken down after 12 months.

You'll probably figure this out the hard way. When you run sudo apt-get update, it will eventually report these errors:

Ign http://archive.ubuntu.com raring-updates/universe Sources/DiffIndex
Err http://security.ubuntu.com raring-security/main Sources
  404  Not Found [IP: 91.189.91.15 80]
Err http://security.ubuntu.com raring-security/universe Sources
  404  Not Found [IP: 91.189.91.15 80]
@patriciogonzalezvivo
patriciogonzalezvivo / GLSL-Noise.md
Last active May 16, 2024 21:20
GLSL Noise Algorithms

Please consider using http://lygia.xyz instead of copy/pasting this functions. It expand suport for voronoi, voronoise, fbm, noise, worley, noise, derivatives and much more, through simple file dependencies. Take a look to https://github.com/patriciogonzalezvivo/lygia/tree/main/generative

Generic 1,2,3 Noise

float rand(float n){return fract(sin(n) * 43758.5453123);}

float noise(float p){
	float fl = floor(p);
  float fc = fract(p);
@darrenmothersele
darrenmothersele / gist:7597016
Created November 22, 2013 09:06
Sending base64 encoded data via HTTP in C++ using openFrameworks and Poco Net Libraries
// The main openFrameworks include
#include "ofMain.h"
// Poco is included in openFrameworks 0.8.0
#include "Poco/Net/HTTPClientSession.h"
#include "Poco/Net/HTTPRequest.h"
#include "Poco/Net/HTTPResponse.h"
#include "Poco/Base64Encoder.h"
#include "Poco/Net/HTMLForm.h"
#include "Poco/Net/StringPartSource.h"
#include "Poco/StreamCopier.h"
@zeffii
zeffii / frame_change_handler.py
Created September 20, 2012 14:11
python driven animation using frame_change_pre (handler)
import bpy
import math
# for demo it creates a cube if it doesn't exist,
# but this can be any existing named object.
if not 'Cube' in bpy.data.objects:
bpy.ops.mesh.primitive_cube_add()
frames_per_revolution = 120.0
step_size = 2*math.pi / frames_per_revolution
@bobspace
bobspace / css_colors.js
Last active May 17, 2024 03:10
All of the CSS Color names in a big javascript object.
// CSS Color Names
// Compiled by @bobspace.
//
// A javascript object containing all of the color names listed in the CSS Spec.
// This used to be a big array, but the hex values are useful too, so now it's an object.
// If you need the names as an array use Object.keys, but you already knew that!
//
// The full list can be found here: https://www.w3schools.com/cssref/css_colors.asp
// Use it as you please, 'cuz you can't, like, own a color, man.