Skip to content

Instantly share code, notes, and snippets.

@joemaygist
joemaygist / get_internal_ip.sh
Created July 13, 2013 22:21
Get Internal IP
ifconfig en1 | grep inet | grep -v inet6 | awk '{print $2}'
@joemaygist
joemaygist / applescript_spotify_previous_track.applescript
Created April 29, 2013 15:20
AppleScript: spotify_previous_track.applescript
tell application "Spotify"
previous track
end tell
@joemaygist
joemaygist / applescript_spotify_next_track.applescript
Created April 29, 2013 15:18
AppleScript: Spotify Next track
tell application "Spotify"
next track
end tell
@joemaygist
joemaygist / javascript_user_agent_mobile.js
Created April 24, 2013 15:08
Javascript: User agent detection(mobile)
_detectBrowser: function() {
this.isMobile = false;
var mobileVendors = /Android|webOS|iPhone|iPad|iPod|BlackBerry/i;
if (mobileVendors.test(navigator.userAgent)) {
this.isMobile = true;
}
}
@joemaygist
joemaygist / browser_detect.js
Created April 23, 2013 23:02
Javascript: BrowserDetect
var BrowserDetect = {
init: function() {
this.browser = this.searchString(this.dataBrowser) || "Other";
this.version = this.searchVersion(navigator.userAgent) || this.searchVersion(navigator.appVersion) || "Unknown";
},
searchString: function(data) {
for (var i = 0; i < data.length; i++) {
var dataString = data[i].string;
this.versionSearchString = data[i].subString;
@joemaygist
joemaygist / refresh_google_chrome.applescript
Created April 17, 2013 22:48
AppleScript: Refresh Google Chrome
tell application "Google Chrome"
activate
tell application "System Events" to keystroke "r" using command down
end tell
@joemaygist
joemaygist / .bash_profile
Created March 25, 2013 22:14
Shell: My .bash_profile configuration
alias mysql=/usr/local/mysql/bin/mysql
set -o vi
# Folders
alias sites="cd ~/Sites/"
alias desk="cd ~/Desktop/"
alias desk="cd ~/Desktop/"
alias box="cd ~/Dropbox/"
alias docs="cd /Applications/MAMP/htdocs"
alias ..="cd ../"
@joemaygist
joemaygist / .bash_profile
Created March 23, 2013 23:59
My bash_profile
alias mysql=/usr/local/mysql/bin/mysql
set -o vi
# Aliases
alias sites="cd ~/Sites/"
alias desk="cd ~/Desktop/"
alias ..="cd ../"
alias ...="cd ../../"
alias ls='ls -G'
@joemaygist
joemaygist / mb_str_replace.php
Created November 7, 2012 16:26 — forked from sgmurphy/mb_str_replace.php
PHP: mb_str_replace
<?php
/**
* Replace all occurrences of the search string with the replacement string.
*
* @author Sean Murphy <sean@iamseanmurphy.com>
* @copyright Copyright 2012 Sean Murphy. All rights reserved.
* @license http://creativecommons.org/publicdomain/zero/1.0/
* @link http://php.net/manual/function.str-replace.php
*
* @param mixed $search
@joemaygist
joemaygist / html5_template.html
Created October 20, 2012 03:57 — forked from almurdo/html5_template.html
HTML: HTML5 Template
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>untitled</title>
<link rel="stylesheet" href="" rel="stylesheet" type="text/css" media="screen" />
</head>
<body>
<script src=""></script>