Skip to content

Instantly share code, notes, and snippets.

View ericshortcut's full-sized avatar

Eric ericshortcut

View GitHub Profile
@ericshortcut
ericshortcut / functions.hs
Last active September 12, 2020 02:06
Redecard Haskell intro lecture
texto = "String"
texto2 = ['S','t','r','i','n','g']
texto3 = ['a'..'z']
lista = []
lista2 = [1..10]
lista3 = [1,4..]
import java.awt.AWTException;
import java.awt.MouseInfo;
import java.awt.Point;
import java.awt.PointerInfo;
import java.awt.Robot;
import java.util.Timer;
import java.util.TimerTask;
import java.lang.*;
import java.io.*;
@ericshortcut
ericshortcut / ray-casting.html
Last active September 30, 2019 08:27
ray casting vanilla javascript
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
</head>
<body>
<canvas id="myCanvas" width="640" height="280" style="position: relative; z-index: 0"></canvas>
<canvas id="myCanvas2" width="640" height="280" style="position: relative; z-index: 1"></canvas>
<script>
console.success = (text) => console.log('%c'+text,'background: #0F0; color: #fff; font-size: 30px;border-radius: 5px');
console.fail = (text) => console.log('%c'+text,'background: #F00; color: #fff; font-size: 30px;border-radius: 5px');
function _flatMap(items) {
return items.reduce((acc, val) =>{
let _items = []
if(val instanceof Array){
_items = [ ... acc, ... _flatMap(val)];
}else{
_items = [ ... acc, val];
@ericshortcut
ericshortcut / hosts
Created November 1, 2017 18:16 — forked from consti/hosts
/etc/hosts to block shock sites etc.
# This hosts file is brought to you by Dan Pollock and can be found at
# http://someonewhocares.org/hosts/
# You are free to copy and distribute this file for non-commercial uses,
# as long the original URL and attribution is included.
#<localhost>
127.0.0.1 localhost
127.0.0.1 localhost.localdomain
255.255.255.255 broadcasthost
::1 localhost