Skip to content

Instantly share code, notes, and snippets.

@74togo
74togo / FloydSteinberg.html
Last active November 6, 2020 02:51
An example of the Floyd–Steinberg applied to images in Javascript.
<html>
<head>
<title>Dithering Test</title>
</head>
<body>
<canvas></canvas>
<script>
var canvas = document.getElementsByTagName("canvas")[0];
@74togo
74togo / rainbow.js
Last active November 28, 2018 00:20
This rainbows a page. Use a bookmarklet if you want.
(function(){var m = "@-webkit-keyframes super-rainbow { 0% { -webkit-filter:hue-rotate(1deg); } 100% { -webkit-filter:hue-rotate(360deg); } } html { -webkit-animation: super-rainbow 2s linear infinite normal }";
var styletag = document.createElement("style");
styletag.textContent = m;
document.body.appendChild(styletag);
}());
@74togo
74togo / artillery.java
Created January 26, 2013 19:31
Little artillery game
import java.util.*;
import java.lang.Math.*;
import java.text.*;
public class artillery {
private static Random rand = new Random(); // We use this to generate random numbers
public static String input(String s) {
/* input() simplifies the process of asking for input
@74togo
74togo / irc connection trick
Created January 26, 2014 19:49
A trick to autheticate on connection to an IRC server
A trick to autheticate on connection to an IRC server
/connect irc.freenode.net 6667 :<username> <password>
In xchat, this means you put :<username> <password> into the server password box.
@74togo
74togo / 10fast.js
Created August 24, 2013 02:05
A cheat script for 10fastfingers
(function(){
/* Set up */
var input = jQuery("#inputfield");
var space_key = jQuery("#config_input_key").attr("value");
var chars_typed_so_far = 0;
/* Set this as desired */
var desired_WPM = 150;
@74togo
74togo / superselector$$$.js
Last active December 21, 2015 00:58
A super selector for jQuery
/*
Recursively searches the document, and the iframes within it for elements.
Usage: exactly like jQuery() or $()
*/
var $$$ = function(thing, doc) {
var res = $(thing, doc);
$("iframe", doc).each( function(){
res = res.add( $$$(thing, this.contentDocument) );
});
@74togo
74togo / ricerPS1
Last active December 20, 2015 17:28
put this in .bashrc or something
PS1=$'\n\[\e[1;32m\]\xe2\x94\x8c[ \[\e[1;37m\]\u\[\e[32m\]@\[\e[1;37m\]\h\[\e[32m\] ]\xe2\x94\x80\xe2\x94\x80( \[\e[37m\]\w\[\e[32m\] )\n\xe2\x94\x94\xe2\x94\x80[\[\e[0;31m\]>>> \[\e[0m\]'
@74togo
74togo / shooter.py
Created April 7, 2013 06:17
A little example of the aim-bot tracker thing I made. Uses pygame.
import pygame, sys, time, random, math
from pygame.locals import *
# this paragraph is just your standard pygame stuff
pygame.init()
screen_width = 640
screen_height = 480
screen = pygame.display.set_mode((screen_width, screen_height), RESIZABLE, 32)
pygame.display.set_caption("Shooter test")
screen.fill((0, 0, 0))
@74togo
74togo / Recipes
Last active December 14, 2015 21:08
=====================
Frozen Chicken:
=====================
1 Preheat oven to 375.
2 Spray baking dish with non-stick spray.
3 Place frozen chicken breast in dish.
4 Top with sauce.
5 Bake for 45 minutes.
6 Options: Add veggies for a one dish meal.
@74togo
74togo / combsort.java
Created January 26, 2013 19:30
Comb Sort Example
import java.util.*;
public class CombSort {
public static void sort(int[] array, int size) {
/*
This function sorts a list in-place using CombSort11.
It works exactly like BubbleSort except that instead of
looking at i and i+1 when iterating, it looks at i and i+gap.
This helps reposition small values stuck at the end of the array.