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 getQueryParams() { | |
var params = []; | |
var query = window.location.search; | |
query = query.slice(1, query.length); | |
var nv = query.split('&'); | |
for (var i = 0; i < nv.length; i++) { | |
var q = nv[i].split('='); | |
params[q[0]] = q[1]; | |
} |
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
'use strict'; | |
app.directive('thumbnail', function($interval){ | |
return { | |
restrict: 'E', | |
scope: { | |
thumbs: '&thumbs', | |
speed: '&speed' | |
}, | |
template: '<div class="thumbnail"><img ng-src="assets/images/thumbnails/{{thumb}}"/></div>', |
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(){ | |
if (typeof MediaSource === typeof undefined){ | |
alert('You must be on FireFox or some old IE bullshit'); | |
} else { | |
alert('You are running a MediaSource API capable browser'); | |
} | |
})(); |
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 lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Document</title> | |
<style> | |
.darklight { | |
background-color: #000; | |
color: #fff; |
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
[*] | |
charset = utf-8 | |
indent_style = space | |
indent_size = 2 | |
end_of_line = lf | |
insert_final_newline = true |
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
export function isDayAnOccurance(day, recurrenceRule) { | |
const rule = RRule.fromString(recurrenceRule); | |
// Convert all dates into UTC before comparison | |
const today = moment(day).utc().startOf('day'); | |
const nextOccurrence = moment(rule.after(today, true)).utc(); | |
const match = moment(nextOccurrence).isSame(today, 'day'); | |
return match; | |
} |
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 S3 = require('aws-sdk').S3; | |
const fs = require('fs'); | |
const body = fs.createReadStream('./my-file.txt'); | |
const s3 = new S3(); | |
s3.upload({ | |
Bucket: 'my-bucket', | |
Key: 'my-directory/my-file.txt', | |
Body: body |
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 React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import App from './App'; | |
import './index.css'; | |
const rootEl = document.getElementById('root'); | |
ReactDOM.render( | |
<App />, | |
rootEl | |
); |
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 getNestedProperty(obj, path) { | |
return path.split('.').reduce(function(prev, next) { | |
return prev ? prev[next] : undefined; | |
}, obj); | |
} |
OlderNewer