Skip to content

Instantly share code, notes, and snippets.

View jtrussell's full-sized avatar

Justin Russell jtrussell

View GitHub Profile
@jtrussell
jtrussell / SharedState.js
Last active December 17, 2015 17:29
Service for sharing state across controllers. Supports a notion of baseline states that can be rolled back to. You can also set (and sync to) new baselines.
angular.module('myModule').factory('SharedState', function($q, $timeout) {
return {
init: function(defaults) {
var payload = {}
, deferred
, self = this;
defaults = defaults || {}; // You can set initial defaults here
var SharedState = function(init_args) {
@jtrussell
jtrussell / gruntfile.js
Created September 13, 2013 19:19
Demo Gruntfile
module.exports = function(grunt) {
grunt.initConfig({
jshint: {
all: 'web_static/js/development/**/*.js'
},
concat: {
scripts: {
src: 'web_static/js/development/**/*.js',
dest: 'web_static/js/production/app.js'
@jtrussell
jtrussell / package.json
Created September 13, 2013 19:26
Demo package.json
{
"name": "iBenchmarks",
"handle": "ibenchmarks",
"version": "7.6.4",
"date": "09/04/2013",
"title": "iBenchmarks",
"homepage": "https://ib.ivantagehealth.com/",
"author": {
"name": [
"iVantage Health Analytics, Inc."
@jtrussell
jtrussell / monitor.yml
Created September 13, 2013 19:39
4Dmon Example Config
monitor:
pulse: 2000
runOnStartup: true
heartbeat:
show: true
colors: true
badStuff:
errorTolerance: 3
@jtrussell
jtrussell / .jshintrc-browser
Last active December 25, 2015 23:09
My jshintrc files for different environments.
{
"predef": ["..."],
"browser": true,
"bitwise": true,
"camelcase": false,
"curly": true,
"eqeqeq": true,
"immed": true,
"latedef": true,
"newcap": true,
@jtrussell
jtrussell / gruntfile.js
Last active December 25, 2015 23:48
Gruntfile and package.json boilerplate for new node modules.
/*global module:false*/
'use strict';
module.exports = function(grunt) {
grunt.initConfig({
jshint: {
options: {
jshintrc: '.jshintrc'
@jtrussell
jtrussell / On_Web_Connection_HOOK.4Dmethod
Last active December 26, 2015 00:29
Proof of concept for pushing external method files back into 4D in real time while integrating with the vc-framework-v13 component.
C_TEXT($1;$2;$url;$headerAndBody)
$url:=$1
$headerAndBody:=$2
If ($url="/_alter_method/@")
C_TEXT($methodPath)
$methodPath:=Replace string($url;"/_alter_method/";"")
C_TEXT($action)
Case of
@jtrussell
jtrussell / .jshintrc-node
Created October 22, 2013 16:36
jshint config for node apps
{
"node": true,
"bitwise": true,
"camelcase": false,
"curly": true,
"eqeqeq": true,
"immed": true,
"latedef": true,
"newcap": true,
"noarg": true,

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@jtrussell
jtrussell / index.html
Last active August 12, 2019 15:05
jsbin - AngularJS, basic template
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Angular JS</title>
</head>
<body ng-app="jsbin">
<div ng-controller="DemoCtrl as demo">
<h1>Hello {{demo.name}}</h1>
</div>