Skip to content

Instantly share code, notes, and snippets.

View kegonomics's full-sized avatar

Loran Lewis kegonomics

  • United States
  • 21:18 (UTC -07:00)
View GitHub Profile
@kegonomics
kegonomics / preferences.sublime-settings
Created November 25, 2020 16:53
My Sublime User Settings - Mac
{
"always_show_minimap_viewport": true,
"animation_enabled": true,
"auto_close_tags": true,
"auto_complete_delay": 50,
"auto_find_in_selection": true,
"auto_indent": true,
"auto_match_enabled": true,
"bold_folder_labels": true,
"caret_extra_bottom": 3,
@kegonomics
kegonomics / MonokaiTerm-Ext.txt
Created July 28, 2015 19:25
Monokai Terminal Extended (Terminal Font Colors)
Black #272822
Red #F92672
Green #A6E22E
Yellow #FD971F
Blue #3E7ED9
Purple #9458FF
Cyan #66D9EF
@kegonomics
kegonomics / getLocation.php
Created February 1, 2014 19:37
Detect location by IP (City, State)
function detect_city($ip) {
$default = 'Hollywood, CA';
if (!is_string($ip) || strlen($ip) < 1 || $ip == '127.0.0.1' || $ip == 'localhost') $ip = '8.8.8.8'; $curlopt_useragent = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6 (.NET CLR 3.5.30729)'; $url = 'http://ipinfodb.com/ip_locator.php?ip=' . urlencode($ip); $ch = curl_init(); $curl_opt = array( CURLOPT_FOLLOWLOCATION => 1,
CURLOPT_HEADER => 0,
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_USERAGENT => $curlopt_useragent,
CURLOPT_URL => $url,
CURLOPT_TIMEOUT => 1,
@kegonomics
kegonomics / CleanUserInput.php
Created February 1, 2014 19:35
PHP functions to clean user input.
<?php
function cleanInput($input) {
$search = array(
'@<script[^>]*?>.*?</script>@si', // Strip out javascript
'@<[\/\!]*?[^<>]*?>@si', // Strip out HTML tags
'@<style[^>]*?>.*?</style>@siU', // Strip style tags properly
'@<![\s\S]*?--[ \t\n\r]*>@' // Strip multi-line comments
);
@kegonomics
kegonomics / css_resources.md
Created February 1, 2014 18:55 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides