Skip to content

Instantly share code, notes, and snippets.

CodeAngry / sqlpackage_msi.ps1
Created May 29, 2020
Update SQLPackage via Powershell and MSI
View sqlpackage_msi.ps1
# wait before exiting script or force update?
# .\script.ps1 -force 0 -wait 1
param ([bool] $wait = $false, [bool] $force = $false)
$global:ErrorActionPreference = 'SilentlyContinue'
$global:ProgressPreference = 'SilentlyContinue'
Write-Host "**************************************************************"
CodeAngry / CPU_Maker_Model.cpp
Last active Aug 29, 2015
Get CPU Maker and Model.
View CPU_Maker_Model.cpp
// Written and Tested in VC++ (C++11 code)
// by @CodeAngry
// get the maker name
int vCpuBuffer[4]{};
__cpuid(vCpuBuffer, 0);
unsigned int vHighestFeature((unsigned int)vCpuBuffer[0]);
char vCpuMaker[32]{}; // zero-fill
CodeAngry / CookieMonster.js
Last active Aug 29, 2015
Cookie Monster is a simple JS cookie manager.
View CookieMonster.js
* CookieMonster.JS
* @copyright Claude Adrian, CodeAngry
* @license
if (typeof String.prototype.trimLeft !== 'function') {
String.prototype.trimLeft = function() {
CodeAngry / WpWideAdminMenu.php
Last active Dec 22, 2015
WordPress standalone plugin to make the admin menu wider.
View WpWideAdminMenu.php
Plugin Name: Wider Admin Menu
Plugin URI:
Description: Changes the WordPress admin menu width to <code>apply_filters('admin_menu_width', 200);</code>.
Version: 0.0.7
Author: Claude "CodeAngry" Adrian
Author URI:
License: WTFPL
CodeAngry / get_file_size.cpp
Created Aug 4, 2013
Three methods to get the file size of a path in Windows C++.
View get_file_size.cpp
/// <summary>Values that represent the methods available to get the file size.</summary>
/// <remarks>Claude "CodeAngry" Adrian, 20 May 2012.</remarks>
typedef enum class file_size_methods {
create_file = 1, // CreateFile, GetFileSizeEx, CloseHandle (II speed, I reliable)
get_attributes = 2, // GetFileAttributesEx (I speed)
find_file = 3, // FindFirstFile, FindClose (III speed)
} file_size_method;
/// <summary>Gets athe file size using the chosen method.</summary>
/// <remarks>Claude "CodeAngry" Adrian, 20 May 2012.</remarks>
CodeAngry / Verify_PayPal_IPN.php
Last active Dec 17, 2020
Verify PayPal IPN with PHP & cURL. Works for both Live and Sandbox IPNs.
View Verify_PayPal_IPN.php
* Verifies a PayPal Live/Sandbox IPN.
* It returns NULL if freak error occurs (no connection, bad reply, bad IPN).
* It returns BOOL to signal verification success or failure.
* @author Claude "CodeAngry" Adrian
* @param array/null $IPN
View HttpSeoRedirect.php
* The right way to do a SEO HTTP Redirection. (says me)
* @copyright Claude "CodeAngry" Adrian
* @link
* @license WTFPL
namespace CA;
CodeAngry / GetHeadersCUrl.php
Created Oct 4, 2012
Alternative to get_headers with cURL and more bling.
View GetHeadersCUrl.php
* Does a cURL request against a URL and returns only the Headers.
* If redirections occur, all Headers are returned for each Hop.
* By default, if not false, returned value is an array of arrays.
* If $associative is true, each set of Headers will be decoded into an associative array.
* If $only_last is true, regardless of the sets of Headers returned, only the last is kept.
* <code>
CodeAngry / namespacelessxml.php
Created Aug 18, 2012
Load XML into SimpleXMLElement without Namespaces.
View namespacelessxml.php
* Loads XML and kills namespaces in the process.
* It allows easy usage of namespaced XML code.
* - NameSpaced tags are renamed from <ns:tag to <ns_tag.
* - NameSpaced tags are renamed from </ns:tag> to </ns_tag>.
* - NameSpaced attributes are renamed from ns:tag=... to ns_tag=....
* @license
CodeAngry / PayPalAPI_DoDirectPayment.php
Created Jun 30, 2012
PaypalAPI DoDirectPayment Sale PHP Implementation :: Untested, wrote at anger! :)
View PayPalAPI_DoDirectPayment.php
// ------------------------------------------------------------------------------------------ //
* LICENSE: Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions: