Skip to content

Instantly share code, notes, and snippets.

View evitolins's full-sized avatar
🏠
Working from home

Eriks Vitolins evitolins

🏠
Working from home
View GitHub Profile
// https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent
[
{
name : "target",
type: "EventTarget",
description: "The event target (the topmost target in the DOM tree)."
},
{
name : "type",
type: "DOMString",
@evitolins
evitolins / video2canvas.js
Created June 23, 2015 05:42
HTML5 Video->Canvas
var v = document.getElementsByTagName('video')[0];
var c = document.createElement('canvas');
var ctx = c.getContext('2d');
c.width = v.videoWidth;
c.height = v.videoHeight;
var clock = setInterval(function () {ctx.drawImage(v, 0, 0);}, 0);
document.body.appendChild(c);
@evitolins
evitolins / chromeFix.md
Last active August 29, 2015 14:20
Wacom/Chrome Issues

Enabling WacomWebPlugin in latest Chrome versions

  1. Worked with 5.3.2-2 (mac)

    • somehow Chrome uninstalled the plugin at some point :/
  2. Uninstalled Wacom Plugin

  3. Installed 5.3.6-6 (mac) with no luck in any browser

var addGrid = function(size, cssClass) {
var table = document.createElement('table'),
tr,td;
for(var i=0; i < size; i++) {
tr = document.createElement('tr');
for(var ii=0; ii < size; ii++) {
td = document.createElement('td');
tr.appendChild(td);
}
// Pixel Data
var pixel = 10;
var pixels = [
[0,0,0,0,0,0,0,1,0,0],
[1,0,0,0,0,0,0,0,3,0],
[0,0,1,0,0,0,0,1,0,0],
[0,0,0,0,1,0,0,1,0,0],
[1,1,0,0,0,1,0,0,0,0],
[0,0,0,0,0,2,0,0,1,0],
[2,0,1,0,0,0,0,0,1,0],
/*jslint
browser: true, devel: true, plusplus: true, unparam: true, todo: true, vars: true, white: true, nomen: true
*/
/*global requestAnimationFrame */
(function() {
var requestAnimationFrame =
window.requestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.webkitRequestAnimationFrame ||
var app = (function () {
"use strict";
/*
Game Settings
0 = blank
1 = player 1
2 = player 2
*/
var current_player = 1;
(function(){
/////////////////////////////////
// Viewport
/////////////////////////////////
var vcvs = document.createElement("canvas");
var vctx = vcvs.getContext('2d');
vcvs.width=480;
vcvs.height=480;
document.body.appendChild(vcvs);
@evitolins
evitolins / css_resources.md
Last active August 29, 2015 14:10 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides

@evitolins
evitolins / python_resources.md
Last active August 29, 2015 14:10 — forked from jookyboi/python_resources.md
Python-related modules and guides.

Packages

  • lxml - Pythonic binding for the C libraries libxml2 and libxslt.
  • boto - Python interface to Amazon Web Services
  • Django - Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.
  • Fabric - Library and command-line tool for streamlining the use of SSH for application deployment or systems administration task.
  • PyMongo - Tools for working with MongoDB, and is the recommended way to work with MongoDB from Python.
  • Celery - Task queue to distribute work across threads or machines.
  • pytz - pytz brings the Olson tz database into Python. This library allows accurate and cross platform timezone calculations using Python 2.4 or higher.

Guides