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
MyModule.directive('tabindex', function () { | |
return { | |
restrict: 'A', | |
link: function (scope, elem, attr, ctrl) { | |
if (attr.tabindex == 1) { | |
elem.focus(); | |
} | |
} | |
}; | |
}); |
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
# DESCRIPTION | |
# Performs the commands needed to download and set up a new angular2 project using typescript and jspm | |
# | |
# Assumes you have these: | |
# - git | |
# - node / io.js | |
# - npm | |
# - npm install -g jspm@beta **NOTE**: you must have the beta release of jspm installed | |
# | |
# USAGE |
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
// This module loads a config file in the current working directory matching the NODE_ENV variable. | |
// I.e. either './development.js' or './production.js' based on the process.env.NODE_ENV variable. | |
// If not set, it defaults to './development.js'. | |
// Can load custom environment files as well, as long as the NODE_ENV variable matches | |
// a file in the current directory. E.g. './staging.js' | |
// Usage: calling code can just require this module, e.g. "var config = require('./config')" | |
// assuming this file is named "index.js" and lives in a subdirectory named "config" of the app root. | |
var config | |
, config_file = './' + (process.env.NODE_ENV ? process.env.NODE_ENV : 'development') + '.js'; |
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
#!/usr/bin/env bash | |
# global parameters | |
g_tmp_folder="ncdc_tmp"; | |
g_output_folder="ncdc_data"; | |
g_remote_host="ftp.ncdc.noaa.gov"; | |
g_remote_path="pub/data/noaa"; | |
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
\usepackage{authblk} | |
\title{\mytitle} | |
\author[*]{\myauthor} | |
\affil[*]{\affiliation} | |
% To remove the date | |
\date{} | |
\begin{document} |
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
package transactions | |
import com.twitter.finagle.exp.mysql.{Client, OK, Result} | |
class Db(mysqlClient: Client) { | |
val insertOrder = "INSERT INTO orders (ref) VALUES(?)" | |
val insertOrderItem = "INSERT INTO order_items (order_id, item_id) VALUES(?, ?)" | |
def persistOrderWithItems[T](order: Order)(whenDone: (OK, Seq[Result]) => T): Future[T] = { |
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
#!/bin/bash | |
ver=2.3.1 | |
jar=swagger-codegen-cli-$ver.jar | |
md5=c838c266b80401ecd43521890b4abea8 | |
repo="http://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/$ver/$jar" | |
if [ ! -f $jar ]; then | |
echo "[info] downloading $PWD/$jar from $repo" 1>&2 | |
if ! curl --location --silent --fail --remote-name $repo -o $jar; then |
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
import util.parsing.json.JSON | |
import io.Source | |
import scala.language.dynamics | |
object Example extends App{ | |
val json = """{ | |
"name" : "Adam Slodowy", | |
"active": "true", | |
"roles" : [ "teacher", "admin" ], |
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 express = require('express'), | |
passport = require('passport'), | |
TwitterStrategy = require('passport-twitter').Strategy, | |
ensureLoggedIn = require('connect-ensure-login').ensureLoggedIn, | |
app = express(); | |
app.use(express.static(__dirname + '/public')); | |
app.use(express.cookieParser()); | |
app.use(express.session({ secret: 'keyboard cat' })); | |
app.use(passport.initialize()); |
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
#!/usr/bin/env bash | |
#### | |
# Save as openapi-generator-cli on your PATH. chmod u+x. Enjoy. | |
# | |
# This script will query github on every invocation to pull the latest released version. | |
# If you want repeatable executions, you can explicitly set a version via | |
# OPENAPI_GENERATOR_VERSION | |
# e.g. | |
# export OPENAPI_GENERATOR_VERSION=3.1.0 | |
# openapi-generator-cli.sh |
OlderNewer