Skip to content

Instantly share code, notes, and snippets.

View tbergeron's full-sized avatar
😠
Microsoft's acquisition of GitHub won't change a thing? Oh dear irony.

Tommy Bergeron tbergeron

😠
Microsoft's acquisition of GitHub won't change a thing? Oh dear irony.
View GitHub Profile
1mg
4Music
60 Minutes
60 Minutes Australia
A&E
ABC
ABC News
ABC News (Australia)
ABP NEWS
ABS-CBN News
@tbergeron
tbergeron / History|-10a7e2d2|entries.json
Last active December 15, 2022 12:39
vscode settings sync
{"version":1,"resource":"file:///Users/anon/Workshop/cockfighting/cockfighting-frontend/autoload/TweenEx.gd","entries":[{"id":"QzXA.gd","timestamp":1661879350449}]}
Here's the whole thing for `λ npm list > output.log`
```
podcast-player@ C:\Users\anon\Desktop\Workshop\podcast-player-frontend
+-- @angular/common@4.1.3
+-- @angular/compiler@4.1.3
+-- @angular/compiler-cli@4.1.3
| +-- @angular/tsc-wrapped@4.1.3
| | `-- tsickle@0.21.6
| | +-- minimist@1.2.0 deduped
@tbergeron
tbergeron / getAvgTime.swift
Last active June 15, 2022 15:09
Calculate average time from multiple NSDate in Swift
func getAvgTime(results: Array<NSDate>) -> String {
var totalHours = 0.0
var totalMinutes = 0.0
var avgTime = ""
// sum all hours & minutes together
for result in results {
let hours = Double(NSCalendar.currentCalendar().component(NSCalendarUnit.Hour, fromDate: result))
let minutes = Double(NSCalendar.currentCalendar().component(NSCalendarUnit.Minute, fromDate: result))
App.EntryAdapter = DS.RESTAdapter.extend({
namespace: 'api/v1',
host: App.APIHost,
headers: function() {
return {
token: this.get('session.token')
};
}.property('session.token')
});
App.EntryAdapter = DS.RESTAdapter.extend({
namespace: 'api/v1',
host: 'http://api.host.org',
headers: {
withCredentials: true,
Authorization: 'Basic ZGVtb0B1c2VyLmNvbTpwYXNzd29yZA=='
}
});
App.Entry = DS.Model.extend({
Ember.Handlebars.helper('format-date', function (date) {
return $.timeago(date);
});
App.EntriesController = Ember.ArrayController.extend({
// sorting
sortProperties: ['createdAt'],
sortAscending: false
});
<script type="text/x-handlebars" id="entries">
<div class="list-group">
{{#each controller}}
{{partial 'entries/single' }}
{{/each}}
</div>
</script>
<script type="text/x-handlebars" id="entries/_single">
{{#link-to 'entry' this class="list-group-item"}}