Skip to content

Instantly share code, notes, and snippets.

View isevcik's full-sized avatar

Ivan Sevcik isevcik

View GitHub Profile
jQuery('.members_download a:first-child').each(function(i, e)
{
var _iframe_dl = $('<iframe />')
.attr('src', e.href)
.hide()
.appendTo('body');
}
);
@isevcik
isevcik / sort-shoes.js
Last active April 7, 2016 17:36
Sort Shoes
// ==UserScript==
// @name Sort Shoes
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match http://www.bata.cz/*
// @grant none
// @grant GM_registerMenuCommand
// ==/UserScript==
{
"ignored_packages":
[
"Vintage"
],
"ensure_newline_at_eof_on_save": true,
"trim_trailing_white_space_on_save": true,
}
// Add !important to lines missing it
\;(?<!important\;)$
[
// swap the keybindings for paste and paste_and_indent
{ "keys": ["super+v"], "command": "paste_and_indent" },
{ "keys": ["super+shift+v"], "command": "paste" },
// skip cursor after autocompleted })" with TAB
{ "keys": ["tab"], "command": "move", "args": {"by": "characters", "forward": true}, "context":
[
{ "key": "following_text", "operator": "regex_contains", "operand": "^[)'}\"\\]]", "match_all": true },
{ "key": "auto_complete_visible", "operator": "equal", "operand": false },
@isevcik
isevcik / list.php
Created December 25, 2016 16:21
List directories in parent directory of current PHP file
<?php
if ($handle = opendir('..')) {
while (false !== ($entry = readdir($handle))) {
if ($entry != "." && $entry != "..") {
echo "<a href='http://$entry." . basename(dirname(dirname(__FILE__))) . "'>$entry</a><br>";
}
}
closedir($handle);
}
?>
#!/bin/bash
# Transfering OpenVPN profile (.ovpn file) with all required certificate files into mobile device
# like iPhone or Android can be sometimes tricky. This script will embed all these ca, crt and key files
# into specified .ovpn profile file. Then you can transfer just this .ovpn file into your device.
# Since the .ovpn file will contain the key, it should be kept confidental.
#
# Usage: ./ovpn-append-cert.sh --ca ca.crt --crt client.crt --key client.key client.ovpn
POSITIONAL=()
“Sometimes, the elegant implementation is just a function. Not a method. Not a class. Not a framework. Just a function.”
~ John Carmack
@isevcik
isevcik / led-toggle.lua
Created December 10, 2017 15:57
esp8266 nodeMCU script
return function (connection, req, args)
dofile('httpserver-header.lc')(connection, 200, 'html')
led1 = {}
led1.pin = 0
led1.value = gpio.LOW;
led2 = {}
led2.pin = 4
led2.value = gpio.HIGH
@isevcik
isevcik / scan-ap.lua
Created December 12, 2017 22:33
esp8266 nodeMCU script for scanning available Wifi APs
return function (connection, req, args)
dofile('httpserver-header.lc')(connection, 200, 'html')
function ca(payload) connection:send(payload) end
ca("<script>setTimeout(function(){window.location=window.location}, 4000)</script>")
aplist = aplist or {}
ca("<table>")
ca("<tr>")