Skip to content

Instantly share code, notes, and snippets.

View christophermina's full-sized avatar

Christopher Mina christophermina

  • CMConsulting LLC
  • Boulder, CO
View GitHub Profile
@christophermina
christophermina / gist:4138574
Created November 24, 2012 05:39
Example function for R support
line.plot.fun<-function(data1, space.columns=1,
num.major.horiz=4,
num.major.verts=5,
x.unit="Month of Year",
new.x.vals=FALSE,
line.width=3,
line.type=1, ylab="set y label in params",
xlab="Month of year",
@christophermina
christophermina / gist:4138575
Created November 24, 2012 05:39
Example function for R support
line.plot.fun<-function(data1, space.columns=1,
num.major.horiz=4,
num.major.verts=5,
x.unit="Month of Year",
new.x.vals=FALSE,
line.width=3,
line.type=1, ylab="set y label in params",
xlab="Month of year",
public class Global : System.Web.HttpApplication
{
private static MSLogger log = MSLogger.GetLogger(typeof(Global));
public Global()
{
}
var request = require('request');
request.get(slConfigs.SL_AUTH_URL_V1, {
headers: {
'X-Auth-User':slConfigs.SL_STORAGE_USERNAME,
'X-Auth-Key':slConfigs.SL_STORAGE_PASS
}
}, function(err, value) {
if (value.statusCode == 200) {
var token = value.headers['x-auth-token'];
_getClient: function() {
return pkgcloud.storage.createClient({
provider: 'openstack',
username: slConfigs.SL_STORAGE_USERNAME,
password: slConfigs.SL_STORAGE_PASS,
authUrl: slConfigs.SL_STORAGE_AUTH_URL,
version: 1,
useServiceCatalog: false
});
}
var post = request.post(storageUrl, {
headers: {
'X-Auth-User': slConfigs.SL_STORAGE_USERNAME,
'X-Auth-Token': token,
'X-Account-Meta-Temp-Url-Key': slConfigs.SL_TEMP_URL_KEY
}
}, function(err, value) {
if (value.statusCode == 204) {
return fn(null, "OK")
getSignedRequest: function(container, resourceKey, expirationTimeInSeconds, fn) {
if (_.isFunction(expirationTimeInSeconds)) {
fn = expirationTimeInSeconds;
expirationTimeInSeconds = 3600;
}
if (process.env.SL_STORAGE_URL == null) {
request.get(slConfigs.SL_STORAGE_AUTH_URL_V1, {
headers: {
'X-Auth-User':slConfigs.SL_STORAGE_USERNAME,
define([
'bower_packages/ocLazyLoad/dist/ocLazyLoad'
], function() {
var module = angular.module('mainApp', ['oc.lazyload']);
module.config(['$ocLazyLoadProvider', function ($ocLazyLoadProvider) {
$ocLazyLoadProvider.config({
loadedModules: ['mainApp'],
asyncLoader: require
define([
'/path/to/a/dependency'
], function(myDependcy) {
var module = angular.module('asyncModule', [myDependency.name]);
module.directive('asyncDirective', ['$http'', function($http) {
return {
link: function(scope, element, attrs) {
var lastHeights = [];
var i;
for (i = 0; i < this.numColumn; i++) {
lastHeights[i+1] = this.gapMargin;
}
if (cardElems.length > 0) {
var x
, y
, l