Skip to content

Instantly share code, notes, and snippets.

View au5ton's full-sized avatar
😶‍🌫️
Working on closed-source stuff

Austin Jackson au5ton

😶‍🌫️
Working on closed-source stuff
View GitHub Profile
import java.util.Arrays;
import java.util.Scanner;
public class Chemistry
{
static Scanner console = new Scanner(System.in);
public static void main(String[] args)
{
for(;;)
Verifying that +au5ton is my openname (Bitcoin username). https://onename.com/au5ton
//**********************************************************************
// function waitfor - Wait until a condition is met
//
// Used from: http://stackoverflow.com/a/14811679
//
// Needed parameters:
// test: function that returns a value
// expectedValue: the value of the test function we are waiting for
// msec: delay between the calls to test
// callback: function to execute when the condition is met
<style>
html {
min-height: 100%;
}
body {
margin: 0px;
padding: 0px;
@au5ton
au5ton / gist:aae2d2747629a0abb65b
Created March 24, 2015 22:57
Dynamic viewport tag
<meta name="viewport" content="width=device-width, initial-scale=1">
@au5ton
au5ton / rainbow.html
Last active August 29, 2015 14:19
ItsLearning Bug
<style type="text/css">
*
{
font-family:"Comic Sans MS",sans-serif;
-webkit-animation:rainbow 2.5s infinite;
animation:rainbow 2.5s infinite;
text-shadow:1px 1px 5px #000
}
@-webkit-keyframes rainbow
{
@au5ton
au5ton / Age.js
Last active March 6, 2024 09:00
Age in decimals
//You can also use this to asses the age of anything, really.
//For example, dynamically display how long your company has been around, when your next appointment is, etc.
var birthday = new Date(1998,10,22); //Change to your birthday (year,month,day)
//Your age in decimals, with complete precision (1000 milliseconds, 60 seconds, 60 minutes, 24 hours, 365 days)
var age = ((new Date() - birthday) / 1000 / 60 / 60 / 24 / 365);
var precision = 1000; //However many zeros is how many places (1000 returns 3 places, 1 returns 0 places)
//With `precision` set to 1000, you would get something like 16.495, and 1 would just be 16
@au5ton
au5ton / boilerplate.html
Created June 2, 2015 04:03
HTML5 boilerplate
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>TITLE</title>
</head>
<body>
<p>Hello, World!</p>
</body>
@au5ton
au5ton / NSPropertyListReader_binary1.m
Created August 8, 2015 01:09
Cocotron vs WinObjC
/* Copyright (c) 2006-2007 Christopher J. W. Lloyd
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFT
public class AlphabeticalComparison {
public static void main(String[] args) {
System.out.println("apple".compareTo("orange")); //Gives back a negative number because "apple" comes before "orange" alphabetically
System.out.println("orange".compareTo("apple")); //Gives back a positive number because "orange" comes after "apple" alphabetically
//Note that .compareTo() doesn't ignore cases. A word with an uppercase character will appear *before* a letter earlier in the alphabet
//(because the alphabet is actually the unicode table)