Skip to content

Instantly share code, notes, and snippets.

View xero's full-sized avatar
πŸ’­
πŸ’Ύ

xero harrison xero

πŸ’­
πŸ’Ύ
View GitHub Profile
@xero
xero / icon-box.html
Created March 14, 2013 21:02
creating ie friendly icon boxes with font awesome and css
<!DOCTYPE html>
<html>
<head>
<title>icon testing</title>
<link type="text/css" rel="stylesheet" href="style/css/font-awesome.css" media="screen" />
<style type="text/css">
.icon-box {
color: #fff;
background: #000;
padding: 5px 3px 2px 3px;
@xero
xero / randString.php
Last active December 15, 2015 19:49
generate a random alphanumeric string in php. automatically reseeds the mersenne twister PRNG
<?
/**
* generate random alphanumeric string
*
* @param int $len length of string
* @return string
*/
function randString($len=16) {
$str = "";
$chars = array_merge(range('a', 'z'), range(0, 9), range('A', 'Z'));
@xero
xero / disapprove.php
Last active October 28, 2021 07:03 — forked from dehora/disapprove.scala
php fork
<?php
class ΰ² _ΰ²  extends Exception {
public function __construct($msg, $code=0, Exception $prev=null) {
parent::__construct("ΰ² _ΰ² ", $code, $prev);
}
public function __toString() {
return "ΰ² _ΰ² ";
}
}
?>
@xero
xero / pixelated.css
Created April 24, 2013 16:38
pixelated css class. use it when resizing pixel art on the web.
.pixelated {
image-rendering: -moz-crisp-edges;
image-rendering: -o-crisp-edges;
image-rendering: -webkit-optimize-contrast;
-ms-interpolation-mode: nearest-neighbor;
}
@xero
xero / base64font.php
Created June 5, 2013 16:04
an example of base64 encoding fonts for use on the web. this is just a POC, your base64 encoded data should be cached and saved on the server, not generated at run/request time. so i suppose this is more of a syntax/workflow example.
<html>
<head>
<title>base64 encoded webfonts example</title>
<?php
$file = "webfont.eot";
$handle = fopen($filename, "r");
$data = fread(fopen($file, "r"), filesize($file));
?>
<style>
@font-face {
@xero
xero / backbonejs.txt
Created July 30, 2013 13:38
backbone js ascii art
: X
:: XX
:::: XXXX
:::::: XXXXXX
:::::::: XXXXXXXX
::::::::: XXXXXXXXX
::::::::::: XXXXXXXXXXX
::::::::::::: XXXXXXXXXXXXX
::::::::::::::: XXXXXXXXXXXXXXX
@xero
xero / ajaxBackboneHandlebars.js
Created August 8, 2013 14:03
load a handlebars template via ajax then use it as a backbone view
$.ajax({
url: 'ui/tpl/login.handlebars',
context: this,
cache: true,
success: function(data) {
var tpl = Handlebars.compile(data);
this.$el.html(tpl(this.model.toJSON()));
}
});
@xero
xero / handlebarsjs-ascii.txt
Created August 16, 2013 14:21
handlebarsjs ascii logo - 3 variations
.$DDDDDDI.. ..~DDDDDDO.
=DD888888888DDD. .IDDD888888888DO.
.~DDDDDD. 8DD888OOOOOO8888DDZ..DDD888OOOOO88888DD. .DDDDDO.
.DDDDDDDD$ ~D88O8OOOOOOOOOO888DDDDD8888OOOOOOOOOO888D8 .DDDDDDDD.
?DDDDZ D' ..DD88OOOOOOOOOOOOO8888DDDD888OOOOOOOOOOOOO88DD+ `D DDDNN
NDNDD . .DD888OOOOOOOOOOOO88888DDDDD88888OOOOOOOOOOOOO88DN. . DDDDD
DNNDDD, .8ND88OOOOOOOOOOO888DDDNNNNDNDDDNDDD88OOOOOOOOOOO88DDN. ,NDNDDN
ZDNNNNNNNDDD888OOOOOOO88888DDN? `NNND8888OOOOOOO8888DDNNNNNNDDN
@xero
xero / gitio-colorized.sh
Last active December 21, 2015 09:29
gitio.sh - shell script to convert github.com urls to git.io urls
#!/bin/sh
echo -e "\e[01;33m[repo url]\e[00m"
read repo
echo -e "\e[01;33m[short link]\e[00m"
read link
curl -i http://git.io -F "url=$repo" -F "code=$link"
@xero
xero / screenfetch.sh
Created October 29, 2013 23:47
screenfetch.sh with my custom crunchbang #! ascii logo
#!/bin/bash
#
# screenFetch (v2.4.0)
#
# Script to fetch system and theme settings for screenshots in most mainstream
# Linux distributions.
#
# This script is released under the General Public License (GPL). Though it's open
# source and you are free to do with it as you please, I would appreciate if you would
# send any code modifications/additions upstream to me so that I can include them in