Skip to content

Instantly share code, notes, and snippets.

View junyuecao's full-sized avatar

JunyueCao junyuecao

View GitHub Profile
Number Name Score Regex Length All match? Credit
 1 | Plain Strings| 207 | `foo`                                              | 3      | Yes        | 
 2 | Anchors      | 208 | `k$`                                               | 2      | Yes        |
 3 | Ranges       | 202 | `^[a-f]*$`                                         | 8      | Yes        |
 4 | Backrefs     | 201 | `(...).*\1`                                        | 9      | Yes        | gorhill (HN)
 5 | Abba         | 193 | `^(?!.*(.)(.)\2\1)`                                | 17     | Yes        | chingjun (HN) / josephlord (HN) 
 6 | A man, a plan| 177 | `^(.)[^p].*\1$`                                    | 13     | Yes        | hyp0 (HN)

7 | Prime | 286 | ^(?!(..+)\1+$) | 14 | Yes | josephlo

// Bouncing a user back to their last place after authentication with Express 3
// To accompany http://stackoverflow.com/a/12443844/1380669
// by therealplato
var express = require('express');
var app = express();
require('http').createServer(app).listen(3000
, function(err){
console.log(err || "Listening on 3000");
});
controllers.controller('MainCtrl', function($scope, $location, Facebook, $rootScope, $http, $location, Upload, Auth, User, Question, Category, Serie, Record, Location, Popup, Process, Card, Question) {
$scope.$on('authLoaded', function() {
$scope.isExpert($scope.main.serieId);
$scope.isMember($scope.main.serieId);
});
$scope.loadAuth = function() {
Auth.load().success(function(data) {
$scope.main.user = data.user;
$scope.$broadcast("authLoaded");