Skip to content

Instantly share code, notes, and snippets.

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

Oscar Rodríguez mldoscar

🏠
Working from home
View GitHub Profile
@ThinGuy
ThinGuy / add-music.rsc
Created May 4, 2019 18:43
add music to mikrotik switches
/system script
add name="Music: Super Mario Bros" owner=admin policy=read source=":beep frequency=660 length=100ms;\
\n:delay 150ms;\
\n:beep frequency=660 length=100ms;\
\n:delay 300ms;\
\n:beep frequency=660 length=100ms;\
\n:delay 300ms;\
\n:beep frequency=510 length=100ms;\
\n:delay 100ms;\
\n:beep frequency=660 length=100ms;\
Canal 2: http://138.117.4.70:8079/streams/d/Canal-2/playlist.m3u8
Canal 4: http://138.117.4.70:8079/streams/d/Canal-4/playlist.m3u8
Canal 6: http://138.117.4.70:8079/streams/d/Canal-6/playlist.m3u8
Canal 8: http://138.117.4.70:8079/streams/d/Canal-25/playlist.m3u8
Canal 9: http://138.117.4.70:8079/streams/d/Canal-9/playlist.m3u8
Canal 10: http://138.117.4.70:8079/streams/d/Canal-10/playlist.m3u8
Canal 11: http://138.117.4.70:8079/streams/d/Canal-11/playlist.m3u8
Canal 12: http://138.117.4.70:8079/streams/d/Canal-12/playlist.m3u8
Canal 13: http://138.117.4.70:8079/streams/d/Canal-13/playlist.m3u8
Canal 15: http://138.117.4.70:8079/streams/d/Canal-15/playlist.m3u8
@stroebs
stroebs / make-chr.sh
Last active March 16, 2024 06:13
Install Mikrotik CHR on a Digital Ocean droplet (Ubuntu 20.04 tested working 29/03/2022)
#!/bin/bash
#
# Digital Ocean Ubuntu 18.04 x64 Droplet with "Regular Intel" CPU.
# Running:
# git clone https://gist.github.com/54fc09734a3911e91eeeb43434f117df.git
# cd 54fc09734a3911e91eeeb43434f117df/
# chmod +x make-chr.sh
# ./make-chr.sh
#
# Once the reboot is done, login with root/CHANGEME and change the password!
@gintsmurans
gintsmurans / jquery.serializeObject.js
Last active February 20, 2021 19:34
Serialize form fields recursively into json type object
// jQuery addons
// Serialize form fields recursively into json type object,
// so for example <input type="text" name="record[type][x]" value="1"> becomes {type: {x: 1}}
var
rbracket = /\[\]$/,
rarrayKeys = /\[(.*?)\]/g,
rarrayKeysPrefix = /^(.*?)\[.*/g,
rCRLF = /\r?\n/g,
rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
@guapolo
guapolo / flexiones_es_mx_spec.rb
Last active March 19, 2023 17:21
Common inflections for Spanish MX for Ruby on Rails. Felxiones más comunes para español México para Ruby on Rails. es-MX
# spec/locale/flexiones_es_mx_spec.rb
require 'rails_helper'
RSpec.describe :flexiones_es_mx do
contexto_singular_plural = {
"Sustantivos y adjetivos terminados en -ch forman el plural añadiendo -es" => [
["sandwich", "sandwiches"],
["maquech", "maqueches"]
@hopsoft
hopsoft / db.rake
Last active April 3, 2024 13:13
Rails rake tasks for dump & restore of PostgreSQL databases
# lib/tasks/db.rake
namespace :db do
desc "Dumps the database to db/APP_NAME.dump"
task :dump => :environment do
cmd = nil
with_config do |app, host, db, user|
cmd = "pg_dump --host #{host} --username #{user} --verbose --clean --no-owner --no-acl --format=c #{db} > #{Rails.root}/db/#{app}.dump"
end
puts cmd