Skip to content

Instantly share code, notes, and snippets.

View Hendrixer's full-sized avatar

Scott Moss Hendrixer

View GitHub Profile
@Hendrixer
Hendrixer / angular-2.sublime-syntax
Last active July 30, 2016 12:25
angular 2 syntax for sublime
%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: Angular 2
file_extensions:
- ts
scope: source.ts
contexts:
main:
- include: expression
import * as _ from 'lodash';
import {Config} from '../interfaces';
const ENV: string = process.env.NODE_ENV = process.env.NODE_ENV || 'dev';
let mainConfig: Config = {
};
export const config: Config = _.merge(mainConfig, require(`./${ENV}`).default); // what ever file is required here does not get bundled
* {
box-sizing: border-box;
font-family: 'Raleway', sans-serif;
}
form {
background-color: white;
padding: 20px;
border-radius: 3px;
margin-bottom: 20px;
}
@Hendrixer
Hendrixer / p.bash
Created March 22, 2016 22:26
bash
# Set architecture flags
export ARCHFLAGS="-arch x86_64"
# Ensure user-installed binaries take precedence
PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
# Setting PATH for Python 2.7
PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}"
export PATH
# Changing the colors so the terminal isn't so bland
{
"name": "fem-ng2-simple-app",
"version": "0.0.1",
"license": "SEE LICENSE IN LICENSE",
"repository": {
"type": "git",
"url": "https://github.com/onehungrymind/fem-ng2-simple-app/"
},
"scripts": {
"start": "webpack-dev-server --inline --watch",
@Hendrixer
Hendrixer / newpost.md
Last active June 18, 2016 06:30
its a post

fist things first

  • this is dope
  • this is dope too
const damn: string = 'daaaaamn';
@Hendrixer
Hendrixer / app.js
Created December 3, 2015 20:56
using resolve with components
angular.moudle('app', [])
.config($stateProvider => {
$stateProvider
.state('profile', {
url: '/profile',
template: '<profile-page profile="profile"></profile-page>',
controller(profile, $scope){ // use 'function' if minifying
$scope.profile = profile;
},
resolve: {
@Hendrixer
Hendrixer / app.js
Created July 31, 2015 21:36
ng-teach
angular.module('app', [])
.controller('AppController', function($scope, Todos, Reddit) {
Reddit.getFrontPage()
.then(function(posts) {
$scope.redditPost = posts;
})
$scope.newTodo = '';
$scope.todos = Todos.getState();
$scope.createTodo = function() {
@Hendrixer
Hendrixer / resolve.js
Created June 15, 2015 19:18
using resolve with components ng
angular.module('app', ['ui.router'])
.config(function($stateProvider){
$stateProvider
.state('app', {
url: '/app',
resolve: {
// DataService must be a valid dependecny somewhere
// user any valid service
// data will be the name of the resolved value
data: function(DataService /*, $http, $log, */){
@Hendrixer
Hendrixer / common.js
Last active August 29, 2015 14:15
angular + es6 + jspm + system.js: directive subclassing
import angular from 'angular';
import _ from 'lodash';
let template = `
<div>
<h1>{{ data.title }}</h1>
<div ng-transclude></div>
</div>
`;