Skip to content

Instantly share code, notes, and snippets.

Avatar
🦑
🦖

SeanJA SeanJA

🦑
🦖
View GitHub Profile
View barbarbarbarbar.php
<?php
$i = 1;
goto three;
sixteen:
three:
while(true){
goto nine;
}
@SeanJA
SeanJA / gist:7092884
Created Oct 21, 2013
from view-source:https://www.healthcare.gov/ lines 1538 - 1551
View gist:7092884
// What?
if ('en' == 'es') {
langCode = 'es_MX';
var url = window.location.href.replace('cuidadodesalud.gov','healthcare.gov').replace('/es/','/');
$('.span1 a.btn-mini.btn-lang, #header .lang').removeClass('nodisplay').attr('href', url);
}
// What what?
if ('en' == 'en') {
langCode = 'en_US';
if (''.length > 0) {
@SeanJA
SeanJA / form-check.js
Created Aug 22, 2013
check if you are connected and you don't have a dead battery.
View form-check.js
$('.my-form').submit(function(){
var battery = window.navigator.battery.level <= 0.05;
var connectivity = window.navigator.onLine;
var msg = '';
if(!battery){
msg = "you should probably plug in your computer";
}
if(!battery && !connectivity){
msg += ", "
}
View blinky.css
script {
display: block;
-webkit-animation-name: blink;
-webkit-animation-iteration-count: infinite;
-webkit-animation-timing-function: cubic-bezier(1.0,0,0,1.0);
-webkit-animation-duration: 1s;
animation-name: blink;
animation-iteration-count: infinite;
animation-timing-function: cubic-bezier(1.0,0,0,1.0);
animation-duration: 1s;
@SeanJA
SeanJA / mosaic.class.php
Last active Dec 14, 2015
Mosaic image take 2
View mosaic.class.php
<?php
class mosaic {
/**
*
* @var int
*/
private $increment = 0;
/**
*
View mosaic-image.php
<?php
$url = 'horse-meat.jpg';
/**
* Turn an image into a mosaic
* @param string $url Path to the image
* @param int $sharpness Sample every x pixels. The td outputs will be x pixels high and wide
* @param boolean $use_rgba Use rgba instead of hex (probably won't work for a lot of email providers)
* @return string The table that will replicate the image
*/
function mosaic($url, $sharpness = 5, $use_rgba = false) {
@SeanJA
SeanJA / README.md
Last active Oct 21, 2016
Google Pageviews
View README.md

Set Up

You will need Sija's version of the garb gem, so add this line to your Gemfile (you will need git installed for this):

gem 'garb', :git => 'git://github.com/Sija/garb.git'

Then run the gem bundler: bundle install

Set your google username

@SeanJA
SeanJA / corrupted.zip
Last active Dec 12, 2015
Test a zip archive from php
View corrupted.zip
this zip file is not a zip file
@SeanJA
SeanJA / time.php
Created Nov 28, 2012
put the characters in the right places
View time.php
<?php
//made up x start positions... obviously, I think they are a pixel offset?
//days
$text = $interval->format('%D');
imagettftext ($image , $font['size'] , $font['angle'] , 10 , $font['y-offset'] , $font['color'] , $font['file'], $text );
//separator
$text = $interval->format(':');
@SeanJA
SeanJA / GIFEncoder.class.php
Last active Nov 8, 2021
dynamic animated gif clock
View GIFEncoder.class.php
<?php
/*
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Formerly known as:::
:: GIFEncoder Version 2.0 by László Zsidi, http://gifs.hu
::
:: This class is a rewritten 'GifMerge.class.php' version.
::
:: Modification: