This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.core.management.base import BaseCommand | |
from django.core import management | |
from django.conf import settings | |
from django.db import models | |
from importlib import import_module | |
from django.core.management.base import CommandError | |
from django.contrib.auth.models import User | |
from django.utils.six.moves import input | |
class Command(BaseCommand): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import datetime | |
from south.db import db | |
from south.v2 import SchemaMigration | |
from django.db import models | |
from django.db.models import get_app, get_models | |
class Migration(SchemaMigration): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
img.responsive-image { | |
padding: 50%; /*controls the ratio of the image. 37.5% 50% would be a 4 x 3 image*/ | |
width: 0; | |
height:0; | |
background-size: cover; | |
background-position: center center; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var mod = angular.module('CacheView', []); | |
function addScope(child, parent){ | |
child.$parent = parent; | |
child.$$prevSibling = parent.$$childTail; | |
if(child.$$prevSibling) child.$$prevSibling.$$nextSibling = child; | |
parent.$$childTail = child; | |
if(!parent.$$childHead) parent.$$childHead = child; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const webpack = require('webpack'); | |
const HtmlWebpackPlugin = require('html-webpack-plugin'); | |
module.exports = function(env) { | |
// merge together build and environment variables | |
// to be made available in process.env | |
const processEnv = Object.assign({}, env, require('./env.' + env.NODE_ENV)); | |
// define our entries | |
const entries = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<base href="/"> | |
<title>James Friedman: UX / UI Design and Dev Consulting</title> | |
<!--EXPRESSION--> | |
<!--This is the magic inline ejs expression--> | |
<% if (~process.env.BUILD_ENV.search('optimized')) { %> | |
<style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//explicit set of loaders | |
//use a leading '!' to short circuit any loader rules in the main webpack config. | |
require('!style-loader!css-loader!sass-loader!./styles/main.scss'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "jamesmfriedman", | |
"version": "1.0.0", | |
"description": "James Friedman", | |
"main": "index.js", | |
"scripts": { | |
"start": "webpack-dev-server --inline --hot --host 0.0.0.0 --port 8080 --env.BUILD_ENV dev --env.NODE_ENV dev", | |
"dev": "npm start", | |
"dev:min": "webpack-dev-server --inline --hot --host 0.0.0.0 --port 8080 --env.BUILD_ENV 'dev optimized' --env.NODE_ENV dev", | |
"clean-dist-folder": "rm -R ./public && mkdir ./public", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Current Adapter Example | |
* This is a simple adapter, some are extremely complex... | |
* It is not immediately obvious why some code lives in the adapter and some in the foundation | |
* The Select alone is over 700 lines of component logic... | |
**/ | |
MDCCheckboxFoundation({ | |
addClass: (className) => this.root_.classList.add(className), | |
removeClass: (className) => this.root_.classList.remove(className), | |
setNativeControlAttr: (attr, value) => this.nativeCb_.setAttribute(attr, value), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rm -rf temp \ | |
&& mkdir temp \ | |
&& git mv src/* temp \ | |
&& find ./temp -name '*' -type f -exec sh -c "echo '{}' \ | |
| sed 's/\([a-z]\)\([A-Z]\)/\1-\2/g'\ | |
| sed 's/\([A-Z]\{2,\}\)\([A-Z]\)/\1-\2/g' \ | |
| sed 's/\.ts$/\.tsx/g' \ | |
| sed 's/\.\/temp/\.\/src/g' \ | |
| tr '[:upper:]' '[:lower:]' \ | |
| xargs -I newName sh -c 'dirname newName | xargs mkdir -p && git mv --force {} newName' |