Skip to content

Instantly share code, notes, and snippets.

@ndarville
ndarville / business-models.md
Last active October 9, 2025 17:55
Business models based on the compiled list at http://news.ycombinator.com/item?id=4924647. I find the link very hard to browse, so I made a simple version in Markdown instead.

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google
@77web
77web / 1_security.yml
Created February 25, 2013 07:23
How to switch user accounts between two(or more) different firewalls when using Symfony\Bundle\SecurityBundle
//you may have some more configs here...
providers:
user:
entity: { class: MyAppBundle:User, property: loginEmail }
admin:
entity: { class: MyAppBundle:Admin, property: username }
firewalls:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
@Stanback
Stanback / nginx.conf
Last active December 28, 2025 11:31 — forked from michiel/cors-nginx.conf
Example Nginx configuration for adding cross-origin resource sharing (CORS) support to reverse proxied APIs
#
# CORS header support
#
# One way to use this is by placing it into a file called "cors_support"
# under your Nginx configuration directory and placing the following
# statement inside your **location** block(s):
#
# include cors_support;
#
# As of Nginx 1.7.5, add_header supports an "always" parameter which
@tudorconstantin
tudorconstantin / gist:11207833
Created April 23, 2014 08:58
Perl ~ Facebook authentication with Mojolicious in less than 100 LOC
#!/usr/bin/env perl
use Mojolicious::Lite;
use Net::Facebook::Oauth2;
my $config = {
facebook => {
#get the app id and app secret from the settings page of your facebook application
#you create your own fb app from https://developers.facebook.com/ (accessing Apps -> Create a new app)
app_id => '',
@vcabbage
vcabbage / command-context-timeout.go
Created September 24, 2016 22:29
Command timeout with context
package main
import (
"context"
"fmt"
"os/exec"
"time"
)
func main() {