Skip to content

Instantly share code, notes, and snippets.

@kelvinmo
kelvinmo / s3link-v4.php
Created October 25, 2014 00:17
PHP code to generate a pre-signed URL to access a restricted AWS S3 object

Typography

Serif

  • Humanist Serif, great for journalism and historical applications.
  • Transitional Serif, great for traditional academia and legal applications.
  • Modern Serif, great for arts and cultural applications.
  • Egyptian (Slab Serif), great for marketing and promotional applications.

Sans Serif

@uobikiemukot
uobikiemukot / drm_test.c
Last active June 15, 2025 18:16
dirty and small example of libdrm
/* please refer better example: https://github.com/dvdhrm/docs/tree/master/drm-howto/ */
#define _XOPEN_SOURCE 600
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
#include <fcntl.h>
#include <unistd.h>
#include <xf86drm.h>
@denji
denji / nginx-tuning.md
Last active August 7, 2025 09:49
NGINX tuning for best performance

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

anonymous
anonymous / A-Ticker.markdown
Created August 24, 2013 14:19
A Pen by Leon Taveras.

A Ticker

A ticker inspired by a similar ticker seen in an advertisement for a local furniture store in NYC.

Fully responsive using YUI Pure grids.

A Pen by Leon Taveras on CodePen.

License.

anonymous
anonymous / Checkout-Form.markdown
Created August 24, 2013 14:16
A Pen by Atakan Goktepe.

Checkout Form

A clean and simple checkout form with credit card fields, submit button and a fancy price badge.

A Pen by Atakan Goktepe on CodePen.

License.

anonymous
anonymous / Health-bar.markdown
Created August 24, 2013 14:11
A Pen by Sven Knötgen.
@peterk87
peterk87 / interpolate_colors.cs
Created April 24, 2013 15:36
C#: Interpolate between 2 colors - 2 different approaches taken from StackOverflow.com
// Interpolate between 2 colors in C#
// Taken from answer by user Jason
// http://stackoverflow.com/questions/1236683/color-interpolation-between-3-colors-in-net
class ColorInterpolator {
delegate byte ComponentSelector(Color color);
static ComponentSelector _redSelector = color => color.R;
static ComponentSelector _greenSelector = color => color.G;
static ComponentSelector _blueSelector = color => color.B;
public static Color InterpolateBetween(
@mattsnider
mattsnider / hashHackSender.js
Created March 30, 2013 21:03
Cross-Domain Iframe Receiver Using Hack-Hack
var HashHack = {
PREFIX: '#hhMessage=',
postMessage: function(el, sMessage) {
if ('string' === typeof el) {
el = document.getElementById(el);
}
var sUrl = el.src.replace(/#.*/, '');
el.src = sUrl + HashHack.PREFIX + encodeURIComponent(sMessage);
@mattsnider
mattsnider / hashHackReceiver.js
Created March 30, 2013 21:02
Cross-Domain Iframe Receiver Using Hack-Hack
var HashHack = {
PREFIX: '#hhMessage=',
aCallbacks: [],
sLastHash: '',
handleInterval: function() {
var sHash = window.location.hash,
sDecodedHash, sMessage, i;
if (sHash !== HashHack.sLastHash) {