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 isSameDay = function (thisEntry, lastEntry) { | |
var endTime = moment('6:00am', 'h:mma'); | |
if (lastEntry.isSame(thisEntry, 'day')) { | |
// Same day, but time has passed 6am since last click, in other words: new day | |
return !(thisEntry.isAfter(endTime) && lastEntry.isBefore(endTime)); | |
} else if (lastEntry.isSame(thisEntry.subtract(1, 'days'))) { | |
// Last entry was yesterday, but after 6am, and this entry is before 6am, therefore within the same night | |
return thisEntry.isBefore(endTime) && lastEntry.isAfter(endTime); | |
} |
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
Meteor.startup(function() { | |
if (Meteor.settings && Meteor.settings.public && Meteor.settings.public.DISABLE_AUTO_RELOAD) { | |
Meteor._reload.onMigrate(function(reloadFunction) { | |
return [false]; | |
}); | |
} | |
}); |
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 collections | |
posts: | |
pattern: 'posts/**.html' | |
sortBy: 'date' | |
reverse: true | |
.use branch('posts/**.html').use( | |
permalinks(pattern: 'writings/:title', relative: false) | |
) |
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
/* | |
github.com style (c) Vasily Polovnyov <[email protected]> | |
*/ | |
.hljs { | |
display: block; | |
overflow-x: auto; | |
padding: 0.5em; | |
color: #333; | |
background: #f8f8f8; |
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
<div class="code-tabs"> | |
```objc | |
NSLog(@"Some string"); | |
``` | |
```swift | |
var sortedStrings = sorted(stringArray) { | |
$0.uppercaseString < $1.uppercaseString | |
} |
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
<?php | |
$categories = get_terms("worktype", array( | |
"orderby" => "count", | |
"order" => "DESC" | |
)); | |
function get_next_post_with_thumbnail($posts, $index) { | |
if($index == count($posts)) { | |
return null; |
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
/* | |
jQuery plugin for drawing a svg line as you scroll. | |
@author Johan Brook, for Lookback (2014). | |
Options: | |
startAt: The reference point to start calculating from. Expects a selector. | |
speed: at which speed the line should draw. | |
offset: the offset of which the reference point should be. |
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
public static int recursiveDollCounter(Doll doll) { | |
if(doll.isCore()) { | |
return 0; | |
} | |
else { | |
doll.removeOuterLayer(); | |
return recursiveDollCounter(doll) + 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
/* | |
* Parses a human readable duration on the form | |
* and return the total duration in seconds. | |
* | |
* @param {string} - Timestamp on the form XhYmZs. Unit | |
* parts are optional: 3h2s, 3m1s, 4h2m | |
* are all valid. | |
*/ | |
function parseTimestamp(timestamp) { |
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
I20140909-09:52:55.345(2) (lookback-intercom.js:17) Team with id: 6rQxyHw22iNM7cZqJ updated at Intercom. | |
I20140909-09:53:13.111(2)? Tue, 09 Sep 2014 07:53:13 GMT intercom.io Requesting [POST] users with data %o { user_id: 'mWabDbGhq8jYowvzv', | |
I20140909-09:53:13.112(2)? email: '[email protected]', | |
I20140909-09:53:13.113(2)? name: 'Dummy User8', | |
I20140909-09:53:13.113(2)? created_at: Tue Sep 09 2014 09:53:13 GMT+0200 (CEST), | |
I20140909-09:53:13.113(2)? sign_up_source: 'invite', | |
I20140909-09:53:13.114(2)? created_via: 'web', | |
I20140909-09:53:13.114(2)? companies: [ { id: '6rQxyHw22iNM7cZqJ', pending_invitations: 0 } ] } | |
I20140909-09:53:14.297(2)? Tue, 09 Sep 2014 07:53:14 GMT intercom.io Recieved response {"intercom_id":"540eb1ea2c1d79704a000b05","email":"[email protected]","user_id":"mWabDbGhq8jYowvzv","name":"Dummy User8","created_at":1410249193,"last_impression_at":1410249194,"custom_data":{"sign_up_source":"invite","created_via":"web"},"social_profiles":[],"location_data":{"city_name":"Gothen |