Skip to content

Instantly share code, notes, and snippets.

View DanielTillett's full-sized avatar

Daniel Tillett DanielTillett

View GitHub Profile
#if _WIN32_WINNT < 0x0500
# error "should be NT"
#endif
#include <windows.h>
#include <tlhelp32.h>
#include <winternl.h>
#include <stdio.h>
DWORD getppid()
{
@mvsantos
mvsantos / remove-image-background.sh
Created May 10, 2013 14:16
Remove/strip image background - rough mode - requires ImageMagick
# Requires ImageMagick
# Converting the source from JPEG to PNG - if necessary
convert my_src_image.jpg my_src_image.png
# Option A
# - Requires a temporary intermediate file
# - Drill more than 10 might result in poor results
@rockymadden
rockymadden / processing-chassis-3u-8node.md
Last active December 17, 2015 05:58
One simple example of a 10u/13node hardware private cloud infrastructure. Built specifically for colocation, based on how datacenters often slice up their racks (e.g. 10u/quarter rack is very common). Saves a few hundred thousand dollars over AWS in three years time. Replace/repeat at that time and then put these into a Hadoop cluster or somethi…

This chassis houses up to 8 processing nodes. Each node is roughly equivilent to 30 elastic compute units. You can scale as needed by building and slotting more nodes into the chassis. Candidates for these nodes includes: app servers of any kind, ssl termination/reverse proxies, cache servers, distributed/concurrent processing, cron jobs, etc.

Barebone:


Per node (up to 8):

@ofca
ofca / $.3.js
Last active February 20, 2021 13:30
// based on https://gist.github.com/Potfur/5576225 & https://github.com/james2doyle/saltjs
// more info: https://plus.google.com/109231487156400680487/posts/63eZzzrBSb6
window.$ = function(s) {
var c = {
'#': 'ById',
'.': 'sByClassName',
'@': 'sByName',
'=': 'sByTagName'}[s[0]];
return document[c?'getElement'+c:'querySelectorAll'](s.slice(1))
};
// Put this in a separate .h file (called "getopt.h").
// The prototype for the header file is:
/*
#ifndef GETOPT_H
#define GETOPT_H
int getopt(int nargc, char * const nargv[], const char *ostr) ;
#endif
*/
@mikestecker
mikestecker / lamp-setup.md
Last active July 30, 2018 20:10
This guide shows howto install Apache HTTP Server (httpd) with PHP 5.5.9 and following modules on Fedora 20/19/18/17, CentOS 6.5/6.4/6.3/6.2/6.1/6/5.10 and Red Hat (RHEL) 6.5/6.4/6.3/6.2/6.1/6/5.10 systems.

Install Apache/PHP 5.5.9 on Fedora 20/19, CentOS/RHEL 6.5/5.10

This guide shows howto install Apache HTTP Server (httpd) with PHP 5.5.9 and following modules on Fedora 20/19/18/17, CentOS 6.5/6.4/6.3/6.2/6.1/6/5.10 and Red Hat (RHEL) 6.5/6.4/6.3/6.2/6.1/6/5.10 systems.

  1. Change root user

su -
## OR ##

sudo -i

@davidnknight
davidnknight / Gulpfile
Last active June 19, 2021 03:23
A well structured gulpfile that performs CSS, JS, image and PHP tasks with an abstract config.
Specifically, this gruntfile will perform the following.
- CSS:
-- Compile SCSS
-- Add vendor prefixes for the last 10 browser versions
- JS:
-- Run scripts through jshint to detect errors and potential problems in code.
-- Compile scripts to your destination folder in their original state. Use these in development environments as they'll be easier to debug with as their code doesn't exist on 1 line, nor is it obfuscated.
-- Minify and concatenate scripts into one all.min.js. Uglify will also obfuscate code if you set mangle to true, leave as false if using AngularJS.

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google
@malware-kitten
malware-kitten / vm_detect
Created November 10, 2014 20:37
A chunk of code found online that will check for evidence of a virtual machine
#include <string>
#include <tlhelp32.h>
#include <TCHAR.H>
#include <dir.h>
using namespace std;
int detected = 0;
DWORD GetModulePath(HINSTANCE hInst,LPTSTR pszBuffer,DWORD dwSize)
@bobbygrace
bobbygrace / trello-css-guide.md
Last active April 22, 2024 10:15
Trello CSS Guide

Hello, visitors! If you want an updated version of this styleguide in repo form with tons of real-life examples… check out Trellisheets! https://github.com/trello/trellisheets


Trello CSS Guide

“I perfectly understand our CSS. I never have any issues with cascading rules. I never have to use !important or inline styles. Even though somebody else wrote this bit of CSS, I know exactly how it works and how to extend it. Fixes are easy! I have a hard time breaking our CSS. I know exactly where to put new CSS. We use all of our CSS and it’s pretty small overall. When I delete a template, I know the exact corresponding CSS file and I can delete it all at once. Nothing gets left behind.”

You often hear updog saying stuff like this. Who’s updog? Not much, who is up with you?