Skip to content

Instantly share code, notes, and snippets.

View scottwernervt's full-sized avatar

Scott Werner scottwernervt

View GitHub Profile
"""
Non blocking example:
1. Browse to `localhost:8000/sleep1`
2. Browse to `localhost:8000/`
You'll observe that the first call will take 5 seconds and the second call will be executed immediately.
Blocking example:
1. Browse to `localhost:8000/sleep2`
2. Browse to `localhost:8000/`
@scottwernervt
scottwernervt / remove-advertisers.js
Created May 1, 2019 01:14 — forked from bluetidepro/remove-advertisers.js
Auto click "remove" on all facebook advertisers
// I did this in Chrome...
//
// Go to https://www.facebook.com/ads/preferences/
// Click the "Advertisers" section to open it up.
// Click "See more" once
// Before doing anything else, just keep clicking space bar to trigger the "see more" button
// Do this for a bit until all the advertisers are loaded
// then run this below in the dev tools console...
// (It will take a few minutes, depending how many you have, and your browser may lock up, but once it's done you will see it auto clicked the "remove" X in the top right for all of them)
@scottwernervt
scottwernervt / adapters.application.js
Last active September 21, 2018 13:51 — forked from samselikoff/mirage.config.js
MS with Ember nice URL slugs and link to helper
import DS from 'ember-data';
export default DS.JSONAPIAdapter.extend({
namespace: 'api'
});
@scottwernervt
scottwernervt / adapters.application.js
Created May 24, 2017 20:38 — forked from openhouse/adapters.application.js
ember-infinity+ember-group-by
import DS from 'ember-data';
export default DS.RESTAdapter.extend({
shouldBackgroundReloadRecord() { return false; }
});
@scottwernervt
scottwernervt / controllers.application.js
Last active July 29, 2016 15:05 — forked from initram/controllers.application.js
aupac-typeahead - bug - allowFreeInput=true fires action when clicking off input
import Ember from 'ember';
const skills = ['Python', 'Javascript', 'Django']
export default Ember.Controller.extend({
skill: null,
skillSource: function(query, syncResults, asyncResults) {
const regex = new RegExp('.*' + query + '.*', 'i');
const results = skills.filter((item, index, enumerable) => {
return regex.test(item);