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
/** | |
* @File GetScreenRes.cpp | |
* @Author Drew Chapin <druciferre@gmail.com> | |
* @Date 2014-09-17 | |
* | |
* Gets the screen resolution and dock status of the system. | |
*/ | |
#include <iostream> | |
#include <Windows.h> | |
#include <WinUser.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
/** | |
* @Author Drew Chapin <druciferre@gmail.com> | |
* @Date 2013-05-03 | |
* | |
* Lists all members of a group and how many days are left until their password expires. | |
*/ | |
#pragma comment(lib, "ActiveDS.lib") | |
#pragma comment(lib, "Oleaut32.lib") | |
#pragma comment(lib, "ADSIid.lib") | |
#include <Windows.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 comment(lib,"advapi32.lib") | |
#include <Windows.h> | |
#include <WinSvc.h> | |
#include <AccCtrl.h> | |
#include <AclAPI.h> | |
#include <stdio.h> | |
int main( int argc, char* argv[] ) | |
{ |
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 <Windows.h> | |
#include <ShObjIdl.h> | |
#include <iostream> | |
int main(int argc, char* argv[]) | |
{ | |
HRESULT hResult = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); | |
if( SUCCEEDED(hResult) ) |
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
private void ShiftTextBoxHistory( DataRow next ) | |
{ | |
TextBox[][] c = new TextBox[][] | |
{ | |
new TextBox[]{lastLotNumber1TextBox, lastPartNumber1TextBox, lastBatchNumber1TextBox}, | |
new TextBox[]{lastLotNumber2TextBox, lastPartNumber2TextBox, lastBatchNumber2TextBox}, | |
new TextBox[]{lastLotNumber3TextBox, lastPartNumber3TextBox, lastBatchNumber3TextBox}, | |
new TextBox[]{lastLotNumber4TextBox, lastPartNumber4TextBox, lastBatchNumber4TextBox}, | |
new TextBox[]{lastLotNumber5TextBox, lastPartNumber5TextBox, lastBatchNumber5TextBox}, | |
}; |
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
// Add this to pre-build event | |
// "%CommonProgramFiles(x86)%\microsoft shared\TextTemplating\$(VisualStudioVersion)\TextTransform.exe" -a !!BuildConfiguration!$(Configuration) "$(ProjectDir)Properties\AssemblyInfo.tt" | |
// | |
<#@ template debug="true" hostspecific="true" language="C#" #> | |
<#@ output extension=".cs" #> | |
<#@ import namespace="System.IO" #> | |
<#@ import namespace="System.Text.RegularExpressions" #> | |
using System.Reflection; | |
using System.Runtime.CompilerServices; | |
using System.Runtime.InteropServices; |
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
#!/bin/bash | |
on_exit() { | |
echo "#Exited unexpectidly" | |
zenity --display=:0 --error --text="Program has exited unexpectidly!" | |
} | |
exec &> >(zenity --display=:0 --progress --title 'Redirection example' --text 'Running...' --auto-close) | |
trap "on_exit" EXIT |
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
#!/bin/bash | |
for group in $@; do | |
echo "$group:" | |
users=$(awk -F: "/^$group/{print \$4}" /etc/group | tr , \\n | sort) | |
if [ "$users" != "" ]; then | |
for user in $users; do | |
echo " $user" | |
done | |
else | |
echo " <no users in this group>" |
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 outOfLikes() { | |
var h3 = document.getElementsByTagName("h3"); | |
for( var i = 0; i < h3.length; i++ ) { | |
if( h3[i].innerText == "You're Out of Likes!" ) { | |
return true; | |
} | |
} | |
} | |
function likeHer() { |
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
var divs = document.getElementsByTagName("div"); | |
var list = new Array(); | |
for( var i = 0; i < divs.length; i++ ) { | |
if( divs[i].getAttribute("data-testid") == "friend_list_item") { | |
var friend = divs[i].getElementsByClassName("fwb")[0]; | |
var profile = friend.getElementsByTagName("a")[0]; | |
list.push(friend.innerText + ": " + profile.href); | |
} | |
} | |
console.log(list.length+" friends"); |
OlderNewer