Skip to content

Instantly share code, notes, and snippets.

View koomai's full-sized avatar

Sid koomai

  • Sydney, Australia
View GitHub Profile
@koomai
koomai / maintenance.php
Last active August 29, 2015 14:06
Example: List of allowed IP addresses to bypass Maintenance Mode
<?php
return [
/*
|--------------------------------------------------------------------------
| Allowed IP Addresses
|--------------------------------------------------------------------------
| Include an array of IP addresses or ranges that are allowed access to the app when
| it is in maintenance mode.
@koomai
koomai / helpers.php
Created September 4, 2014 16:10
Helper file with functions to match IP address
<?php
if ( ! function_exists('is_admin_ip'))
{
/**
* Checks whether an IP address exists in a given array of IP addresses
*
* @return boolean
*/
function is_admin_ip($ip)
App::down(function()
{
if ( ! is_admin_ip(Request::getClientIp()))
{
return Response::view('maintenance', [], 503);
}
});
@koomai
koomai / index.html
Created November 26, 2014 05:08 — forked from anonymous/index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
<style id="jsbin-css">
a {
font-family: Arial;
color: white;
text-shadow: 1px 2px 1px #000000;
@koomai
koomai / jQuery.js
Created December 23, 2011 16:14
Javascript: jQuery Open external links in new window
$(document).ready(function() {
$('a[rel="external"]').click( function() {
window.open( $(this).attr('href') );
return false;
});
});
@koomai
koomai / jquery.scrollTop.animate
Created March 18, 2012 14:11
Javascript: jQuery scrollTop animate
//animates to top of page
$('html, body').animate({
scrollTop: $(".selector").offset().top
}, 2000);
@koomai
koomai / global.php
Last active December 16, 2015 14:01
Allow array of IP addresses to bypass Laravel Maintenance Mode
App::down(function()
{
if ( ! in_array(Request::getClientIp(), ['10.0.2.2']))
{
return Response::view('maintenance', [], 503);
}
});
@koomai
koomai / email-client-quirks.md
Last active June 30, 2017 19:40
Email Clients quirks

A list of stupid email client quirks as I discover them

TL;DR - Gmail sucks balls.

  • Outlook ignores display:block on inline elements, e.g. span. Use default block elements like div or p.
  • Outlook 2003/2007 doesn't support background-image. Use a fallback colour and make sure the text is still legible.
  • Gmail supports background-image but ignores background-position. Stupid Gmail.
  • Gmail's mobile app ignores media queries. Yes, a mobile app ignores media queries. Did I mention Gmail is stupid?
  • Gmail clips your email if it thinks it's too long. The file size limit is around 100kb but keep it under 80kb to be safe. Images don't count. Minify your HTML.
@koomai
koomai / leaderboard.json
Created January 8, 2018 04:03
leaderboard
{
"response_type": "in_channel",
"text": "```\nTokens Leaderboard\n--------------------\nSid: 10\nRohan: 10\n```"
}