This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The regex patterns in this gist are intended to match any URLs, | |
including "mailto:foo@example.com", "x-whatever://foo", etc. For a | |
pattern that attempts only to match web URLs (http, https), see: | |
https://gist.github.com/gruber/8891611 | |
# Single-line version of pattern: | |
(?i)\b((?:[a-z][\w-]+:(?:/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Regular Expression for URL validation | |
// | |
// Author: Diego Perini | |
// Created: 2010/12/05 | |
// Updated: 2018/09/12 | |
// License: MIT | |
// | |
// Copyright (c) 2010-2018 Diego Perini (http://www.iport.it) | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="ISO-8859-1"?> | |
<xsl:stylesheet | |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | |
xmlns:xs="http://www.w3.org/2001/XMLSchema" | |
version="1.0"> | |
<xsl:template match="/charlist"> | |
<xsl:text> | |
unicode_to_latex = { | |
</xsl:text> | |
<xsl:for-each select="character"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; | |
; AutoHotkey Version: 1.x | |
; Language: English | |
; Platform: Win9x/NT | |
; Author: Matt Heath <matt@mattheath.com> | |
; | |
; Script Function: | |
; Remaps keys when using an Apple Keyboard with a Windows PC | |
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%!TEX TS-program = xelatex | |
\documentclass[12pt]{scrartcl} | |
% The declaration of the document class: | |
% The second line here, i.e. | |
% \documentclass[12pt]{scrartcl} | |
% is a standard LaTeX document class declaration: | |
% we say what kind of document we are making in curly brackets, | |
% and specify any options in square brackets. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Perl and PHP Regular Expressions | |
PHP regexes are based on the PCRE (Perl-Compatible Regular Expressions), so any regexp that works for one should be compatible with the other or any other language that makes use of the PCRE format. Here are some commonly needed regular expressions for both PHP and Perl. Each regex will be in string format and will include delimiters. | |
All Major Credit Cards | |
This regular expression will validate all major credit cards: American Express (Amex), Discover, Mastercard, and Visa. | |
//All major credit cards regex | |
'/^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6011[0-9]{12}|622((12[6-9]|1[3-9][0-9])|([2-8][0-9][0-9])|(9(([0-1][0-9])|(2[0-5]))))[0-9]{10}|64[4-9][0-9]{13}|65[0-9]{14}|3(?:0[0-5]|[68][0-9])[0-9]{11}|3[47][0-9]{13})*$/' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
header('Content-type: text/plain'); | |
global $wpdb; | |
?> | |
<table class="numbers"> | |
<thead> | |
<tr> | |
<th> </th> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#http://jeromyanglim.blogspot.com.au/2012/05/how-to-plot-three-categorical-variables.html | |
library(ggplot2) | |
# Create some data | |
set.seed(4444) | |
Data <- expand.grid(group=c("Apples", "Bananas", "Carrots", "Durians", "Eggplants"), | |
year=c("2000", "2001", "2002"), | |
quality=c("Grade A", "Grade B", "Grade C", "Grade D", "Grade E")) | |
Group.Weight <- data.frame( | |
group=c("Apples", "Bananas", "Carrots", "Durians", "Eggplants"), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(ggplot2); | |
library(grid); | |
data(iris) | |
x <- jitter(iris[,c('Sepal.Length')]) | |
y <- jitter(iris[,c('Sepal.Width')]) | |
z <- factor(iris[,c('Species')]) | |
# The color blind palette without black: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#first attempt at implementing horizon plots in ggplot2 | |
#pleased with result but code sloppy and inflexible | |
#as always very open to improvements and forks | |
require(ggplot2) | |
require(reshape2) | |
require(quantmod) | |
require(PerformanceAnalytics) | |
require(xtsExtra) |
OlderNewer