Skip to content

Instantly share code, notes, and snippets.

@CoolOppo
CoolOppo / IsOpen .NET Method
Last active January 3, 2016 20:19
Checks if a process is open.
private static bool IsOpen(string pName) // Checks if a given process with the "friendly name" (that is, the process without ".exe" appended) is open. Returns false if it is closed, true if it is open.
{
Process[] processArray = Process.GetProcessesByName(pName); // Make an array of processes (the data type) of all of the running processes with the "friendly name"
if (processArray.Length == 0) // Does the array have a length of zero?
return false; // If it does, there are no processes with the given "friendly name", therefore return false.
else
return true;
}
@CoolOppo
CoolOppo / Vim Commands Cheat Sheet.md
Created February 5, 2014 20:47
Vim Commands Cheat Sheet

Source

Vim Commands Cheat Sheet


How to Exit

:q[uit]

@CoolOppo
CoolOppo / autoexec.cfg
Last active August 29, 2015 13:56
My autoexec.cfg
// Launch Options:
// -novid -tickrate 128 -high -threads 6
con_enable "1" // Enable the console
bind "KP_MINUS" "toggleconsole" // dash key on numpad, opens console
bind "O" "toggle voice_enable 1 0" // enables and disables voice communication when pressing O
bind "ALT" "+voicerecord" // key to use ingame voice, in this case V
bind "SEMICOLON" "ignorerad" // Will ignore ALL radio commands (Fire in the hole, need backup, etc.) This command works like a toggle, press key again to enable radio commands again
bind "F10" "quit"
bind z "use decoy" // Quit game instantly when pressing F10 without clicking OK in a popup
bind x "use incgrenade;use molotov"
@CoolOppo
CoolOppo / SUM-PROD
Created February 26, 2014 22:45
A program I made in TI-BASIC to find two numbers that have a specified sum and product.
ClrHome
Disp "ENTER PRODUCT","AND SUM"
Prompt P,S
0->O
.5S->I
If (S<0 xor P<0)
Then
While (SO!=P)
S+1->S
O-1->O
@CoolOppo
CoolOppo / entityLoop.cpp
Created March 14, 2014 01:48
Loop through entities in source engine.
/*
By Nomster
http://www.unknowncheats.me/forum/781373-post1.html
*/
CEntityList* gpMainEntityList = ( CEntityList* )( dwGameClient + 0x22321C0 );
for( int i = 0; i < MAX_ENTITY_NUM; i++ )
{
if( gpEntityList[ i ] )
{
@CoolOppo
CoolOppo / Chromium Directwrite Font Rendering.md
Last active August 29, 2015 13:58
Google Chrome Directwrite Text Antialiasing Comparison

Chromium DirectWrite Font Rendering

Recently, Chromium (the open-source project behind Google Chrome) developers have made it possible to use DirectWrite for font rendering, leading to much better and clearer fonts for Windows users! The clarity matches that of OS X and Chrome OS, both of which having absolutely gorgeous font rendering. I recently switched to Firefox specifically to avoid the horrible text aliasing in Chrome, but it would appear that as of this week, DirectWrite font rendering is actually working from within the Chrome sandbox now! This was not previously possible with the Directwrite flag, which was only added recently anyways. Chrome now uses DirectWrite for font rendering on Windows by default, and has done so from version 37 and up.

Browser comparison

*Note: These are both using different fonts, so it's pretty much an invalid comparison

@CoolOppo
CoolOppo / Auto-Strafe.au3
Last active August 29, 2015 13:58
Strafe script to automatically press 'a' when you turn left and 'd' when you turn right in FPS games (useful for 'bunny hopping' and 'strafe jumping' in games like CS:S and Quake)
#include <Misc.au3>
For $i = 0 to 1 Step 0
Switch MouseGetPos(0)
Case 0 to 959
Send("{d up}")
Send("{a down}")
Case 961 to 1920
Send("{a up}")
Send("{d down}")
@CoolOppo
CoolOppo / 0_reuse_code.js
Last active August 29, 2015 13:58
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@CoolOppo
CoolOppo / Auto-Upgrade.sh
Last active February 3, 2019 03:22
Auto-upgrade for apt-get
sudo apt-get update
sudo apt-get -fqyp dist-upgrade --auto-remove --purge
sudo apt-get autoclean
CoordMode, Pixel, Screen
CoordMode, Mouse, Screen
CoordMode, Caret, Screen
Run, C:\Program Files\TeamSpeak 3 Client\ts3client_win64.exe
Sleep 1000
ImageSearch, FoundX, FoundY, 0, 0, A_ScreenWidth, A_ScreenHeight, lobbyUnselected.png
if ErrorLevel = 2
MsgBox Could not conduct the search.
else if ErrorLevel = 1
MsgBox Icon could not be found on the screen.