Since Twitter doesn't have an edit button, it's a suitable host for JavaScript modules.
Source tweet: https://twitter.com/rauchg/status/712799807073419264
const leftPad = await requireFromTwitter('712799807073419264');| # Sample Nginx config with sane caching settings for modern web development | |
| # | |
| # Motivation: | |
| # Modern web development often happens with developer tools open, e. g. the Chrome Dev Tools. | |
| # These tools automatically deactivate all sorts of caching for you, so you always have a fresh | |
| # and juicy version of your assets available. | |
| # At some point, however, you want to show your work to testers, your boss or your client. | |
| # After you implemented and deployed their feedback, they reload the testing page – and report | |
| # the exact same issues as before! What happened? Of course, they did not have developer tools | |
| # open, and of course, they did not empty their caches before navigating to your site. |
Since Twitter doesn't have an edit button, it's a suitable host for JavaScript modules.
Source tweet: https://twitter.com/rauchg/status/712799807073419264
const leftPad = await requireFromTwitter('712799807073419264');| require 'net/http' | |
| require 'json' | |
| require 'uri' | |
| @token = '' | |
| def list_files | |
| ts_to = (Time.now - 30 * 24 * 60 * 60).to_i # 30 days ago | |
| params = { | |
| token: @token, |
| /* bling.js */ | |
| window.$ = document.querySelector.bind(document); | |
| window.$$ = document.querySelectorAll.bind(document); | |
| Node.prototype.on = window.on = function(name, fn) { this.addEventListener(name, fn); }; | |
| NodeList.prototype.__proto__ = Array.prototype; | |
| NodeList.prototype.on = function(name, fn) { this.forEach((elem) => elem.on(name, fn)); }; |
| var Bar1 = base => class extends base { | |
| componentWillMount(){ | |
| super.componentWillMount(); | |
| console.log('Bar1'); | |
| } | |
| }; | |
| var Bar2 = base => class extends base { | |
| componentWillMount(){ | |
| super.componentWillMount(); |
| // HTML: | |
| <div class="display-type"></div> | |
| // CSS: | |
| // set the content of an element depending on the media query |
| @echo off | |
| :: Path to Sublime Text installation dir. | |
| SET stPath=%~dp0sublime_text.exe | |
| SET stPathOnly=%~dp0 | |
| :: Key name for the registry entries. | |
| SET UserEntry=Sublime Text | |
| SET AdminEntry=Sublime Text As Admin | |
| :: Context menu texts. | |
| SET "UserMenuText=Open with Sublime(&-)" | |
| SET "AdminMenuText=Open with Sublime As Admin(&+)" |
| // AMD / Common Js / Browser Wrapper pattern | |
| // copyright to [millermedeiros](https://github.com/millermedeiros/js-signals/blob/master/src/wrapper.js) | |
| // --------------------------------- | |
| (function(global){ | |
| var libName; | |
| // define your library | |
| //exports to multiple environments | |
| if(typeof define === 'function' && define.amd){ //AMD |
When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.
Raw Attribute Strings
<div my-directive="some string" another-param="another string"></div>