Skip to content

Instantly share code, notes, and snippets.

/**
* \file keylogger.h
*
* Copyright (C) 2009-2010, Ongaro Mattia <moongaro at gmail.com>
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
@mobius
mobius / Program.cs
Created May 31, 2011 04:28
C# startup a process in hidden mode
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
namespace RunAsHidden
{
class Program
{
@jafetsanchez
jafetsanchez / RijndaelCrypt.cs
Created July 13, 2011 11:31
Rijndael on C# and Java
#region Using
using System;
using System.Security.Cryptography;
using System.Text;
#endregion
namespace YourApp.Security.Cryptography
{
@muratpurc
muratpurc / gist:2314727
Created April 5, 2012 22:36
PHP: Regex to validate different phone number formats
<?php
/**
* Regular expression to validate different types of phone numbers
*/
// simple pattern
$pattern = '/^[0-9\-\(\)\/\+\s]*$/';
// example phone numbers
$phoneNumbers = '
@philip-goh
philip-goh / screen_grab.cpp
Created October 10, 2012 13:54
Take a screenshot and write it out as a JPEG in C++ on Windows
#include <iostream>
#include <windows.h>
#include <gdiplus.h>
#include <memory>
using namespace Gdiplus;
using namespace std;
int GetEncoderClsid(const WCHAR* format, CLSID* pClsid)
{
@gupul2k
gupul2k / mf_500_Bag_of_Words.py
Created October 16, 2012 20:43
NLP: Count frequent words in a file
#Author: Sobhan Hota
#Finds most frequent 500 words in a given file
from string import punctuation
from operator import itemgetter
N = 500
words = {}
words_gen = (word.strip(punctuation).lower() for line in open("C:\Python27\Corpus.txt")
@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(
@granoeste
granoeste / EachDirectoryPath.md
Last active November 4, 2024 06:16
[Android] How to get the each directory path.

System directories

Method Result
Environment.getDataDirectory() /data
Environment.getDownloadCacheDirectory() /cache
Environment.getRootDirectory() /system

External storage directories

a {
background-color: #CCC;
display: block;
margin: 25px;
width: 220px;
text-align: center;
padding: 15px;
border-radius: 10px;
text-transform: uppercase;
text-decoration: none;
@prashanthrajagopal
prashanthrajagopal / screenshot.cpp
Last active October 23, 2024 13:14
Take a screenshot and save as jpeg in c++
#include <stdio.h>
#include <windows.h>
#include <gdiplus.h>
#include <time.h>
int GetEncoderClsid(const WCHAR* format, CLSID* pClsid) {
using namespace Gdiplus;
UINT num = 0;
UINT size = 0;