Skip to content

Instantly share code, notes, and snippets.

@maxxon15
maxxon15 / springer-free-maths-books.md
Created December 29, 2015 12:08 — forked from bishboria/springer-free-maths-books.md
Springer have made a bunch of books available for free, here are the direct links
@maxxon15
maxxon15 / config.json
Last active August 29, 2015 14:11 — forked from anonymous/config.json
{
"vars": {
"@gray-base": "#000",
"@gray-darker": "lighten(@gray-base, 13.5%)",
"@gray-dark": "lighten(@gray-base, 20%)",
"@gray": "lighten(@gray-base, 33.5%)",
"@gray-light": "lighten(@gray-base, 46.7%)",
"@gray-lighter": "lighten(@gray-base, 93.5%)",
"@brand-primary": "darken(#428bca, 6.5%)",
"@brand-success": "#5cb85c",
<span class="ge" style="
position: absolute;
width: 75%;
height: 1px;
background: #666;
top: 0;
right: 0;
-webkit-transform: translateX(-9%) translateY(0px) rotateZ(-53deg) scaleX(1);
z-index: -1;
-webkit-transform-origin: top right;
@maxxon15
maxxon15 / gulpfile.js
Created February 4, 2014 15:41
My gulpfile.js config
var gulp = require('gulp'),
autoprefixer = require('gulp-autoprefixer'),
minifycss = require('gulp-minify-css'),
uglify = require('gulp-uglify'),
rename = require('gulp-rename'),
concatenate = require('gulp-concat');
gulp.task('styles', function(){
return gulp.src('assets/stylesheets/*.css')
.pipe(autoprefixer('last 2 version', 'safari 5', 'ie 8', 'ie 9', 'ios 6', 'android 4'))
<?php
$fileName = $_FILES['afile']['name'];
$fileType = $_FILES['afile']['type'];
$fileContent = file_get_contents($_FILES['afile']['tmp_name']);
$dataUrl = 'data:' . $fileType . ';base64,' . base64_encode($fileContent);
$json = json_encode(array(
'name' => $fileName,
'type' => $fileType,
'dataUrl' => $dataUrl,
<?php
/**
* File: database.class.php
* Super simple PDO class
*
* Author: Jeremy Morgan
*
* This is just a start. No error handling or parameterization yet
*/
@maxxon15
maxxon15 / set-value.md
Created July 28, 2012 21:16 — forked from JeffreyWay/set-value.md
PHP: Set value if not exist

You know how, in JavaScript, we can set a value to a variable if one doesn't, like this:

name = name || 'joe';

This is quite common and very helpful. Another option is to do:

name || (name = 'joe');
@maxxon15
maxxon15 / gist:3121234
Created July 16, 2012 06:59 — forked from rmurphey/gist:3086328
What's wrong with Netmag's "Optimize your JavaScript" post

What's wrong with Netmag's "Optimize your JavaScript" post

Update: The original post on Netmag has been updated since this was written.

I tweeted earlier that this should be retracted. Generally, these performance-related articles are essentially little more than linkbait -- there are perhaps an infinite number of things you should do to improve a page's performance before worrying about the purported perf hit of multiplication vs. division -- but this post went further than most in this genre: it offered patently inaccurate and misleading advice.

Here are a few examples, assembled by some people who actually know what they're talking about (largely Rick Waldron and Ben Alman, with some help from myself and several others from the place that shall be unnamed).

Things that are just plain wrong