Skip to content

Instantly share code, notes, and snippets.

View monkeymonk's full-sized avatar
😶
β+∂(ℤ²-i)ℕ×g³=α!

Stéphan Zych monkeymonk

😶
β+∂(ℤ²-i)ℕ×g³=α!
View GitHub Profile
// ----------------------------------------------------------
// A short snippet for detecting versions of IE in JavaScript
// without resorting to user-agent sniffing
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 5) then:
// ie === undefined
// If you're in IE (>=5) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}
@monkeymonk
monkeymonk / ajaxify-html5.js
Created May 29, 2012 22:37 — forked from balupton/README.md
Ajaxify a Website with the HTML5 History API using History.js, jQuery and ScrollTo
// https://gist.github.com/854622
(function(window,undefined){
// Prepare our Variables
var
History = window.History,
$ = window.jQuery,
document = window.document;
// Check to see if History.js is enabled for our Browser
@monkeymonk
monkeymonk / .htaccess
Created June 12, 2012 06:00 — forked from necolas/.htaccess
Simple, quick way to concatenate, minify, and version static files in a Wordpress theme
# Filename-based cache busting
# taken from https://github.com/h5bp/html5-boilerplate/
# This rewrites file names of the form `name.123456.js` to `name.js`
# so that the browser doesn't use the cached version when you have
# updated (but not manually renamed) the file.
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On
@monkeymonk
monkeymonk / placeholder.coffee
Last active December 18, 2015 19:00 — forked from wenjul/placeholder.css
jQuery simple placeholder support
supportsPlaceholder = "placeholder" of document.createElement("input")
$("[placeholder]").each ->
unless supportsPlaceholder
self = $(this)
self.val(self.attr("placeholder")).addClass "placeholder" if self.val() is ""
self.focus ->
self.val("").removeClass "placeholder" if self.val() is self.attr("placeholder")
@monkeymonk
monkeymonk / install.sh
Last active April 9, 2019 06:45 — forked from fideloper/install.sh
Server quick install PHP 5 #server
#!/usr/bin/env bash
echo ">>> Starting Install Script"
# Update
sudo apt-get update
# Install MySQL without prompt
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password root'
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password root'
@monkeymonk
monkeymonk / wp-query-ref.php
Last active April 9, 2019 06:52 — forked from luetkemj/wp-query-ref.php
WordPress Query Comprehensive Reference #wordpress
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query
* Source: http://core.trac.wordpress.org/browser/tags/3.5.1/wp-includes/query.php
*/
$args = array(
$.extend($.fn, {
spin: function (opts, callback) {
this.each(function() {
var $this = $(this),
data = $this.data();
if (opts !== false) {
data.spinner = new Spinner(opts).spin(this);
$this.trigger('spin');
module.exports = {
'A lot of screenshots': function (test) {
var resolutions = [{width: 1280, height: 1024}, {width: 1024, height: 768}, {width: 800, height: 600}];
var pages = ['http://facebook.com', 'http://twitter.com', 'http://dalekjs.com'];
resolutions.forEach(function (res) {
pages.forEach(function (page) {
test.open(page)
.resize(res)
.select2-container .select2-choice {
border: 2px solid #dce4ec;
font-family: "Lato", sans-serif;
font-size: 14px;
text-indent: 1px;
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;
-webkit-box-shadow: none;
-moz-box-shadow: none;