Skip to content

Instantly share code, notes, and snippets.

View koomai's full-sized avatar

Sid koomai

  • Sydney, Australia
View GitHub Profile
@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 / PhpStorm Keyboard Shortcuts.md
Last active October 13, 2023 00:11
Frequently Used PhpStorm Keyboard Shortcuts

Note: Some of these shortcuts have been remapped for my own convenience (Preferences->Keymap). These are Mac shortcuts, just use the Windows/Linux equivalent of the Cmd/Option/Ctrl/Del keys.

####Search, Go to, Navigation ####

Cmd + P - Search file

Cmd + Shift + O - Search everywhere

(I swapped the above two recently because I use Cmd + P to search for files most of the time).

@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 / 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 / ksfetch_die
Created April 15, 2015 23:13
Uninstall Google's ksfetch
sudo /Library/Google/GoogleSoftwareUpdate/GoogleSoftwareUpdate.bundle/Contents/Resources/GoogleSoftwareUpdateAgent.app/Contents/Resources/install.py --uninstall