Skip to content

Instantly share code, notes, and snippets.

// ==UserScript==
// @name Use Markdown, sometimes, in your HTML.
// @author Paul Irish <http://paulirish.com/>
// @link http://git.io/data-markdown
// @match *
// ==/UserScript==
// If you're not using this as a userscript just delete from this line up. It's cool, homey.
@allex
allex / jQuery.stringify.js
Last active August 29, 2015 14:27 — forked from chicagoworks/jQuery.stringify.js
jQuery.stringify() utility
/**
* converted stringify() to jQuery plugin.
* serializes a simple object to a JSON formatted string.
* Note: stringify() is different from jQuery.serialize() which URLEncodes form elements
* UPDATES:
* Added a fix to skip over Object.prototype members added by the prototype.js library
* USAGE:
* jQuery.ajax({
(function($) {
// Used by dateinput
$.expr = {':': {}};
// Used by bootstrap
$.support = {};
// Used by dateinput
$.fn.clone = function(){
var ret = $();
@allex
allex / gist:fad0598fdb67f9ef33d1
Created November 26, 2015 06:53 — forked from isellsoap/gist:8299726
A Sass function for converting px to em values. Works with mixed px and em values and with nested em structures.
$base-font-size: 16px;
/**
* Strips the unit from a given number-unit-combination and returns the number.
* @link: http://stackoverflow.com/a/12335841/1779999
* @usage: parse-int(10px) => 10
*/
@function parse-int($number) {
@return $number / ($number * 0 + 1);
// ----------------------------------------------------------
// 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) {}
@allex
allex / tmux.md
Created May 4, 2016 02:30 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@allex
allex / functions_logger.sh
Created May 12, 2016 08:01 — forked from artifactsauce/functions_logger.sh
Bash function file for logger.
# functions
declare -i OK=0
declare -i FAIL=1
[ -n "$LOG_LEVEL" ] || declare -i LOG_LEVEL=3
[ -n "$DATE_FORMAT" ] || DATE_FORMAT="%x %T"
[ -n "$LOG_FILE" ] || LOG_FILE="progress.log"
logger_fatal() {
@allex
allex / nginxvarcore.md
Created December 28, 2016 06:35 — forked from esfand/nginxvarcore.md
Nginx Variables

Embedded Variables

The ngx_http_core_module module supports embedded variables with names matching the Apache Server variables. First of all, these are variables representing client request header fields, such as $http_user_agent, $http_cookie, and so on. Also there are other variables:

  • $arg_name
    argument name in the request line
@allex
allex / index.html
Created February 17, 2017 09:00 — forked from oddlyzen/index.html
Cool CSS Flicker Animation - from http://ringshia.com
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="description" content="Pratik Ringshia's website">
<meta name="keywords" content="pratik ringshia, pratik, ringshia, personal, website">
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
<style type="text/css">
@allex
allex / README.md
Created September 27, 2017 02:13 — forked from ColCh/README.md
Create merge request on Gitlab in command line for current branch

Gitlab merge request script

Creates merge request on Gitlab for you

Installation

Download it, add executable perms and place into PATH:

# Place it into ~/.bin
mkdir ~/.bin