Skip to content

Instantly share code, notes, and snippets.

View adamweeks's full-sized avatar

Adam Weeks adamweeks

View GitHub Profile
@adamweeks
adamweeks / 0_reuse_code.js
Created January 29, 2014 19:24
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
<!DOCTYPE html>
<html ng-app="demo">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js"></script>
<meta charset="utf-8">
<title>Angular Demo</title>
</head>
<body ng-controller="DemoController as demo">
<p>demo.welcome: {{demo.welcome}}</p>
<p>Name: <input ng-model="demo.inputValue"></p>
<!DOCTYPE html>
<html ng-app="demo">
<head>
<script src="https://code.jquery.com/jquery.min.js"></script>
<link href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet" type="text/css" />
<script src="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js"></script>
<meta charset="utf-8">
<title>Angular Demo</title>
</head>
@adamweeks
adamweeks / directive.spec.js
Last active August 29, 2015 14:24
Angular Directive Unit Test Template
'use strict';
describe('My Great Directive', function() {
var $rootScope;
var $controller;
var $window;
var $httpBackend;
var $compile;
var scope;
var MyFancyService
@adamweeks
adamweeks / ServiceTemplate.js
Created September 29, 2015 15:52
Angular Service Template for Webstorm
(function() {
'use strict';
angular.module('${moduleName}', [])
.service('${serviceName}', [${serviceName}]);
function ${serviceName}() {
var service = this;
}
})();
@adamweeks
adamweeks / UIImage+UIColor.h
Created July 27, 2013 19:03
This is a simple UIImage category for creating an image based on a UIColor
//
// UIImage+UIColor.h
//
// Created by Adam Weeks on 7/27/13.
// Copyright (c) 2013 AppsVersusRobots, LLC. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UIImage (UIColor)
@adamweeks
adamweeks / gist:6166059
Last active December 20, 2015 17:08
Simulating network latency.
NSInteger delayTime = 2;
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, delayTime * NSEC_PER_SEC), dispatch_get_current_queue(), ^{
[self updateViewWithData];
});
@adamweeks
adamweeks / javascript.json
Created January 15, 2016 16:15
ESLint Disable Line snippet for VS Code
{
"ESLint Disable Line": {
"prefix": "eslignore",
"body": [
"//eslint-disable-line"
],
"description": "Disable ESLint for the given line"
}
}
@adamweeks
adamweeks / package.json
Created January 21, 2016 19:59
NPM Script to eslint against staged changes
"scripts": {
"eslint": "eslint -c .eslintrc $(git diff --staged --diff-filter=ACMTUXB --name-only -- '*.js'); exit 0"
}

Keybase proof

I hereby claim:

  • I am adamweeks on github.
  • I am adamweeks (https://keybase.io/adamweeks) on keybase.
  • I have a public key whose fingerprint is 4711 16EE 3DDE 01D9 36FE 7E11 749D 236F BECA CB30

To claim this, I am signing this object: