Skip to content

Instantly share code, notes, and snippets.

@jvcleave
jvcleave / eglinfo
Last active December 7, 2023 15:16
Raspberry Pi GL extensions
source
http://pastebin.com/raw.php?i=Vnje5sEe
gcc -o eglinfo eglinfo.c -lEGL -lGLESv2 -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -L/opt/vc/lib
EGL
Vendor: Broadcom
Version: 1.4
Client APIs: OpenGL_ES OpenVG
@joshbernfeld
joshbernfeld / CMTime+Codable.swift
Created January 11, 2018 05:07
Swift encoding/decoding support for CMTime
extension CMTime: Codable {
public init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
self.value = try container.decode(CMTimeValue.self, forKey: .value)
self.timescale = try container.decode(CMTimeScale.self, forKey: .timescale)
self.flags = CMTimeFlags(rawValue: try container.decode(UInt32.self, forKey: .flags))
self.epoch = try container.decode(CMTimeEpoch.self, forKey: .epoch)
}
@genekogan
genekogan / _Instructions.md
Last active March 5, 2021 13:10
instructions for generating a style transfer animation from a video

Instructions for making a Neural-Style movie

The following instructions are for creating your own animations using the style transfer technique described by Gatys, Ecker, and Bethge, and implemented by Justin Johnson. To see an example of such an animation, see this video of Alice in Wonderland re-styled by 17 paintings.

Setting up the environment

The easiest way to set up the environment is to simply load Samim's a pre-built Terminal.com snap or use another cloud service like Amazon EC2. Unfortunately the g2.2xlarge GPU instances cost $0.99 per hour, and depending on parameters selected, it may take 10-15 minutes to produce a 512px-wide image, so it can cost $2-3 to generate 1 sec of video at 12fps.

If you do load the

@bakercp
bakercp / Install
Created July 21, 2014 20:25
openFrameworks on the UDOO Udoobuntu 1.0
To Install:
- Download 0.8.3 or use the 0.8.3 tag on master.
- Install dependencies.
- Copy config.linuxarmv7l.udoo.mk into $OF_ROOT/libs/openFrameworksCompiled/project/linuxarmv7l
- Go to example project.
To Prep:
$ export MAKEFLAGS="-j4 -s PLATFORM_VARIANT=udoo"
@roxlu
roxlu / SSLBuffer.cpp
Created November 2, 2012 11:38
libuv + openssl + SSLBuffer
#include "SSLBuffer.h"
SSLBuffer::SSLBuffer()
:ssl(NULL)
,read_bio(NULL)
,write_bio(NULL)
,write_to_socket_callback(NULL)
,write_to_socket_callback_data(NULL)
,read_decrypted_callback(NULL)
,read_decrypted_callback_data(NULL)
@jasny
jasny / bootstrap-em.less
Last active January 5, 2020 15:36
Use em or rem font-size in Bootstrap 3
/**
* Use em or rem font-size in Bootstrap 3
*/
@font-size-root: 14px;
@font-unit: 0rem; // Pick em or rem here
// Convert all variables to em
function themename_menu_link(&$variables) {
$element = $variables['element'];
$sub_menu = '';
$element['#attributes']['data-menu-parent'] = $element['#original_link']['menu_name'] . '-' . $element['#original_link']['depth'];
if ($element['#below']) {
$sub_menu = drupal_render($element['#below']);
}
@jvcleave
jvcleave / build_cross_gcc.sh
Last active November 1, 2019 07:18
Stretch build
#! /bin/bash
set -e
trap 'previous_command=$this_command; this_command=$BASH_COMMAND' DEBUG
trap 'echo FAILED COMMAND: $previous_command' EXIT
#-------------------------------------------------------------------------------------------
# This script will download packages for, configure, build and install a GCC cross-compiler.
# Customize the variables (INSTALL_PATH, TARGET, etc.) to your liking before running.
# If you get an error and need to resume the script from some point in the middle,
# just delete/comment the preceding lines before running it again.
@mortennobel
mortennobel / GLError.cpp
Last active September 27, 2018 07:14
Simple error check of open gl (write readable error description to cerr stream including file name and line number)
#include "GLError.h"
#include <iostream>
#include <string>
#ifdef WIN32
# include <GL/glew.h>
#elif __APPLE__
# include <OpenGL/gl3.h>
#else
# include <GL3/gl3.h>
@roxlu
roxlu / PointCloudCompile.sh
Created July 8, 2012 10:40
Pointcloud PCL, compile script
#!/bin/sh
# PCL version 1.5.1
# Boost 1.49
# Eigen 6e7488e20373
# Flann 1.7.1
# QHull 2012.1
# VTK 5.10.0
d=${PWD}
bd=${PWD}/build