- Plain Strings (207):
foo - Anchors (208):
k$ - Ranges (202):
^[a-f]*$ - Backrefs (201):
(...).*\1 - Abba (169):
^(.(?!(ll|ss|mm|rr|tt|ff|cc|bb)))*$|^n|ef - A man, a plan (177):
^(.)[^p].*\1$ - Prime (286):
^(?!(..+)\1+$) - Four (199):
(.)(.\1){3} - Order (198):
^[^o].....?$ - Triples (507):
(^39|^44)|(^([0369]|([147][0369]*[258])|(([258]|[147][0369]*[147])([0369]*|[258][0369]*[147])([147]|[258][0369]*[258])))*$)
This file contains hidden or 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
| find app/src -name "*.js" -exec sh -c 'mv "$0" "${0%.js}.ts"' {} \; |
This file contains hidden or 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
| // clone this gist to a empty folder, the run: | |
| // npm init (and follow steps) | |
| // npm install express --save | |
| // npm install swig --save | |
| // node app.js and open http://localhost:3000 | |
| function App() { | |
| var express = require('express'); |
This file contains hidden or 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
| app.factory('API', function($http, $q){ | |
| var basePath = 'http://domain.com/api/path'; | |
| // => http://domain.com/api/path/foo/bar | |
| function makeRequest(verb, uri, data){ | |
| var defer = $q.defer(); | |
| verb = verb.toLowerCase(); | |
| //start with the uri |
This will allow you to include additional directories to what cd will look at for completions. From the bash man page:
The search path for the cd command. This is a colon-separated list of directories in which the shell looks for destination directories specified by the cd command.
This file contains hidden or 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
| //Simple Prototype extend | |
| var extend = (function () { | |
| var f = function(){}; | |
| return function (c, p) { | |
| f.prototype = p.prototype; | |
| c.prototype = new f; | |
| c._super = p.prototype; | |
| c.prototype.constructor = c; | |
| } | |
| })(); |
This file contains hidden or 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
| #!/bin/bash | |
| # Issue arbitary git command for each of the sub modules. | |
| # E.g. git-bundle checkout feature/docs | |
| # Check out the feature/docs branch for each of the sub module. | |
| function print_header | |
| { | |
| printf '%.0s-' {1..30} && echo | |
| echo $1 | |
| printf '%.0s-' {1..30} && echo |
This file contains hidden or 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
| /** | |
| * Lightwright JS Loader | |
| * | |
| * @author Christopher Imrie | |
| * | |
| * @param {String} name URL to JS file | |
| * @param {Function} cb Callback function | |
| * @return {null} | |
| */ | |
| function loadScript(/** string */ name, /** Function*/ cb) { |
This file contains hidden or 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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> | |
| <script type="text/javascript"> | |
| function add(){ | |
| for (var i = 0; i < 500; i++) { | |
| $('<div style="background-color: #A68585;margin: 2px 0;width: 100px;height: 30px;">' + i + '</div>').appendTo('.box'); | |
| } | |
| } |
This file contains hidden or 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
| package main | |
| import ( | |
| "fmt" | |
| "net/http" | |
| "time" | |
| ) | |
| var urls = []string{ | |
| "https://splice.com/", |