A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.
One-line version to paste in your DevTools
Use $$ if your browser aliases it:
~ 108 byte version
| import { Http, ResponseContentType } from '@angular/http'; | |
| ... | |
| constructor( | |
| private http: Http, | |
| ) { } | |
| downloadFile() { | |
| return this.http | |
| .get('https://jslim.net/path/to/file/download', { |
| Latency Comparison Numbers (~2012) | |
| ---------------------------------- | |
| L1 cache reference 0.5 ns | |
| Branch mispredict 5 ns | |
| L2 cache reference 7 ns 14x L1 cache | |
| Mutex lock/unlock 25 ns | |
| Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
| Compress 1K bytes with Zippy 3,000 ns 3 us | |
| Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
| Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
| server { | |
| # Redirect any subdomain to the root domain | |
| # to be captured by next server block | |
| server_name *.example.com; | |
| return 301 $scheme://example.com$request_uri; | |
| } | |
| server { | |
| root /var/www; | |
| index index.html index.htm; |
| On my Ubuntu machine I located the GeoIP.dat file. If not available then download/intall the same. | |
| root@localhost:~# locate GeoIP.dat | |
| /usr/share/GeoIP/GeoIP.dat | |
| Open Nginx configuration (/etc/nginx/nginx.conf) and specify <geoip_country> <path to GeoIP.dat> | |
| line under the "http" block. Example block: | |
| http { | |
| # SS - meant to find country code from the client IP |