Skip to content

Instantly share code, notes, and snippets.

View robinsound's full-sized avatar

robinsound robinsound

  • Tenerife - España
View GitHub Profile
@robinsound
robinsound / gist:5d89b66e2439242d4dfe5914e14590f9
Last active February 2, 2019 13:40 — forked from dignome/gist:b25755e344d0619552da
Mikrotik RouterOS DHCP Lease to Simple Queues
# DHCP Lease to Simple Queues
# 2014 Lonnie Mendez (lmendez@anvilcom.com)
#
# Mikrotik RouterOS v6.9
/ip dhcp-server lease
:foreach x in=[find] do={
# grab variables for use below
:local leaseaddr ([get $x address]."/32")
{
"took": 4,
"_scroll_id": "",
"hits": {
"total": 1,
"max_score": 1,
"hits": [
{
"_score": 1,
"_index": "document",
// Query
query := elastic.NewQueryStringQuery("6888*")
hl := elastic.NewHighlight()
hl = hl.Fields(elastic.NewHighlighterField("*"))
hl = hl.PreTags("<span>").PostTags("</span>")
result, err := client.Search().
Index(indexname).
Highlight(hl).
@robinsound
robinsound / gist:3111101ad8cff7236131
Created March 5, 2016 15:46 — forked from pdincau/gist:08f7b2fac39088c87b75
Things I learned about ExUnit
Run tests:
mix test
Run single test file:
mix test path/to/file
Run single test:
@robinsound
robinsound / encrypt_sample.php
Created February 3, 2016 15:29
php aes-256-cbc required
<?php
// encrypt
$text = json_encode(array(
'user' => 'username',
'first' => 'firstname',
'last' => 'lastname',
'any_data' => '11212 12123312 132 3'
));
$key = 'zebc5adt0y345630gcj483bu3886ybz3';
@robinsound
robinsound / SimpleGemInstaller.nsi
Last active November 3, 2021 01:00
NSIS script for Ruby, Git and DevKit installers. Then install a gem
!include LogicLib.nsh ;IF ELSE
!include "StrContains.nsh"
AutoCloseWindow true
OutFile "SimpleGemInstaller.exe"
;here you can reference to any other ruby version and set you prefer path
;you can use !define for compile time substitution
@robinsound
robinsound / listing_rake_tasks.sh
Created July 2, 2013 21:35
Command rake to tell you all tasks available
# rake -T, --tasks [PATTERN] Display the tasks (matching optional PATTERN) with descriptions, then exit.
rake -T