Skip to content

Instantly share code, notes, and snippets.

'QBASIC GORILLAS 2.2
'Version 1.0 (c)1990 Microsoft Corp and/or IBM Corp
'Version 2.2 (c)1997-2007 Daniel Beardsmore
'See http://telcontar.net/Misc/Gorillas/ for more information
'Set default data type to integer for faster game play
DEFINT A-Z
'Sub Declarations
DECLARE SUB RestReal (t#)
@itspluxstahre
itspluxstahre / synchrosubs.sh
Created November 28, 2011 23:37 — forked from anonymous/synchrosubs.sh
Subtitle Synchronizations scripts (for .srt)
#!/bin/bash
#Yannis Dassiras' 2009
if [ $# -lt 3 ];then
alf=`basename $0`;
echo -e "\nUsage:\n\n$alf [filename] [delay] [multiplier]\n\nFor delay only, set multiplier to 1.\n\n";exit 0;
fi
cat "$1"|sed 's/ --> /:/'|gawk -v delay=$2 -v multi=$3 'BEGIN {FS=":"} NF<4 {print $0} NF>4 {gsub(",",".");stime=$1*3600+$2*60+$3;etime=$4*3600+$5*60+$6;nstime=stime*multi+delay;netime=etime*multi+delay;sh=int(nstime/3600);eh=int(netime/3600);sm=int((nstime-sh*3600)/60);em=int((netime-sh*3600)/60);ss=int(1000*(nstime-sh*3600-sm*60))/1000;es=int(1000*(netime-eh*3600-em*60))/1000;if (sh<10) sh="0"sh;if (sm<10) sm="0"sm;if (ss<10) ss="0"ss;if (eh<10) eh="0"eh;if (em<10) em="0"em;if (es<10) es="0"es;if (length(es)<6) es=es"0";if (length(ss)<6) ss=ss"0";$0=sh":"sm":"ss" --> "eh":"em":"es;gsub("\\.",",");print}';exit 0;
@itspluxstahre
itspluxstahre / haxx.txt
Created February 3, 2012 20:17
Clean up old linux kernels
dpkg -l linux-* | awk '/^ii/{ print $2}' | grep -v -e `uname -r | cut -f1,2 -d"-"` | grep -e [0-9] | xargs sudo apt-get -y purge
@itspluxstahre
itspluxstahre / .htaccess
Created February 4, 2012 20:54
Skydda wp-config.php och med .htaccess
<files wp-config.php>
order allow,deny
deny from all
</files>
<files xmlrpc.php>
order allow,deny
deny from all
/// HACK TO WORKAROUND A BUG IN WORDPRESS
function yogasutra_fix_get_home_path() {
if ( !function_exists('get_home_path') && !is_admin()) :
function get_home_path() {
$home = get_option( 'home' );
$siteurl = get_option( 'siteurl' );
if ( $home != '' && $home != $siteurl ) {
$wp_path_rel_to_home = str_replace($home, '', $siteurl); /* $siteurl - $home */
$pos = strpos($_SERVER["SCRIPT_FILENAME"], $wp_path_rel_to_home);
$home_path = substr($_SERVER["SCRIPT_FILENAME"], 0, $pos);
<?php
/// HACK TO WORKAROUND A BUG IN WORDPRESS
function yogasutra_fix_get_home_path() {
if ( !function_exists('get_home_path') && !is_admin()) :
function get_home_path() {
$home = get_option( 'home' );
$siteurl = get_option( 'siteurl' );
if ( $home != '' && $home != $siteurl ) {
$wp_path_rel_to_home = str_replace($home, '', $siteurl); /* $siteurl - $home */
$pos = strpos($_SERVER["SCRIPT_FILENAME"], $wp_path_rel_to_home);
@itspluxstahre
itspluxstahre / iefix.console.log.js
Last active October 1, 2015 06:57
Fix ie console.* functions
// Hello, my name is Plux and I don't like internet explorer.
// All JavaScript will break because console is not defined properly.
// I just want to send a big thank you to you Microsoft.
// This little snippet will prevent you from having to rewrite every JavaScript that you use
// where you use any of this.
// Notice, you wont get any output from the functions, but atleast it won't break.
// Just include this with a standard script tag on your site, and it will be fixed for you.
if("undefined"===typeof console){var console={};console.log=console.error=console.info=console.debug=console.warn=console.trace=console.dir=console.dirxml=console.group=console.groupEnd=console.time=console.timeEnd=console.assert=console.profile=function(){}};
@itspluxstahre
itspluxstahre / functions.php
Created June 25, 2012 18:00
Snabbt exempel på att regga kategorier på flera posttyper
add_action('init', 'add_categories_to_things');
function add_categories_to_things() {
register_taxonomy_for_object_type('category', 'my_custom_post_type_alfa');
register_taxonomy_for_object_type('category', 'my_custom_post_type_delta');
}
"https://github.com/abrt/satyr"
"https://github.com/allure-framework/allure-core"
"https://github.com/callmenick/css-loaders-spinners-2"
"https://github.com/callmenick/css-loaders-spinners-2/tree/master/js"
"https://github.com/crazed"
"https://github.com/danesparza/Pushover.NET"
"https://github.com/dyaa/Laravel-pushover"
"https://github.com/enkydu/raspi_runner"
"https://github.com/entertailion/Fling/blob/master/README.md"
"https://github.com/erniebrodeur/pushover"
@itspluxstahre
itspluxstahre / IEUseragent
Created May 17, 2016 21:39
User agent for NT 6.1 with Windows 10 upgrade waiting. :)
"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/7.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; BRI/1; MAPB; InfoPath.3; .NET4.0C; .NET4.0E; BRI/2; GWX:DOWNLOADED; GWX:RESERVED; GWX:QUALIFIED; Microsoft Outlook 14.0.7169; ms-office; MSOffice 14)" "-