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 February 17, 2025 15:20
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 March 13, 2025 23:16
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

@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