Skip to content

Instantly share code, notes, and snippets.

View vaalentin's full-sized avatar

Vaalentin vaalentin

View GitHub Profile
047154e96192c13a351524366fc3497f030653d191114be825f1a5fbf1b756c0ec2b96adbbc37dd955b04c14516a99c24a624dfcaea14345208440c2c82c7f3c8a;evertonstz
@vaalentin
vaalentin / index.d.ts
Created November 10, 2017 06:24
Nano gl ts definitions
declare module 'nanogl' {
type uint = number
type TypedArray = Int8Array | Int16Array | Int32Array
| Uint8Array | Uint8ClampedArray | Uint16Array | Uint32Array
| Float32Array | Float64Array
type Image = HTMLImageElement | HTMLCanvasElement | HTMLVideoElement
class Drawable {
@vaalentin
vaalentin / Buffer.java
Created October 18, 2017 09:36
Java OpenGL classes
package com.breel.gl.utils;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.FloatBuffer;
import java.nio.ShortBuffer;
public class Buffer {
private static final String TAG = Buffer.class.getSimpleName();
package com.example.admin.sound;
import android.Manifest;
import android.content.pm.PackageManager;
import android.os.Build;
import android.support.v4.app.ActivityCompat;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;
import THREE from 'three'
import TrackballControl from 'three.trackball'
import { textureLoader } from 'utils'
const passThroughMaterial = new THREE.RawShaderMaterial({
uniforms: {
uTexture: { type: 't', value: null }
},
vertexShader: `
class Signal<T> {
private _listeners: ((data?: T) => any)[]
constructor() {
this._listeners = []
}
public add(listener: (data?: T) => any) {
const i = this._listeners.indexOf(listener)
@vaalentin
vaalentin / .htaccess
Created April 9, 2017 10:47 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@vaalentin
vaalentin / webpack.config.dev.js
Created December 20, 2016 22:51
Webpack2 (still not working)
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
entry: './src/index.js',
output: {
filename: 'bundle.js'
},
resolve: {
modules: [
@vaalentin
vaalentin / tmux-cheatsheet.markdown
Created March 3, 2016 23:01 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@vaalentin
vaalentin / 2Darray.c
Last active March 2, 2016 04:42
C snippets
// create
char** arr = (char**) malloc(10 * sizeof(char**));
for(int i = 0; i < 10; ++i) {
*(arr + i) = (char*) malloc(sizeof(char*) * 4);
strcpy(*(arr + i), "test");
}
// use
for(int i = 0; i < 10; ++i) {