This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
///////////////////////////////////////////////////////////////////////// | |
/// Title: Stopwatch Class | |
/// Author: Sam Christy | |
/// Date: 26/11/2011 | |
/// Licence: GNU GPL | |
/// | |
/// This class is a simple, high-resolution stopwatch for timing the | |
/// execution of C++ programs in a Windows eviroment. This class | |
/// emulates the Stopwatch class of the .NET framework and uses the | |
/// Windows API to time events. Its precision is much greater than any |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function my_restrict_manage_posts() { | |
global $typenow; | |
$args=array( 'public' => true, '_builtin' => false ); | |
$post_types = get_post_types($args); | |
if ( in_array($typenow, $post_types) ) { | |
$filters = get_object_taxonomies($typenow); | |
foreach ($filters as $tax_slug) { | |
$tax_obj = get_taxonomy($tax_slug); | |
wp_dropdown_categories(array( | |
'show_option_all' => __('Show All '.$tax_obj->label ), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.IO; | |
using System.Net; | |
namespace Lib.Common | |
{ | |
public class FtpClient |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template <typename T, typename F> | |
size_t offset(F T::* ptr) | |
{ | |
T* typePtr = (T*)nullptr; | |
F* memberPtr = &(typePtr->*ptr); | |
uintptr_t offset = (uintptr_t)memberPtr - (uintptr_t)typePtr; | |
return offset; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Delta Compression by Glenn Fiedler. | |
This source code is placed in the public domain. | |
http://gafferongames.com/2015/03/14/the-networked-physics-data-compression-challenge/ | |
*/ | |
#include <stdint.h> | |
#include <stdio.h> | |
#include <assert.h> | |
#include <string.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
class SomeClass | |
{ | |
public: | |
SomeClass(); | |
~SomeClass(); | |
SomeClass(const SomeClass&); | |
SomeClass& SomeClass(const SomeClass&); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Threading; | |
static class Program { | |
static void Main() { | |
Console.Write("Performing some task... "); | |
using (var progress = new ProgressBar()) { | |
for (int i = 0; i <= 100; i++) { | |
progress.Report((double) i / 100); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <ctime> | |
class Timer | |
{ | |
public: | |
Timer() { clock_gettime(CLOCK_REALTIME, &beg_); } | |
double elapsed() { | |
clock_gettime(CLOCK_REALTIME, &end_); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
namespace MyCollections | |
{ | |
/// <summary> | |
/// Represents a strongly typed list of disposable objects that can be accessed by index. | |
/// Provides methods to search, sort, and manipulate lists and disposes all contained objects. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Creating a new CA | |
# 1. create the CA key | |
#openssl genrsa -out ca-key.pem 1024 -config openssl.cnf | |
openssl genrsa -des3 -out ca-key.pem 1024 -config openssl.cnf | |
openssl rsa -in ca-key.pem -out ca-key.pem # rm pass | |
# 2. create a certificate signing request | |
openssl req -days 365 -new -key ca-key.pem -out ca.csr -config openssl.cnf |
OlderNewer