Skip to content

Instantly share code, notes, and snippets.

@juice49
juice49 / dabblet.css
Created August 21, 2012 15:57
Untitled
@keyframes peel-open {
0% {
width:150px;
height:150px;
}
100% {
width:300px;
height:300px;
@juice49
juice49 / dabblet.css
Created September 14, 2012 13:36
Untitled
body {
font-family:sans-serif;
}
#wrapper {
height:0;
overflow:hidden;
background:#ccc;
transition:height 2s;
}
@juice49
juice49 / Stuff to make
Created November 13, 2012 11:28
Stuff to make
- A JavaScript library for creating and modifying CSS rules.
@juice49
juice49 / readme.md
Created November 30, 2012 16:53
Using the Laravel Validator, make a field required if another field is set to a given attribute.

Setup

  • Add this file to application/libraries (or, if you are already extending the Validator class, add the contents there).
  • Remove Validator alias from config/application.php in order to avoid conflicts.
  • Add "required_if_attribute" => "The :attribute field is required." to application/language/[language]/validation.php.

Usage

Define the rule using:

required_if_attribute:[field],[operator],[value]

@juice49
juice49 / UniqueFilename
Created July 2, 2014 10:14
Laravel unique filename
/**
* Creates a unique filename by appending a number
*
* i.e. if image.jpg already exists, returns
* image2.jpg
*/
function uniqueFilename($path, $name, $ext) {
$output = $name;
$basename = basename($name, '.' . $ext);
@juice49
juice49 / gist:95ac07405f959d270f08
Last active August 29, 2015 14:04
Bookmarks Bar
@juice49
juice49 / gist:829345d5b1f6dfc6a8c3
Created February 13, 2015 11:19
Debug console
/* global config */
'use strict';
module.exports = {
/**
@juice49
juice49 / Installed dependencies
Created March 4, 2015 21:54
Working ExpandOBem example
expandobem-test@1.0.0
├─┬ expandobem@0.0.4
│ ├── amp-includes@1.0.2
│ ├─┬ merge-deep@1.0.1
│ │ ├─┬ clone-deep@0.1.1
│ │ │ ├─┬ for-own@0.1.2
│ │ │ │ └── for-in@0.1.3
│ │ │ ├── is-plain-object@0.1.0
│ │ │ ├── kind-of@0.1.2
│ │ │ └── mixin-object@0.1.1
@juice49
juice49 / index.js
Created July 9, 2015 08:07
Retinafy
'use strict';
const path = require('path');
const retina = require('is-retina');
module.exports = function applyRetinafy(selector) {
@juice49
juice49 / index.js
Created September 15, 2015 15:08
Buttons for non-buttons
const $ = require('jquery');
const keycode = require('keycode');
$('[role=button]').on('keydown', function(e) {
if(keycode(e) === 'space') {
e.preventDefault();
$(this).trigger('click');
}
});