Skip to content

Instantly share code, notes, and snippets.

View werm's full-sized avatar

Craig Wermert werm

View GitHub Profile
@werm
werm / 0_reuse_code.js
Created September 28, 2013 12:10
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@werm
werm / README.md
Last active December 15, 2015 22:00 — forked from ngauthier/README.md
// this is because of http://stackoverflow.com/questions/4398966/how-can-i-hide-select-options-with-javascript-cross-browser/4423543
(function($){
$.fn.extend({detachOptions: function(o) {
var s = this;
return s.each(function(){
var d = s.data('selectOptions') || [];
s.find(o).each(function() {
d.push($(this).detach());
@werm
werm / jsbin-settings.js
Last active December 12, 2015 00:19
My JSBin settings.
settings = {
jshint: true,
editor: {
indentUnit: 2,
smartIndent: true,
tabSize: 2,
indentWithTabs: false,
autoClearEmptyLines: true,
lineWrapping: true,
lineNumbers: true,
@werm
werm / Asset.html
Created December 26, 2012 13:25
Geo Location and Google Maps
<!DOCTYPE html>
<html>
  <head>
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>
  </head>
  <body>
    <div id="content" style="height: 450px"></div>
    <script>
@werm
werm / gist:4380185
Created December 26, 2012 12:55 — forked from zenkay/gist:3237860

Ruby, RVM and Mountain Lion

Key problems

Mountain Lion (10.8) has three main difference compared to Lion (10.7):

  • XCode 4.4 does not install Command Line Tools by default
  • X11 isn't available anymore
  • The installed version of OpenSSL has some bugs

How to work around

@werm
werm / file1.php
Created December 6, 2012 22:29
WP Browser Detection
add_filter('body_class','browser_body_class');
function browser_body_class($classes) {
global $is_lynx, $is_gecko, $is_IE, $is_opera, $is_NS4, $is_safari, $is_chrome, $is_iphone;
if($is_lynx) $classes[] = 'lynx';
elseif($is_gecko) $classes[] = 'gecko';
elseif($is_opera) $classes[] = 'opera';
elseif($is_NS4) $classes[] = 'ns4';
elseif($is_safari) $classes[] = 'safari';
elseif($is_chrome) $classes[] = 'chrome';
elseif($is_IE) $classes[] = 'ie';
@werm
werm / file1.php
Created December 6, 2012 22:26
WP Template Directory Path
#returns the active template directory
<?php bloginfo('template_directory'); ?>
#returns URL of web root
<?php bloginfo('url'); ?>
#returns blog name
<?php bloginfo('title'); ?>
@werm
werm / index.html
Created December 3, 2012 18:11
A CodePen by Craig Wermert. Windows phone loading animation - Just keeping this here for reference. Blatantly ripped off from here: http://thecodeplayer.com/walkthrough/windows-phone-loading-animation
<span>Loading</span>
<span class="l-1"></span>
<span class="l-2"></span>
<span class="l-3"></span>
<span class="l-4"></span>
<span class="l-5"></span>
<span class="l-6"></span>
@werm
werm / file1.php
Created December 3, 2012 17:42
Category Title in POst
<?php the_category(', '); ?>