Skip to content

Instantly share code, notes, and snippets.

@1e4
1e4 / .readme.md
Last active August 29, 2015 14:07 — forked from jmyrland/.readme.md

Off canvas menu with touch handles.

View an example here.

This example is based on elements of this post.

Incliudes a OffCanvasMenuController to handle touch events bound to the off canvas menu. For example when swiping from the outer left side to the right, the left off canvas menu is dragged along.

Example usage

Make symbolic link to ini files in mods-available
sudo ln -s /etc/php5/conf.d/mcrypt.ini /etc/php5/mods-available/mcrypt.ini
Enable mods
sudo php5enmod mcrypt
Restart FPM
sudo service php5-fpm restart
@1e4
1e4 / Twig Errors
Last active August 29, 2015 14:11
#Twig Field Errors
Currently there was no easy way of adding errors to a standard twig / laravel build, so I created a quick filter and thought I would share, nothing crazy but hopefully someone else might find it useful.
##Install
Copy the below code into `lwig.php` within the extensions directory, if you don't have one follow the quick step below
#####If no extension directory:
* Create a directory under `app/` named `lextra` (or whateer you want).
* In your composer make sure you are autoloading that directory `"app/lextra"`.
* Run `composer dumpautoload` to generate the autoload file
@1e4
1e4 / gulpfile.js
Last active August 29, 2015 14:27 — forked from darkwing/gulpfile.js
var gulp = require('gulp');
var runSequence = require('run-sequence');
var minifyCss = require('gulp-minify-css');
var buildDir = './build/';
var minifyCssSettings = { advanced: true, aggressiveMerging: true };
// Main build
gulp.task('build', function() {
@1e4
1e4 / id_issue.py
Created July 19, 2017 08:27
Razer taking over focus for no reason!
#!/usr/bin/python
from AppKit import NSWorkspace
import time
t = range(1,100)
for i in t:
time.sleep(3)
activeAppName = NSWorkspace.sharedWorkspace().activeApplication()['NSApplicationName']
print activeAppName
@1e4
1e4 / .bash_profile
Created December 7, 2017 15:55
Quick bash script for changing local git repo config settings
function gitconfig {
if [ "$1" == "" ]; then
echo "Empty username (Usage gitconfig username email)"
else
git config user.name "$1"
echo "Set git username to $1"
fi
@1e4
1e4 / countrylist.php
Created April 14, 2018 11:36 — forked from princenaman/countrylist.php
ISO Country List for Laravel
<?php
return [
'AF' => 'Afghanistan',
'AL' => 'Albania',
'DZ' => 'Algeria',
'AS' => 'American Samoa',
'AD' => 'Andorra',
'AO' => 'Angola',
'AI' => 'Anguilla',
@1e4
1e4 / CountryExists.php
Created April 14, 2018 12:01
Laravel Country Validation
<?php
// app/Rules/CountryExists.php
namespace App\Rules;
use Illuminate\Contracts\Validation\Rule;
class CountryExists implements Rule
{
<?php
namespace App\Http\Middleware;
use Carbon\Carbon;
use Closure;
class TimerCheck
{
/**
@1e4
1e4 / gravatar.js
Last active September 27, 2018 10:01
Gravatar in Javascript, md5 is optional
// Usage
let g = new Gravatar;
return g.setEmail('your_email')
.setRating('x')
.setSize(40)
.setImageSet('monsterid')
.getAvatar()