Skip to content

Instantly share code, notes, and snippets.

View marcosrocha85's full-sized avatar
🤓

Marcos Rocha marcosrocha85

🤓
View GitHub Profile
@stueccles
stueccles / array.verse
Last active June 18, 2024 03:14
A Verse module that adds useful functions to Verse Arrays including Map, Reduce etc.
using { /Verse.org/Random }
Array<public> := module:
# Makes an `array` with only unique elements
(Input:[]t where t:subtype(comparable)).Unique<public>()<transacts>:[]t =
var UniqueArray : []t = array{}
for (Value : Input):
if (UniqueArray.Find[Value] > -1) {}
else:
@marcosrocha85
marcosrocha85 / RobotEntertainerMiddleware.php
Created December 5, 2019 02:29
Laravel Robot Entertainer
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Support\Arr;
class RobotEntertainerMiddleware
{
const prohibitedRoutes = [
@lucianomlima
lucianomlima / adb_connect.sh
Created June 5, 2019 17:57
Connect to Android devices with ADB through wi-fi
function adb_connect {
# PORT used to connect. Default: 5555
PORT=${1:-5555}
# IP address from current device connected
IP_ADDRESS=`adb shell ip route | awk '{print $9}'`
echo "ADB connect to $IP_ADDRESS on port $PORT"
# Change connection from usb to tcpip using $PORT
@inooid
inooid / bot.js
Created April 28, 2017 14:36
Twitch bot command cooldown concept
// Warning: Keep in mind that this example has a lot of boilerplate,
// because I want to make sure it's as easy to grasp as possible.
// In a real application you would probably want to wrap the cooldown
// check in a higher order function that easily creates a command and
// checks the cooldowns for you.
// The cooldown manager example
var CooldownManager = {
cooldownTime: 30000, // 30 seconds
store: {
@omnibs
omnibs / 101-rx-samples.md
Last active June 22, 2024 17:22
101 Rx Samples in C#

101 Rx Samples in C#

This was taken from http://rxwiki.wikidot.com/101samples, because I wanted to be able to read it more comfortable with syntax highlighting.

Here's the unedited original, translated to Github Markdown glory:

101 Rx Samples - a work in progress

@oznu
oznu / README.md
Last active June 9, 2024 16:57
How to Bootcamp / Dual Boot Windows 10 on a mid-2011 iMac using USB

How to Install / Bootcamp Windows 10 on a mid-2011 iMac using USB

Apple has released support for bootcamping Windows 10, but only on 2012 Macs and later. Despite not being supported. it is possible to install Windows 10 on earlier iMacs and it seems to run quite well.

IMPORTANT: Unplug all external and physical hard drives (where possible) that you won't be installing to to avoid accidentally erasing them. Also make note of which drives and partitions remain (e.g. System and Storage hard drives), and be super careful to not erase the wrong one.

RECOVERY: If you nuke your machine, restore your time machine backup. Instructions here.

Requirements

@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE