Skip to content

Instantly share code, notes, and snippets.

View sakthiinfotec's full-sized avatar

Sakthivel Murugasamy sakthiinfotec

View GitHub Profile
@sakthiinfotec
sakthiinfotec / DownloadFileComponent.ts
Created November 28, 2024 09:45 — forked from DamienBraillard/DownloadFileComponent.ts
Angular 2+ Download file from API
import { Http, ResponseContentType } from '@angular/http';
...
constructor(
private http: Http,
) { }
downloadFile() {
return this.http
.get('https://jslim.net/path/to/file/download', {
@sakthiinfotec
sakthiinfotec / latency.txt
Created April 23, 2023 14:06 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
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
@sakthiinfotec
sakthiinfotec / README.md
Created February 25, 2016 08:11 — forked from addyosmani/README.md
108 byte CSS Layout Debugger

CSS Layout Debugger

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

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