Skip to content

Instantly share code, notes, and snippets.

View praisedpk's full-sized avatar

Hamid Sarfraz praisedpk

View GitHub Profile
@mikemix
mikemix / ImaginaryCalendarFinderInterface.php
Created January 9, 2014 22:00
Job interview task solved: day of week calculation
<?php
interface ImaginaryCalendarFinderInterface
{
/**
* @param int $year
* @param int $month
* @param int $day
* @return int
*/
proxy_cache_path /var/cache/nginx levels=2 keys_zone=my_diskcached:50m inactive=365d max_size=7g;
server {
listen 80;
server_name cdn.jsdelivr.net HOSTNAME.jsdelivr.net;
location / {
access_log off;
gzip on;
gzip_min_length 100;
gzip_types text/plain text/xml application/xml text/css text/javascript application/javascript application/x-javascript text/x-component application/json application/xhtml+xml application/rss+xml application/atom+xml application/vnd.ms-fontobject image/svg+xml application/x-font-ttf font/opentype;
@justincarroll
justincarroll / bootstrap-masonry-template.htm
Last active August 15, 2020 16:48
This is my template for using Masonry 3 with Bootstrap 3. For those of you who follow this gist a lot has changed since Bootstrap 2.
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrap Masonry Template</title>
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=PT+Sans+Caption:400,700">
@jboner
jboner / latency.txt
Last active April 23, 2024 17:34
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