Skip to content

Instantly share code, notes, and snippets.

View brenttaylor's full-sized avatar

Ryan Brent Taylor brenttaylor

  • San Lorenzo, California
View GitHub Profile
int main(int argv, char **args) {
EnumWindows(MyEnumProc, 0);
WunderlistWebCtrl = GetWindow(Wunderlist, GW_CHILD);
SetForegroundWindow(Wunderlist);
SetActiveWindow(Wunderlist);
SetFocus(WunderlistWebCtrl);
//Simulate a Ctrl+N keyboard shortcut
SendKey(VK_CONTROL, FALSE, KeyDown);
#include <Windows.h>
HWND Wunderlist;
HWND WunderlistWebCtrl;
int main(int argv, char **args) {
EnumWindows(MyEnumProc, 0);
SetForegroundWindow(Wunderlist);
SetActiveWindow(Wunderlist);
SetFocus(Wunderlist);
//Simulate a Ctrl+N keyboard shortcut
SendKey(VK_CONTROL, FALSE, KeyDown);
SendKey(0x4E, FALSE, KeyDown);
SendKey(0x4E, FALSE, KeyUp);
void SendKey(int vk, BOOL bExtended, bool KeyUp) {
KEYBDINPUT Keyboard;
INPUT Input;
ZeroMemory(&Keyboard, sizeof(KEYBDINPUT));
ZeroMemory(&Input, sizeof(INPUT));
if (bExtended) {
Keyboard.dwFlags |= KEYEVENTF_EXTENDEDKEY;
}
if (KeyUp){
#include <Windows.h>
HWND Wunderlist;
BOOL CALLBACK MyEnumProc(HWND hWnd, LPARAM lParam) {
char title[14];
ZeroMemory(title, sizeof(title));
GetWindowTextA(hWnd, title, sizeof(title));
if (strncmp(title, "Wunderlist - ", 13) == 0) {
function FizzBuzz() {
this.TestCases = new Array();
this.AddCase = function(Name, DivisibleBy) {
this.TestCases.push(
function (x) {
return x % DivisibleBy === 0 ? Name : '';
}
);
};
this.Run = function(x) {
@brenttaylor
brenttaylor / gist:3520108
Created August 29, 2012 23:09
Byte Array to Integer Type
enum ByteOrder {
BIG_ENDIAN,
LITTLE_ENDIAN
};
enum BTIException {
INTEGER_WIDTH_OUT_OF_BOUNDS
};
template <typename IntType>
@brenttaylor
brenttaylor / gist:2715742
Created May 17, 2012 02:23
DarkGDK DBObject ID generator
typedef unsigned int DBObjectID;
class DBObject {
private:
static DBObjectID IDCounter;
static std::list<DBObjectID> RecycledIDs;
protected:
const DBObjectID ID;
public:
DBObject() : ID(GetNewID()) {
}
@brenttaylor
brenttaylor / AVLTree.java
Created March 7, 2012 08:01
Chad's AVL Tree in Java
package mycollections;
public class AVLTree<T extends Comparable<T>> extends BinarySearchTree<T> {
public AVLTree() {super();}
public void add(T data) {
System.out.println("Insertion of :" + data.toString());
AVLTreeNode parent = (AVLTreeNode) root;
Stack<Boolean> leftMoves;
Stack<AVLTreeNode> parents;
boolean placeNotFound = true;
if(root == null) {
@brenttaylor
brenttaylor / printStars.cpp
Created February 28, 2012 01:32
Student Assignment
#include <iostream>
#include <limits>
#include <cmath> //Has our Absolute value function: abs()
namespace BTH { //Brent Taylor Helper namespace. ;)
template<typename T>
bool InputFromStream(std::istream &InputStream, T &Result) {
InputStream >> Result;
if (!InputStream.good()) {