Skip to content

Instantly share code, notes, and snippets.

View scruffyfox's full-sized avatar
🏳️‍🌈
+++

Callum Taylor scruffyfox

🏳️‍🌈
+++
  • UK
View GitHub Profile
@scruffyfox
scruffyfox / stackoverify.rb
Created June 15, 2017 14:31
Stack overflow-ify your code!
#!/usr/bin/ruby
#Usage: stackoverify <input file> <output file (optional)>
file = ARGV[0]
out = ARGV[1] || file + ".so"
replacements = [
"",
" ",
" ",
@scruffyfox
scruffyfox / fuck-the-daily-mail.md
Created June 2, 2017 17:50
Fuck the Daily Mail

Open explorer and go to C:\Windows\System32\drivers\etc

Right click on hosts and click open, select Notepad

Paste the following at the bottom of the file and save

127.0.0.1   dailymail.co.uk
127.0.0.1   www.dailymail.co.uk
127.0.0.1 www.dailymail.com
@scruffyfox
scruffyfox / IntentDataHelper.java
Created December 5, 2016 11:25
Intent data passer
package cube.com.helper;
import java.util.WeakHashMap;
import lombok.Getter;
/**
* Singleton class used for passing large data sets around without having to serialise.
* This class should <b>not</b> reference any kind of context without implicitly destroying
* the object when it is done to prevent Context leaks. Be wary!
[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]][([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((+(!+[]+!+[]+!+[]+[+!+[]]))[(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(+![]+([]
@scruffyfox
scruffyfox / handlebars.js
Created April 20, 2016 08:03
Load handlebars template
// usage: var itemTemplate = Handlebars.getTemplate("templatename");
Handlebars.getTemplate = function(name)
{
if (Handlebars.templates === undefined || Handlebars.templates[name] === undefined)
{
$.ajax({
url : 'templates/' + name + '.hbs',
success : function(data)
{
if (Handlebars.templates === undefined)
// Usage: gcc memoryleak.c -o memoryleak; ./memoryleak
#include <stdio.h>
#include <stdlib.h>
int main (void)
{
for (;;)
{
malloc(1);
@scruffyfox
scruffyfox / 687.sh
Last active April 18, 2016 18:14
Checks every 3 seconds if patch is out
#!/usr/bin/env bash
while [ 1 ]; do
RESP=$(curl -o /dev/null --silent --head --write-out '%{http_code}\n' 'http://www.dota2.com/687')
if [ "$RESP" = 200 ]; then
echo "***** PATCH OUT HYPE ******"
exit
else
echo "not out"
fi
@scruffyfox
scruffyfox / states.java
Created October 9, 2015 08:13
states.java
private void setEmptyState(int state)
{
if (state == -1)
{
recyclerView.setVisibility(View.VISIBLE);
loadingContainer.setVisibility(View.GONE);
emptyContainer.setVisibility(View.GONE);
emptyFeed.setVisibility(View.GONE);
emptyFailed.setVisibility(View.GONE);
feedLocked.setVisibility(View.GONE);
@scruffyfox
scruffyfox / AndroidManifest.xml
Last active September 2, 2015 10:29
Fixing google analytics for GMS 7.5+
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.cube.arc.hzd"
android:versionName="v1.2-DEV"
android:versionCode="3878"
>
<!-- Location permissions -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
@scruffyfox
scruffyfox / colour.java
Created July 27, 2015 11:13
Generate random colour with 0xff alpha
int colour = random.nextInt(0xffffff) + (0xff << 24);