Skip to content

Instantly share code, notes, and snippets.

Avatar
☠️
Rockin' and/or Codin'

Lee Brandt leebrandt

☠️
Rockin' and/or Codin'
View GitHub Profile
View secureFetch.js
import config from '../app.config.js';
export default async (uri, options) => {
options = options || {};
let token = JSON.parse(localStorage.getItem('token'));
if (!token || (new Date()) - (new Date(token.expiresAt)) < 30) {
await getAccessToken();
token = JSON.parse(localStorage.getItem('token'));
}
View time.picker.directive.js
(function () {
var timePicker = function () {
return {
restrict: 'E',
replace: true,
require: 'ngModel',
scope:{},
template: '<input type="text" />',
link: function (scope, elem, attrs, ctrl) {
View gist:7a01aa40162ab61899d6
/**
* Media Queries
* Allows you to use inline media queries.
* @link http://jakearchibald.github.com/sass-ie/
* @param {String} $breakpoint - breakpoint
* @param {String} $query (min-width) - query type
* @param {String} $type (screen) - media type
* @example scss
* .foobar { @include mq(20em) { ... } }
*/
View gist:97a10996827fd99d28af
var firstNames = ["Joe", "Dave", "Alice", "Bob", "Tom", "Doug", "Alex", "Stephanie", "Tracy", "Xander", "Zelda"];
var lastNames = ["Andersen", "Baldwin", "Crockett", "Davis", "Davidson", "Eastman", "Young", "Rogers", "McArty", "DeVito"];
for(i=0;i<1000;i++) {
var student = {
"student_id" : i,
"firstName" : firstNames[getRandomNumberUpTo(firstNames.length - 1)],
"lastName" : lastNames[getRandomNumberUpTo(lastNames.length - 1)],
activity: []
View index.html
<html ng-app="KickStart">
<head>
<title>Angular Kick-Start</title>
</head>
<body>
Index Page Content
<div ng-view></div>
</body>
<script src="vendor/angular/angular.min.js"></script>
<script src="app.js"></script>
View gulpfile.js
var gulp = require('gulp'),
connect = require('gulp-connect');
gulp.task('connect', function(){
connect.server({
root: 'app',
livereload: true
});
});
View gist:492587
public class StructureMapControllerFactory : DefaultControllerFactory
{
protected override IController GetControllerInstance(RequestContext requestContext, System.Type controllerType)
{
IController result = null;
try
{
if (controllerType == null) return base.GetControllerInstance(requestContext, controllerType);
result = ObjectFactory.GetInstance(controllerType) as Controller;