Skip to content

Instantly share code, notes, and snippets.

Shane Reaume shane-reaume

Block or report user

Report or block shane-reaume

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View NERDTree Shortcuts
# NERDTree
o.......Open files, directories and bookmarks....................|NERDTree-o|
go......Open selected file, but leave cursor in the NERDTree.....|NERDTree-go|
t.......Open selected node/bookmark in a new tab.................|NERDTree-t|
T.......Same as 't' but keep the focus on the current tab........|NERDTree-T|
i.......Open selected file in a split window.....................|NERDTree-i|
gi......Same as i, but leave the cursor on the NERDTree..........|NERDTree-gi|
s.......Open selected file in a new vsplit.......................|NERDTree-s|
gs......Same as s, but leave the cursor on the NERDTree..........|NERDTree-gs|
O.......Recursively open the selected directory..................|NERDTree-O|
View VIM Shortcuts
#Cursor movement
h - move left
j - move down
k - move up
l - move right
ctrl-b - page up
ctrl-f - page down
% - jump to matching brace
w - jump by start of words (punctuation considered words)
@shane-reaume
shane-reaume / mocha-guide-to-testing.js
Last active Sep 23, 2016 — forked from samwize/mocha-guide-to-testing.js
Explain Mocha's testing framework - describe(), it() and before()/etc hooks
View mocha-guide-to-testing.js
// # Mocha Guide to Testing
// Objective is to explain describe(), it(), and before()/etc hooks
// 1. `describe()` is merely for grouping, which you can nest as deep
// 2. `it()` is a test case
// 3. `before()`, `beforeEach()`, `after()`, `afterEach()` are hooks to run
// before/after first/each it() or describe().
//
// Which means, `before()` is run before first it()/describe()
@shane-reaume
shane-reaume / test.njs
Created Sep 29, 2013
Node headless (phantom.js) connection and search with the selenium-webdriver library
View test.njs
var webdriver = require('selenium-webdriver');
var driver = new webdriver.Builder().
withCapabilities(webdriver.Capabilities.phantomjs()).
build();
driver.get('http://www.duckduckgo.com');
driver.findElement(webdriver.By.id('search_form_input_homepage')).sendKeys('nodejs');
driver.findElement(webdriver.By.id('search_button_homepage')).click();
var g = driver.getCurrentUrl();
g.then(function(u) {
console.log("URL is: " + u);
@shane-reaume
shane-reaume / header.php
Created Apr 10, 2013
Bookmark This Page
View header.php
function bookmarkPage(url,title) {
if (!url) {url = window.location}
if (!title) {title = document.title}
var browser=navigator.userAgent.toLowerCase();
if (window.sidebar) { // Mozilla, Firefox, Netscape
window.sidebar.addPanel(title, url,"");
} else if( window.external) { // IE or chrome
if (browser.indexOf('chrome')==-1){ // ie
window.external.AddFavorite( url, title);
} else { // chrome
View allsite.js
/**
* Created By: Shane Reaume
* Date: 12/17/12
* Time: 10:20 AM
*/
/* form filters -Shane */
$(function() {
var yourFacilityinput = $('label:contains("Your Facility")').parent('div').find('input');
@shane-reaume
shane-reaume / js_bottom.js
Last active Dec 15, 2015
Remove attributes then add with mouse or click
View js_bottom.js
(function($){
$('form.ProductReviewForm').attr('action', '')
.attr('method', '');
$(".demo").remove();
$(document).ready(function() {
$('#TopMenu').css({
'border-radius':'0 0 5px 5px'
,'box-shadow':'2px 2px 3px #999999'
});
$('#Menu').css({
@shane-reaume
shane-reaume / testdatapull.php
Created Feb 21, 2013
JSCharts, improve label and tooltip values for larger data with PHP
View testdatapull.php
<?php
$e1 = 1;
$e2 = $e1;
$e3 = --$e2;
while ($e1 <= $counting) {
echo "myChart.setLabelX([".$e1.",'".$e1++."']);";
}
while( $e2 <= $counting ) {
$value = $teststring[$e3++];
@shane-reaume
shane-reaume / footer.php
Created Jan 21, 2013
Copyright start year, and update every year
View footer.php
@shane-reaume
shane-reaume / validation.php
Created Nov 2, 2012
Server-side(PHP) validation of phone number that also prevents multiple of same digit, i.e. all 1's
View validation.php
function phonenumber($value)
{
$areacode = '[2-9]{1}\d{1}\d{1}'; // You might want to specify '2\d\d' (200 to 299)
$prefix = '[2-9]{1}\d{1}\d{1}';
$regex = '#^(\('.$areacode.'\)|'.$areacode.')[\s\.-]?'.$prefix.'[\.-]?\d{4}$#';
if (preg_match($regex, $value))
{
// Number now is in a suitable format
// extract digits -- remove this section to not test repeated pattern
You can’t perform that action at this time.