This file contains hidden or 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
#!/usr/bin/env python | |
import re | |
import os | |
import time | |
import signal | |
import sys | |
class TopState: | |
Running = 1 |
This file contains hidden or 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 <thread> | |
#include <condition_variable> | |
#include <iostream> | |
#include <cstdlib> | |
#include <boost/filesystem.hpp> | |
namespace fs = boost::filesystem; | |
std::vector<fs::path> proc_pids; |
This file contains hidden or 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 <stdio.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
#include <unistd.h> | |
#include <errno.h> | |
#include <sys/wait.h> | |
#include <sys/types.h> | |
#include "lib/testing.h" | |
/* Execute this while being in a child process */ |
This file contains hidden or 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
#!/usr/bin/env python3 | |
######################################################## | |
# the matasano crypto challenges | |
# http://cryptopals.com/sets/1/challenges/1/ | |
######################################################## | |
from base64 import b64encode | |
from itertools import zip_longest |
This file contains hidden or 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
(* The matasano crypto challenges | |
* http://cryptopals.com/sets/1/challenges/1/ | |
* | |
* Compile it like this: | |
* $ ocamlfind ocamlc -package base64,batteries -o hexbase64 -linkpkg hexbase64.ml | |
*) | |
open Batteries | |
open B64 |
This file contains hidden or 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 <tuple> | |
#include <type_traits> | |
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |
// TBD: | |
// Recursively find the start state at compile time and make static_assert fail if one is not found | |
// (also terminate the recursive search as soon as the start state is found). | |
// Do the same of the end state but don't make static_assert fail, since a state machine is allowed not to have one. |
This file contains hidden or 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> | |
template <typename T, unsigned int N> | |
unsigned int countof(T const (&array)[N]) | |
{ | |
return N; | |
} | |
void f1() { std::cout << "Hello from " << __func__ << "\n"; } | |
void f2() { std::cout << "Hello from " << __func__ << "\n"; } |
This file contains hidden or 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
import time, sys | |
from Quartz.CoreGraphics import CGEventCreateMouseEvent | |
from Quartz.CoreGraphics import CGEventCreate | |
from Quartz.CoreGraphics import CGEventPost | |
from Quartz.CoreGraphics import CGEventGetLocation | |
from Quartz.CoreGraphics import kCGEventMouseMoved | |
from Quartz.CoreGraphics import kCGEventLeftMouseDown | |
from Quartz.CoreGraphics import kCGEventLeftMouseUp | |
from Quartz.CoreGraphics import kCGMouseButtonLeft | |
from Quartz.CoreGraphics import kCGHIDEventTap |
This file contains hidden or 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 <DiskArbitration/DiskArbitration.h> | |
void disk_event(DADiskRef disk, void *context) | |
{ | |
printf("Disk removed: %s\n", DADiskGetBSDName(disk)); | |
CFRunLoopStop(CFRunLoopGetCurrent()); | |
} | |
int main() | |
{ |
This file contains hidden or 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
{"id":"https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#","$schema":"http://json-schema.org/draft-04/schema#","title":"Template","description":"An Azure deployment template","type":"object","properties":{"$schema":{"type":"string","description":"JSON schema reference"},"apiProfile":{"type":"string","enum":["2017-03-09-profile"],"description":"The apiProfile to use for all resources in the template."},"contentVersion":{"type":"string","pattern":"(^[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+$)","description":"A 4 number format for the version number of this template file. For example, 1.0.0.0"},"variables":{"type":"object","description":"Variable definitions"},"parameters":{"type":"object","description":"Input parameter definitions","additionalProperties":{"$ref":"#/definitions/parameter"}},"functions":{"type":"array","items":{"$ref":"#/definitions/functionNamespace"},"description":"User defined functions"},"resources":{"type":"array","description":"Collection of resources to be deployed","i |
OlderNewer