Skip to content

Instantly share code, notes, and snippets.

View vaalentin's full-sized avatar

Vaalentin vaalentin

View GitHub Profile
@vaalentin
vaalentin / package.json
Last active January 27, 2017 10:27
Webpack1 config files
{
"scripts": {
"start": "webpack-dev-server --config webpack.dev.config.js",
"clean": "rm -rf ./dist",
"build": "webpack --config webpack.prod.config.js --progress"
}
}
@vaalentin
vaalentin / readme-template.md
Last active February 16, 2016 13:54
readme template

Title

Description

Motivation

Installation

Instructions

@vaalentin
vaalentin / .ycm_extra_conf.py
Last active October 5, 2018 10:29
c++11 YCM config file
import os
import ycm_core
flags = [
'-Wall',
'-std=c++11',
# ...and the same thing goes for the magic -x option which specifies the
# language that the files to be compiled are written in. This is mostly
# Generate with cmake -G "Unix Makefiles" ..
# Set minimum version
cmake_minimum_required(VERSION 3.4 FATAL_ERROR)
# Project name
project("project name")
# Project entry point
# no need to include headers
@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) {
@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 / 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 / .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/
class Signal<T> {
private _listeners: ((data?: T) => any)[]
constructor() {
this._listeners = []
}
public add(listener: (data?: T) => any) {
const i = this._listeners.indexOf(listener)
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: `