Skip to content

Instantly share code, notes, and snippets.

@jchaney01
jchaney01 / UtilityController.php
Last active December 21, 2015 09:59
Angular.js Uploadify Directive with Image Editor and Laravel Backend
class UtilityController extends BaseController {
public function upload()
{
$file = Input::file('Filedata');
$name = Date("now").'-'.$file->getClientOriginalName();
$uploadSuccess = $file->move(public_path().'/uploads',$name);
if( $uploadSuccess ) {
return Response::json(array(
"status"=>"200",
@jchaney01
jchaney01 / gist:6127665
Created August 1, 2013 01:06
Angular directives for scrolling to an element and to the bottom of the page. Just add to an element and clicking the element will do it.
app.directive('scrollTo', ['$document',function ($document) {
var body = $($document[0].body);
return function (scope, element, attributes) {
var target = angular.element(attributes.scrollTo);
setTimeout(function () {
element.bind('click touchstart', function(e) {
e.preventDefault();
body.animate({scrollTop:target.offset().top},2000);
});
});
@jchaney01
jchaney01 / perfectTableBorders.scss
Created July 25, 2013 18:38
Sass Mixin to produce even table borders. Table borders get doubled up when a border is simply applied to a table element. This will do it in isolate.
@mixin perfectTableBorders($color, $width){
tr{&:last-child{border-bottom: $width solid $color;}
border-top: $width solid $color;
}
td{&:first-child{border-left: $width solid $color;}
border-right: $width solid $color;
}
}
@jchaney01
jchaney01 / _mixins.scss
Last active December 6, 2017 18:59
SaaS Mixin for mobile-first responsive styling
With Bootstrap 4 values:
@mixin breakpoint($point) {
@if $point == sm {
@media (min-width: 576px) { @content; }
}
@if $point == md {
@media (min-width: 768px) { @content; }
}
@else if $point == lg {