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
function dir(o, d){ | |
var s = ''; | |
var t = d || ''; | |
console.log('|' + t + '|'); | |
for(var p in o){ | |
if(typeof o[p] == 'object'){ | |
l = (Object.prototype.toString.call(o[p]) === '[object Array]') ? '[array]' : '[object]'; | |
s += t + p + ': ' + l + '\n'; | |
s += dir(o[p], t + ' ') | |
}else{ |
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 java.io.File; | |
import java.io.FileWriter; | |
import java.io.BufferedWriter; | |
import java.io.FileInputStream; | |
import java.io.FileOutputStream; | |
import java.io.IOException; | |
import java.nio.ByteBuffer; | |
import java.nio.file.Files; | |
import java.nio.file.Paths; | |
import java.nio.charset.StandardCharsets; |
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
['$filter', function($filter){ | |
return function(array, expression, comparator){ | |
var filterIf = function(check){ | |
var filtered = []; | |
for(var i=0; i < array.length; i++){ | |
var value = array[i]; | |
if(check(value)){ | |
filtered.push(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
.check{ | |
display:inline-block; | |
height:1.4em; | |
width:1.4em; | |
border-radius:.7em; | |
border:solid 1px #aaa; | |
box-shadow:inset 0px 0px 2px #aaa; | |
padding:1px; | |
margin:0em .5em; | |
vertical-align:middle; |
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
define([ | |
], function ( | |
) { | |
return [function formValidator() { | |
return { | |
require: '^form', | |
scope: { | |
formData: '=', | |
validateAll: '=' | |
}, |
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
function(){ | |
var | |
MIN_IMAGE_RESOLUTION = 800, | |
MAX_CANVAS_SIZE = 375 | |
; | |
return { | |
restrict: 'E', | |
scope: { | |
showMessage: '&onmessage', | |
api: '=' |
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
/* | |
Author: Trevor | |
Date: 2015.03.27 | |
A mock database class. All models should inherit from mdb.MockModel | |
mdb.Get<T>(Guid id) | |
- Returns the model with an id matching 'id' from the mock database | |
mdb.All<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
function isRelative(url){ | |
if (/^(((file:|https?:)?\/\/?)?[a-z0-9][a-z0-9-]*(\.([a-z0-9-]*[a-z0-9]))+(:\d+)?|((file:|https?:)?\/\/\/?[a-z0-9][a-z0-9-]*(\.([a-z0-9-]*[a-z0-9]))*))+(:\d+)?/i.test(url)) return false; | |
return true; | |
if(!url) return true; | |
if(/^\/\/[^\/]+\.[^\/]/.test(url)) return false; | |
if(/^\/\/\/[^\/]+/.test(url)) return false; | |
if(/^https?:\/\//.test(url)) return false; | |
var dot = url.indexOf('.'), | |
slash = url.indexOf('/'); |
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
def get(self, key, fallback): | |
if key == None: | |
return fallback | |
else: | |
node = self.obj | |
keys = key.split('.').reverse() | |
while(len(keys)): | |
k = keys.pop() |
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
using System; | |
using System.Collections.Generic; | |
using System.Drawing; | |
using System.Drawing.Drawing2D; | |
using System.Drawing.Imaging; | |
using System.IO; | |
using System.Linq; | |
using System.Text.RegularExpressions; | |
namespace ThumbnailGenerator |
OlderNewer