Skip to content

Instantly share code, notes, and snippets.

View tonymtz's full-sized avatar
💻
Working From a Cafe

tonymtz tonymtz

💻
Working From a Cafe
View GitHub Profile
@tonymtz
tonymtz / ExampleClass.cs
Created January 19, 2017 04:06
EyeTracking.GetGazePoint sample
using Unity.Engine;
using Tobii.EyeTracking;
public class ExampleClass : MonoBehaviour
{
void Update()
{
GazePoint gazePoint = EyeTracking.GetGazePoint();
if (gazePoint.IsValid)
{
@tonymtz
tonymtz / ultimate-ut-cheat-sheet.md
Created March 2, 2017 22:10 — forked from yoavniran/ultimate-ut-cheat-sheet.md
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai and Sinon

The Ultimate Unit Testing Cheat-sheet

For Mocha, Chai and Sinon

using mocha/chai/sinon for node.js unit-tests? check out my utility: mocha-stirrer to easily reuse test components and mock require dependencies


// Insert this next line on Preferences > Sidebar > Customize your theme and share it with others.
#2D363F,#485058,#B20D0F,#FFFFFF,#485058,#FFFFFF,#B20D0F,#B20D0F
// Insert this next line on Preferences > Sidebar > Customize your theme and share it with others.
#616a74,#88929e,#FF4400,#ffffff,#88929E,#ffffff,#FF4400,#FF4400
// Insert this next line on Preferences > Sidebar > Customize your theme and share it with others.
#3863A0,#303030,#3DBE8B,#FFFFFF,#303030,#FFFFFF,#3DBE8B,#3DBE8B
@tonymtz
tonymtz / permutations.js
Created October 19, 2017 01:35
Calculates all permutations for a given array of elements following Heap's Algorithm
// Calculates all permutations for a given array of elements following Heap's Algorithm
// how to use it...
console.log(generatePermutations([1, 2]));
console.log(generatePermutations([1, 2, 3]));
console.log(generatePermutations([1, 2, 3, 4, 5, 6, 7, 8, 9]));
function generatePermutations(inputArray) {
let output = [];
@tonymtz
tonymtz / fill-block.js
Created October 19, 2017 01:38
Fills a block with zeros given the block number, hardcoded for a sudoku grid.
// Fills a block with zeros given the block number, hardcoded for a sudoku grid.
// The "grid" must be a lineal array and must have 81 elements exactly.
// how to use it...
let grid = fillBlock(sudokuStoreMock.grid, 4);
function fillBlock(grid, blockNumber) {
let newGrid = grid.slice(0, grid.length);
blockNumber = blockNumber || 0;
@tonymtz
tonymtz / gist:fce1b7847a4601a15e0cff88624398bb
Last active December 13, 2017 23:34 — forked from jmsalcido/gist:c4530e4eeae9df0a39bad3e3dbe17db6
What to do when your ssh key is deleted from Digital Ocean and you have only SSH access with password.
  1. Digital Ocean console web access. [Important]
  2. cp ~/.ssh/id_rsa.pub ~/key.txt
  3. Dropbox it.
  4. Generate a public share link in dropbox
  5. Get something like this: https://www.dropbox.com/s/{{id}}/file?dl=0
  6. Replace the 0 to 1
  7. Get on Digital Ocean web console
  8. WGET it.
  9. Append it to $HOME/.ssh/authorized_keys cat $HOME/key.txt >> $HOME/.ssh/authorized_keys
  10. be happy
@tonymtz
tonymtz / mejores ofertas steam mexico invierno 2017
Last active December 21, 2017 19:31
mejores ofertas steam mexico invierno 2017
Juego Total Original Descuento Link
----------------------------------------------------
Portal 2 17.99 179.99 90% http://store.steampowered.com/app/620/Portal_2/
Rocket League 107.99 179.99 40% http://store.steampowered.com/app/252950/Rocket_League/
Cuphead 152.99 179.99 15% http://store.steampowered.com/app/268910/Cuphead/
Prison Architect 67.49 269.99 75% http://store.steampowered.com/app/233450/Prison_Architect/
Astroneer 143.99 179.99 20% http://store.steampowered.com/app/361420/ASTRONEER/
Civilization VI 299.50 599.00 50% http://store.steampowered.com/app/289070/Sid_Meiers_Civilization_VI/
Wildlands 599.50 1199.0 50% http://store.steampowered.com/app/460930/Tom_Clancys_Ghost_Recon_Wildlands/
Fractured But Who 599.50 1199.0 50% http://store.steampowered.com/app/488790/South_Park_The_Fractured_But_Whole/
@tonymtz
tonymtz / default.conf
Created March 4, 2018 07:37
Nginx configuration for HTML5 routing
server {
listen 80 default_server;
listen [::]:80 default_server;
root /your/root/path;
index index.html;
server_name you.server.com;