Skip to content

Instantly share code, notes, and snippets.

Radosław Mejer radmen

Block or report user

Report or block radmen

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@radmen
radmen / 10-nordvpn.sh
Created Apr 30, 2019
NordVPN + Docker
View 10-nordvpn.sh
#!/usr/bin/env bash
INTERFACE=$1
STATUS=$2
# Make sure we're always getting the standard response strings
LANG='C'
case "${INTERFACE}-${STATUS}" in
tun0-up)
View gist:1954f970ae0e106320144b28e4693511
const deepEql = require('deep-eql')
const input = require('./input.json')
const output = require('./output.json')
const groupByDate = (messages) => messages.reduce(
(carry, message) => {
const copy = Array.from(carry)
const tail = copy.pop();
const groupDate = new Date(message.created_at).getDate();
@radmen
radmen / README.md
Last active Jul 18, 2018
Simple AFK script
View README.md

This simple Bash function will post a short message to #afk Slack channel.

After posting the message it will wait for user interaction on which it will post a message that the user returned.

To run it:

  1. generate legacy token for selected workspace
  2. add it to declaration of TOKEN variable
  3. import somewhere (eg .bash_aliases) function from afk.sh file
@radmen
radmen / env.py
Last active Jun 27, 2018
Python: export selected env variables
View env.py
#!/usr/bin/env python
import argparse
import os
parser = argparse.ArgumentParser(description='Export selected env variables.')
parser.add_argument('name', nargs='+',
help='name of env variable')
@radmen
radmen / gist:22139e20d0bdb2f9d95bb98f093a521d
Last active Mar 6, 2018
Promise/Future Result Maybe object!
View gist:22139e20d0bdb2f9d95bb98f093a521d

The task

  1. get something from a remote site (loadPage())
  2. find specific element (findElement())
  3. grab and parse contents as JSON (extractJson())

stage 1

Easy way: grab page and return result

@radmen
radmen / .bash_aliases
Created Feb 8, 2016
Include `.env` file and connect to MySQL
View .bash_aliases
# connect to mysql using .env file
env-mysql ()
{
yellow=$(tput -Txterm setaf 3)
lt_blue=$(tput -Txterm setaf 6)
reset=$(tput -Txterm sgr0)
if [ -f .env ]; then
. .env
fi
@radmen
radmen / current_route.php
Created Oct 7, 2015
Lument getCurrentRoute()
View current_route.php
<?php
$verbs = 'GET|POST|PUT|DELETE|PATCH';
$routeToRegex = function ($string) use ($verbs) {
$string = preg_replace("/^({$verbs})/", '', $string);
$string = preg_replace('/\{\w+\}/', '\w+', $string);
$string = preg_replace('/\{(\w+):(.+?)\}/', '\2', $string);
return '#^'.$string.'$#';
};
@radmen
radmen / tests.coffee
Created Jun 10, 2014
gulp-order modified test case
View tests.coffee
order = require "../src"
path = require "path"
{ File } = require "gulp-util"
{ expect } = require "chai"
require "mocha"
newFile = (filepath, base) ->
cwd = "/home/johndoe/"
unless base
View keybase.md

Keybase proof

I hereby claim:

  • I am radmen on github.
  • I am radmen (https://keybase.io/radmen) on keybase.
  • I have a public key whose fingerprint is 12A2 C89B 8C68 94E8 3EFB 309A 8D55 6BB6 D7E3 7BE8

To claim this, I am signing this object:

@radmen
radmen / README.md
Last active Dec 16, 2015
Bypass BZWBK masked password input scriptlet
View README.md

Ten skrypt w prosty sposób obchodzi maskowanie hasła dla centrum24.pl (BZWBK).

  • Dodaj do zakładek zawartość scriptlet.js
  • Przejdź na stronę logowania - centrum24.pl
  • Wpisz numer NIK, wciśnij Dalej
  • Uruchom skryptozakładkę
  • Pod polem do wpisania PINu pojawi się nowy textbox - wpisz w nim swój pin i wciśnij ENTER
  • Twoje hasło powinno zostać wpisane w odpowiednie pola
  • Wciśnij button Dalej
You can’t perform that action at this time.