Skip to content

Instantly share code, notes, and snippets.

@myadzel
myadzel / popup-video.js
Created March 1, 2022 20:04
popup-video.js
(() => {
const getScriptParams = () => {
const scripts = document.getElementsByTagName("script");
const config = JSON.parse(scripts[scripts.length - 1].innerHTML);
return config;
};
const lastLimePlayedLocalStorageKey = "__lastTimePlayed";
@myadzel
myadzel / SSL-certs-OSX.md
Created July 30, 2020 06:50 — forked from croxton/SSL-certs-OSX.md
Generate ssl certificates with Subject Alt Names

Generate ssl certificates with Subject Alt Names on OSX

Open ssl.conf in a text editor.

Edit the domain(s) listed under the [alt_names] section so that they match the local domain name you want to use for your project, e.g.

DNS.1   = my-project.dev

Additional FQDNs can be added if required:

@myadzel
myadzel / gist:c1893120c46560d197550c3caf7a5545
Created March 18, 2020 08:18
nginx with TLSv1.2 on Debian 6
cd /tmp
apt-get install build-essential -y
apt-get install g++
wget http://nginx.org/download/nginx-1.11.0.tar.gz && tar zxvf nginx-1.11.0.tar.gz
wget http://www.openssl.org/source/openssl-1.0.2.tar.gz && tar xzvf openssl-1.0.2.tar.gz
@myadzel
myadzel / alphanum.js
Created November 12, 2015 07:58
alphanum.js
/* alphanum.js (C) Brian Huisman
* Based on the Alphanum Algorithm by David Koelle
* The Alphanum Algorithm is discussed at http://www.DaveKoelle.com
*
* Distributed under same license as original
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or any later version.
@myadzel
myadzel / transformiix
Created October 16, 2014 20:18
transformiix:result
<script>
if (document.documentElement.nodeName == "transformiix:result") {
window.addEventListener("DOMContentLoaded", function () {
var outerHTML = document.getElementsByTagName("html")[0].outerHTML;
document.open();
document.write(outerHTML);
document.close();
});
}
@myadzel
myadzel / crontab.sh
Created January 11, 2014 21:55
List of crontab tasks for all users
#!/bin/sh
for user in $(cut -f1 -d: /etc/passwd); do crontab -u $user -l; done
@myadzel
myadzel / wank.php
Created January 10, 2014 21:27 — forked from jippi/wank.php
<?php
function safemode() { // jacked from Syrian Shell
$safe_mode = ini_get("safe_mode");
if (!$safe_mode) {
$safe_mode = 'off';
}
else {
$safe_mode = 'on'; // ...fuck
}
return $safe_mode;
@myadzel
myadzel / gist:6007043
Last active December 19, 2015 19:38
Detection and parsing "accept language" and browser language
(function ($) {
$.ajax({
url: "http://ajaxhttpheaders.appspot.com",
dataType: "jsonp",
success: function (headers) {
language = headers["Accept-Language"];
console.log({
@myadzel
myadzel / nodejs
Last active July 10, 2023 16:23
Node.js init.d (start-stop-daemon) script
#! /bin/sh
### BEGIN INIT INFO
# Provides: skeleton
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Example initscript
# Description: This file should be used to construct scripts to be
# placed in /etc/init.d.