Skip to content

Instantly share code, notes, and snippets.

@clemgrim
clemgrim / fisc-es.js
Last active September 16, 2017 19:44
const steps = [
{start: 60000, percent: .45},
{start: 34000, percent: .37},
{start: 20200, percent: .3},
{start: 12450, percent: .24},
{start: 0, percent: .19}
];
function calc(x) {
for (let step of steps) {
<?php
$iterator = new DirectoryIterator('./');
$files = [];
$result = '{"success":true,"result":{"id":6255,"title":"CETT Photobooth","visibility":"network","type":"image","mediaCount":130,"thumb":"\/assets\/uploads\/private-galleries\/tmb.5821bf57d35969.47251698.png","createdAt":"2016-11-08T13:03:53","system":false,"eventUrl":null,"medias":[{"id":29052,"media":"\/assets\/uploads\/private-galleries\/5821bf57d35969.47251698.png","thumb":"\/assets\/uploads\/private-galleries\/tmb.5821bf57d35969.47251698.png","createdAt":"2016-11-08T13:04:40","width":1078,"height":1347,"type":"image","content":""},{"id":29051,"media":"\/assets\/uploads\/private-galleries\/5821bf57ad0c38.69476764.png","thumb":"\/assets\/uploads\/private-galleries\/tmb.5821bf57ad0c38.69476764.png","createdAt":"2016-11-08T13:04:40","width":1078,"height":1347,"type":"image","content":""},{"id":29050,"media":"\/assets\/uploads\/private-galleries\/5821bf572f0b38.75653978.png","thumb":"\/assets\/uploads\/private-galleries\/tmb.5821bf572f0b38.75653978.
<?php
$str = preg_replace('#[^[:alnum:][:space:]]#u', '', $str);
<?php
$str = htmlentities($str, ENT_NOQUOTES, 'utf-8');
$str = preg_replace('#&([A-za-z])(?:acute|cedil|caron|circ|grave|orn|ring|slash|th|tilde|uml);#', '\1', $str);
$str = preg_replace('#&([A-za-z]{2})(?:lig);#', '\1', $str);
$str = preg_replace('#&[^;]+;#', '', $str);
@clemgrim
clemgrim / pr.md
Created April 27, 2016 10:08 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

angular.module('app').config( ['$provide', function ($provide){
$provide.decorator('$browser', ['$delegate', function ($delegate) {
$delegate.onUrlChange = function () {};
$delegate.url = function () { return ""};
return $delegate;
}]);
}]);
.block {
text-align: center;
}
.block:before {
content: '';
display: inline-block;
height: 100%;
vertical-align: middle;
margin-right: -0.25em; /* Adjusts for spacing */
WebFontConfig = {google: {families: []}};
(function(d, fonts) {
WebFontConfig.google.families = fonts.map(function(font) {return font + '::latin'});
var wf = d.createElement('script');
wf.src = '//ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
wf.async = 'true';
wf.onerror = function() {
module.exports = /*@ngInject*/ function () {
return {
restrict: 'AE',
link: function postLink (scope, elm, attrs) {
var opt = {};
if (attrs.nullable != undefined) {
opt.allow_single_deselect = true;
}
gulp.task('js', function () {
var browserify = require('browserify');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
return browserify('./public/js/app.js').bundle()
.pipe(source('app.js'))
.pipe(buffer())
.pipe($.ngAnnotate({single_quotes: true, add: true}))
.pipe($.if(argv.min, $.uglify()))