Skip to content

Instantly share code, notes, and snippets.

View ryun's full-sized avatar
🤘

Ryun Shofner ryun

🤘
View GitHub Profile
@ryun
ryun / topbar-example.html
Created April 17, 2013 05:53
Topbar navigation
<div class="contain-to-grid">
<nav class="top-bar">
<ul>
<li class="name"><h1><a href="{{ url:site }}" class="logo">{{ settings:site_name }}</a></h1></li>
<li class="toggle-topbar"><a href="#"></a></li>
</ul>
<section>
<ul class="left header-nav">
{{ navigation:links group="header" more-class="has-dropdown" }}
@ryun
ryun / tagcloud.php
Last active December 18, 2015 04:29
Pyrocms Tag Cloud plugin method This plug will output weighted tag cloud links
function tagcloud()
{
$max_size = $this->attribute('max_size', 32);
$min_size = $this->attribute('min_size', 12);
$font_size_unit = $this->attribute('font_size_unit', 'px');
$separator = $this->attribute('separator', ' ');
$output_array = array();
$tags = $this->db
->select('k.name, ka.keyword_id as id, COUNT(ka.keyword_id) AS weight')
{{ sidebar_menu:has_sidebar page=page:id }}
<div class="sidebar">
<ul>
{{ sidebar_menu:show page=page:id}}
</ul>
</div>
{{ /sidebar_menu:has_sidebar }}
@ryun
ryun / DumpDie.php
Last active December 19, 2015 10:19
A pimped out `dd()` helper from pyrocms
if ( ! function_exists('dd'))
{
/**
* Dump the passed variables and end the script.
* Pimped out dump function from pyrocms @PhilSturgeon
*
* @param dynamic mixed
* @return void
*/
function dd()
@ryun
ryun / muliselect.macro.php
Created July 6, 2013 12:47
Form Macro: Multi Select for laravel
Form::macro('multiselect', function($name, $list = [], array $selected = [], $options = [])
{
$options['name'] = $name;
$html = array();
if (is_string($selected)) $selected[$selected] = $selected;
//dd($list, $selected);
foreach ($list as $value => $display)
{
$sel = isset($selected[$value])?' selected="selected"':'';
@ryun
ryun / dump.php
Created January 18, 2014 00:46
Outputs the given variable with formatting and location
<?php
if ( ! function_exists('dump'))
{
function dump()
{
list($callee) = debug_backtrace();
$arguments = $callee['args'];
$total_arguments = count($arguments);
@ryun
ryun / jquery.floater.js
Created February 11, 2014 21:31
Floating headers - jquery.floater.js
(function(){
function Floater(el, opt) {
this.el = el;
this.$el = $(el);
opt = opt||{};
this.init();
};
Floater.prototype.init = function() {
@ryun
ryun / Git_Notes.md
Last active August 29, 2015 14:01
Git Notes

Git Notes

Rebase to the rescue (merge conflicts)

When running git pull we should also rebase to avoid possible merge conflicts.

git pull --rebase
@ryun
ryun / deploy.rb
Last active August 29, 2015 14:07 — forked from chipotle/deploy.rb
# Capistrano Laravel 4 Deployment Tasks
# Watts Martin (layotl at gmail com)
# https://gist.github.com/chipotle/5506641
# updated 14-Aug-2013
# Assumptions:
#
# - You are using a .gitignore similar to Laravel's default, so your
# vendor directory and composer(.phar) are *not* under version control
# - Composer is installed as an executable at /usr/local/bin/composer
@ryun
ryun / composer.json
Created January 16, 2015 17:50
composer.json gulp integration
"scripts": {
"post-install-cmd": [
"npm install",
"./node_modules/gulp/bin/gulp.js",
"php artisan clear-compiled",
"php artisan optimize"
],
"post-update-cmd": [
"npm install",
"./node_modules/gulp/bin/gulp.js",