Skip to content

Instantly share code, notes, and snippets.

@Thinkscape
Thinkscape / findMaxOverlappingIntervals.php
Last active December 15, 2015 23:38
Find max overlapping intervals algorithm implementation in PHP. See also: http://stackoverflow.com/a/4542928/181664
<?php
/**
* Find the maximum number of overlapping intervals.
*
* For example, given a series of the following int-based intervals [[1,2], [3,4], [2,10]]
* the following intervals overlap: [1,2] with [2,10], [3,4] with [2,10], hence the maximum
* number of overlapping intervals is 2.
*
* @link http://stackoverflow.com/a/4542928/181664
* @param array $series An array of pairs of positive integers, i.e. [[1,2], [3,4], [2,10] ...]
@lukaslundgren
lukaslundgren / python27_on_debian.sh
Created May 11, 2012 12:58
How to install python 2.7 on debian
sudo apt-get install build-essential libsqlite3-dev zlib1g-dev libncurses5-dev libgdbm-dev libbz2-dev libreadline5-dev libssl-dev libdb-dev
wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz
tar -xzf Python-2.7.3.tgz
cd Python-2.7.3
./configure --prefix=/usr --enable-shared
make
sudo make install
cd ..
@phpdude
phpdude / nginx.conf
Last active October 6, 2024 19:22
Nginx image filter + caching of results.
location /resize {
alias /tmp/nginx/resize;
set $width 150;
set $height 100;
set $dimens "";
if ($uri ~* "^/resize_(\d+)x(\d+)/(.*)" ) {
set $width $1;
set $height $2;
set $image_path $3;
@mediabounds
mediabounds / floatsign.sh
Last active April 15, 2025 12:08
A small bash script to re-sign iOS applications.
# !/bin/bash
# Copyright (c) 2011 Float Mobile Learning
# http://www.floatlearning.com/
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
@jed
jed / LICENSE.txt
Created May 20, 2011 13:27 — forked from 140bytes/LICENSE.txt
generate random UUIDs
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Jed Schmidt <http://jed.is>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE