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 bookmarksExportToCsv() { | |
/** | |
* Inspired by https://gist.github.com/iamandrewluca/9e46589f42545446fa387ac193c43634 | |
* 1. Export bookmarks from Pocket as HTML | |
* 2. Open exported html file again in the browser | |
* 3. Copy paste this entire file in console, and execute it (hit enter) | |
* 4. You will be prompted to save a CSV file. Save it. | |
* 5. Open Notion. Click Import -> CSV | |
* 6. Select saved CSV file. Wait for import | |
* 7. You have a new database with all your bookmarks |
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
/* Pledgeup.contact table: convert Unix timestamp to created_at timestamp, | |
select only rows that have expressed interest */ | |
WITH first_query AS | |
(SELECT FROM_UNIXTIME(property_pledgeup_interest/1000), '%Y-%m-%d %T UTC') | |
AND | |
SELECT * | |
FROM pledgeup.contact | |
WHERE property_pledgeup_interest IS NOT 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
it('should be able to select a TodoModel', () => { | |
const collection = new TodoCollection(); | |
const selectedTodos = new TodoCollection(); | |
const listView = new ListView({collection, selectedTodos}); | |
const model = new TodoModel(); | |
listView.select(model); // Works great! | |
expect(listView.isSelected(model)).toBe(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
const App = new Application(); | |
App.selectedTodos = new Backbone.Collection(); | |
// List Route | |
const collection = new TodoCollection(); | |
collection.fetch().then(() => { | |
const listView = new ListView({ | |
collection, | |
selectedTodos: App.selectedTodos | |
}).render(); |
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
it('should be able to select a TodoModel', () => { | |
const collection = new TodoCollection(); | |
const listView = new ListView({collection}); | |
const model = new TodoModel(); | |
listView.select(model); // Throws exception - App is not defined! | |
}); |
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 App = new Application(); | |
App.selectedTodos = new Backbone.Collection(); | |
// List Route | |
const collection = new TodoCollection(); | |
collection.fetch().then(() => { | |
const listView = new ListView({collection}).render(); | |
}); | |
// ListView |
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
// Pass a Model class to modify. Will prevent concurrent ajax calls on model instances, instead queueing each call to `save`/`destroy`/`fetch` and running them sequentially. | |
// save/fetch/destroy still return jquery deferred promises so usage shoud not change. | |
function sequentialSyncModel(Model) { | |
function getWrappedMethod(method) { | |
return function() { | |
if (!this._steps) { | |
this._steps = []; | |
} | |
var currentArgs = arguments.length ? Array.prototype.slice.call(arguments, 0) : []; |
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
<script type="text/javascript"> | |
(function() { | |
function customScript() { | |
/* Your custom code */ | |
} | |
if (window.addEventListener) { | |
window.addEventListener("load",customScript,false); | |
} else if (window.attachEvent) { | |
window.attachEvent("onload",customScript); | |
} |
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
<script type="text/javascript"> | |
(function() { | |
function customScript() { | |
/* Your custom code */ | |
} | |
if (window.addEventListener) { | |
window.addEventListener("load",customScript,false); | |
} else if (window.attachEvent) { | |
window.attachEvent("onload",customScript); | |
} |
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
<script type="text/javascript"> | |
(function(){ | |
function customScript() { | |
/* Your custom code */ | |
} | |
if (window.addEventListener) { | |
window.addEventListener("load",customScript,false); | |
} else if (window.attachEvent) { | |
window.attachEvent("onload",customScript); | |
} |
NewerOlder