This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local function per (n, steps) | |
steps = steps or 0 | |
if n < 10 then return steps end | |
local m = 1 | |
for d in string.gmatch (tostring (n), ".") do | |
m = m * tonumber (d) | |
end | |
print ("STEP #" .. steps+1 .. ": " .. n .. " -> " .. m) | |
return per (m, steps+1) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name BackToOldReddit | |
// @namespace https://gist.github.com/PotcFdk | |
// @match *://www.reddit.com/* | |
// @grant none | |
// @run-at document-start | |
// ==/UserScript== | |
var currentURL = window.document.location.toString(); | |
if(currentURL.includes("//www")) { | |
var newURL = currentURL.replace("//www","//old"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
:; # This file runs on both Windows and Linux. / (c) PotcFdk, 2018 | |
:<<":GITRESET" | |
echo off | |
cls | |
if not exist .git goto PRESVNRESET | |
:GITRESET | |
:; if [ -d .git ]; then | |
echo Resetting working copy to origin/master... | |
git fetch && git checkout master && git reset --hard origin/master && git clean -xdf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
#if 0 | |
TMPFILE=$(mktemp); | |
tail -n +10 $0 | gcc -march=native -o $TMPFILE -x c -; | |
$TMPFILE "${@:1}"; | |
RETVAL=$? | |
rm $TMPFILE; | |
exit $RETVAL; | |
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
OLDIFS=$IFS | |
ask() { | |
# http://djm.me/ask | |
while true; do | |
if [ "${2:-}" = "Y" ]; then | |
prompt="Y/n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?lua | |
box.header("Cache-Control: no-cache\n") | |
box.header("Content-Type: text/plain; charset=utf-8\n") | |
box.header("Expires: -1\n") | |
box.header("Pragma: no-cache\n\n") | |
dofile ("/usr/www/avm/errors/kids/dkjson.lua") | |
?> | |
<?lua |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while [ true ]; do | |
while read line; do | |
id=$(echo "$line" | grep Location | sed 's/^Location.*\/\/ipfs\.pics\/\([^#]*\).*$/\1/g') | |
if [ -n "$id" ]; then | |
echo -n " - " | |
if grep -Fxq "$id" ipfs-pics-ids.txt; then | |
echo ".. $id" | |
else | |
echo -n "++ " | |
echo "$id" | tee -a ipfs-pics-ids.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
class Class | |
{ | |
public: | |
char c = 'c'; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* pi-goroutines.go | |
* This spams Goroutines to calculate pi. | |
* Not a great approach, I just wanted to play around with Goroutines and channels. | |
* | |
* PotcFdk, 2015 | |
*/ | |
package main | |
import ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TEST_TABLE = {} | |
TEST_TABLE.value = 0xB | |
print (0xA .. " >= " .. TEST_TABLE.value .. ": ", 0xA >= TEST_TABLE.value) | |
if (0xA >= 0xB) then | |
print ("0xA >= 0xB") -- If this prints, your computer is insane. | |
elseif (0xA >= TEST_TABLE.value) then | |
print ("That is numberwang!") -- You have been wangernumbed. | |
end |