Skip to content

Instantly share code, notes, and snippets.

View joshdmiller's full-sized avatar

Josh David Miller joshdmiller

View GitHub Profile
@joshdmiller
joshdmiller / dropdown-menu-dom.html
Last active August 29, 2015 14:05
Code Samples from the Article "The AngularJS Way"
<ul class="main-menu">
<li class="active">
<a href="#/home">Home</a>
</li>
<li>
<a href="#/menu1">Menu 1</a>
<ul>
<li><a href="#/sm1">Submenu 1</a></li>
<li><a href="#/sm2">Submenu 2</a></li>
<li><a href="#/sm3">Submenu 3</a></li>
@joshdmiller
joshdmiller / PKGBUILD
Created July 21, 2015 05:45
ttf-monoid-git
# Maintainer: Adrián Pérez de Castro <aperez@igalia.com>
pkgname='ttf-monoid-git'
pkgdesc='Open Source coding font'
pkgver=r292.164cfa9
pkgrel=1
arch=('any')
license=('custom:MIT')
url='http://andreaslarsen.github.io/monoid/'
source=("${pkgname}::git://github.com/andreaslarsen/monoid.git"
'fontbuilder-python3.patch')
@joshdmiller
joshdmiller / a.js
Last active August 29, 2015 14:27
Pesudocode Concept: Dependency Injection with Stampit and ES6
import B from './b';
import C from './c';
const A = stampit()
.static({ $inject: [ B, C ] })
.init( ({ instance, args }) => {
let [ instance._b, instance._c ] = args;
})
.methods({
doSomething () {
--- PKGBUILD.old 2012-11-09 12:36:25.000000000 -0800
+++ PKGBUILD 2012-11-22 13:49:32.577936391 -0800
@@ -9,21 +9,19 @@
license=('cc-by-nc-sa-3.0')
arch=('any')
depends=('gnome-shell')
-makedepends=('unzip')
+makedepends=('wget' 'unzip')
optdepends=('gnome-shell-extension-user-theme: User Theme extension for GNOME Shell'
'gnome-tweak-tool: A tool to customize advanced GNOME 3 options.')
service.factory('userService', [ '$http', function($http) {
return {
go : function( user ) {
console.log('Executing ' + this.request);
return $http.post( '/api/login', user );
}
};
} ]);
@joshdmiller
joshdmiller / Gruntfile.js
Last active December 12, 2015 01:49
This is a Grunt 0.4 task for AngularJS projects. It facilitates the automatic compiling of HTML templates to pure JavaScript through AngularJS's `$templateCache`, so these files can be downloaded as part of an initial app payload. This is based on the Grunt 0.3.x version from angular-ui/bootstrap.
module.exports = function ( grunt ) {
// Load required Grunt tasks
// ...
grunt.loadTasks('build'); // <- place grunt-html2js in this folder
// Project Configuration
grunt.initConfig({
distdir: 'dist',
src: {
@joshdmiller
joshdmiller / Gruntfile.js
Last active December 12, 2015 07:58
A Grunt 0.4 build system for modularized AngularJS projects.
/**
* A Boilerplate Grunt ~0.4.0 build system for AngularJS projects
*
* Licensed MIT
*/
module.exports = function ( grunt ) {
// Load required Grunt tasks
grunt.loadNpmTasks('grunt-recess');
grunt.loadNpmTasks('grunt-contrib-clean');
@joshdmiller
joshdmiller / UserService.js
Created March 15, 2013 20:27
A starting point for an $http-backed RESTful model in AngularJS.
.factory( 'UserService', [ '$http', function ( $http ) {
var url = '/api/users';
/**
* This is the private API.
*/
// get a list of users
function query () {
return $http.get( url );
@joshdmiller
joshdmiller / github.sh
Created September 13, 2013 19:20
A little helper for creating new Git repositories with GitHub.
#!/bin/bash
###
# Usage: github.sh my-repo-name
###
# Configuration
username="joshdmiller"
readme="README.md"
commit_msg="chore(*): initial commit"
@joshdmiller
joshdmiller / index.html
Created January 26, 2016 22:58
React Essentials
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name=viewport content="width=device-width,initial-scale=1">
<title>React App Template</title>
<link rel="stylesheet" href="/app.css" />
</head>
<body>