Skip to content

Instantly share code, notes, and snippets.

View brh55's full-sized avatar
Hello! 👋

Brandon Him brh55

Hello! 👋
View GitHub Profile
@brh55
brh55 / ColorThemeMODx
Last active August 29, 2015 14:03
Optimized methods for Color Theming in MODx | PMACS TEAM | #modx #optimize
Key: colortheme
Label: Color Theme
Description: Choose your desired color theme.
Group: Publishers (drop down)
Field Type: Selectbox (drop down)
@brh55
brh55 / OptimizedConditional
Last active September 18, 2015 13:54
Optimized Conditionals for MODx | PMACS Web Team | #MODx #optimizing
1. [[[[*show-sidebar:is=`yes`:then=`$sidebar`:else=`$subpage-content`]]]]
Now we tell modx to check if it is true, then parse either sidebar or subpage-content!
2.[[[[*back-to-top:is=`yes`:then=`$back-to-top`]]]]
3. [[*show-caption:is=`yes`:then=`$caption`]]
Chunk named Caption:
<p class="flex-caption">[[+caption]]</p>
@brh55
brh55 / gist:55508143fa5516845ba1
Created July 21, 2014 23:54
Dotted CSS Trick to Increase Spacing | Ugly but works #CSS-Tricks
hr {
height:14px; /* specify a height for this hr */
overflow:hidden;
}
hr:after {
content:".......................................................................";
letter-spacing: 4px; /* Use letter-spacing to increase space between dots*/
}
@brh55
brh55 / html
Last active August 29, 2015 14:08
Client-Side Stylesheet Replacer with jQuery--Simple, not efficient, but works.
<select name="theme-menu" id="themes" >
<option value="override">Default Theme</option>
<option value="penn-theme">Penn Theme</option>
<option value="neutral-theme">Neutral Theme</option>
</select>
@brh55
brh55 / MODx Selective JS or CSS
Last active August 29, 2015 14:08
Basic MODx Snippet for Selectively Adding JS or CSS
<?php
/**
Parameters:
Required:
$filePath = specify the path of the stylesheet or js file.
Optional:
&fileType = css or js
&runLocation = (default is head), user can specify ending of body tag
@brh55
brh55 / Help
Created November 9, 2014 23:41
Logical Proofs Tips and Help
Useful Tools
http://i.stack.imgur.com/hWRW9.png
Tips:
1. Start Backwards, What do you need to get this by itself...
2. Apply as many rules as possible until you see a noticable pattern.
3. Rules of implication will get your proof moving, but you need to use reference rules to set up for implications.
4. Understand that the Addition rule is your best friend, you can construct needed parts with it.
5. Understand the relationship between DN, DM, and how you can use it in conjunction with simplification rule.
@brh55
brh55 / gist:b981e0ad4115bf436978
Created April 3, 2015 02:42
Useful npm shortcuts
//Automatically Add Packages to package.json and add version number
npm install express --save
@brh55
brh55 / gist:82269e2a5bf2e2ee607e
Last active August 29, 2015 14:22
Picture Element + WEBP + Using source element.type to use browser checking
WEBP = Better compression then JPEG
Use picture element for art direction.
Browser checking if it supports a source type
<picture>
<source type="image/webp">
<!-- fall back -->
</picture>
@brh55
brh55 / gist:06962cc21314e598b998
Last active August 29, 2015 14:25
Simple Command and Reply Slack Bot
module.exports = require('node-slackr');
// Set up server dependencies
var express = require('express'),
bodyParser = require('body-parser'),
app = express();
// App usage
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({extended: true}));
@brh55
brh55 / randomforest
Created November 19, 2015 00:59
reddit analytics
// TODO: Will like to get back to this if I have time.
// Goal would be to iterate through with a instance set containing different days and MostComments and Score. Then suggest the day with greatest probability based on model.
// if (model.postList.length > 0) {
// var forest = new forestjs.RandomForest();
// var options = {}
// options.numTrees = 100;