Skip to content

Instantly share code, notes, and snippets.

$('.level1>.x-panel-bwrap>.x-panel-tbar, .level2>.x-panel-bwrap>.x-panel-tbar, .level3>.x-panel-bwrap>.x-panel-tbar').click(function(){
parent = this.parentNode;
body = $(parent).children('.x-panel-body');
xpanel = $(body).children('.x-panel');
// I always specifically open and close because I've seen some issues with toggleClass. - CM
if($(this).hasClass('open')) {
$(this).removeClass('open');
$(xpanel).removeClass('open');
} else {
$(this).addClass('open');
@auniverseaway
auniverseaway / checkbox.html
Last active September 13, 2015 00:28
Detect String Array in Sightly
<template data-sly-template.view>
<sly data-sly-test="${properties.options[1]}" data-sly-list.child="${properties.options}" data-sly-unwrap>
<label><input type="checkbox" name="${properties.name}" value="${child}">${child}</label>
</sly>
<label data-sly-test="${!properties.options[1]}"><input type="checkbox" name="${properties.name}" value="${properties.options}">${properties.options}</label>
</template>
var gulp = require('gulp');
var sass = require('gulp-sass');
var minifyCss = require('gulp-minify-css');
var sourceMaps = require('gulp-sourcemaps'),
path = require('path');
gulp.task('styles', function() {
gulp.src('./**/scss/*.scss', {base: '.'})
.pipe(sourceMaps.init())
.pipe(sass().on('error', sass.logError))
var gulp = require('gulp');
var sass = require('gulp-sass');
var minifyCss = require('gulp-minify-css');
var sourceMaps = require('gulp-sourcemaps');
var rename = require("gulp-rename");
gulp.task('styles', function() {
gulp.src('./**/scss/*.scss', {base: '.'})
.pipe(sass().on('error', sass.logError))
.pipe(rename(function (path) {
@auniverseaway
auniverseaway / CreateGroupAndUserServlet.java
Created October 14, 2015 16:03
Create a group and user then assign user to group using Jackrabbit API
private void createAuthorGroupAndUser(ResourceResolver resolver) {
try {
Session session = resolver.adaptTo(Session.class);
if (session != null && session instanceof JackrabbitSession) {
// Get our User Manager
UserManager userManager = ((JackrabbitSession) session).getUserManager();
ValueFactory valueFactory = session.getValueFactory();
// Create the Authors group if it doesn't exist already.
Authorizable authors = userManager.getAuthorizable("authors");
Verifying that +millar is my blockchain ID. https://onename.com/millar
@auniverseaway
auniverseaway / _grid.scss
Last active December 18, 2015 20:07
Flexbox Grid System
@mixin Cell ($size) {
// Specific sizing for cells in 5% increments.
.Cell {
@for $i from 1 through 20 {
&.#{$size}-#{$i*5} {
flex: 0 0 #{$i*5}%;
}
}
}
}
{"meta":{"code":200,"response_time":{"time":1.15,"measure":"seconds"}},"notifications":{"type":"notifications","unread_count":{"comments":0,"toasts":0,"friends":0,"messages":0,"news":0}},"response":{"mg":true,"checkins":{"count":25,"items":[{"checkin_id":43080032,"created_at":"Wed, 28 Aug 2013 07:13:17 +0000","checkin_comment":"Free after work beer.","rating_score":2,"user":{"uid":362611,"user_name":"Abalster9","first_name":"Alan","last_name":"Balster","location":"Kansas City","url":"","is_supporter":0,"relationship":"friends","bio":"","user_avatar":"https:\/\/untappd.s3.amazonaws.com\/profile\/111c5e9fdb9e014ad4c12740f93c0fd5_thumb.jpg"},"beer":{"bid":3834,"beer_name":"Coors Light","beer_label":"https:\/\/untappd.s3.amazonaws.com\/site\/beer_logos\/beer-coorsLight.jpg","beer_style":"American Light Lager","beer_abv":4.2,"auth_rating":0,"wish_list":false,"beer_active":1},"brewery":{"brewery_id":399,"brewery_name":"Coors Brewing Company","brewery_label":"https:\/\/untappd.s3.amazonaws.com\/site\/brewery_logos\/
public abstract class ViewModel : INotifyPropertyChanged {
public event PropertyChangedEventHandler PropertyChanged;
protected void OnPropertyChanged(string name) {
if (PropertyChanged != null)
PropertyChanged(this, new PropertyChangedEventArgs(name));
}
}
@auniverseaway
auniverseaway / gist:8445523
Created January 15, 2014 21:54
Get all images attached to a wordpress post except for the thumbnail image.
function slideshow_hero($postid) {
$thumb_ID = get_post_thumbnail_id($postid);
$args = array(
'post_type' => 'attachment',
'numberposts' => -1,
'post_mime_type' => 'image',
'post_status' => null,
'exclude' => $thumb_ID,
'post_parent' => $postid);