Skip to content

Instantly share code, notes, and snippets.

View juntalis's full-sized avatar

Charles Grunwald juntalis

View GitHub Profile
@juntalis
juntalis / Fix-Indentation.ps1
Created February 22, 2015 17:44
Cheap workaround to allow using tabs for indentation in ISE.
$psISE.Options.ShowOutlining = $true
$psISE.Options.ShowDefaultSnippets = $true
$psISE.Options.ShowIntellisenseInScriptPane = $true
$psISE.Options.ShowIntellisenseInConsolePane = $true
#
Set-Variable -Option AllScope -Name OptionSetter -Value (&{
$ClassName = 'IndentFixer'
$Namespace = 'ISEHijack'
@juntalis
juntalis / CFF-Explorer-Globals.lua
Last active August 29, 2015 14:09
Auto-generated table representing the global variables in CFF Explorer's lua interpreter.
_G = {
["AddDataToLastSection"] = function(...) end,
["AddResource"] = function(...) end,
["AddResourceRaw"] = function(...) end,
["AddSection"] = function(...) end,
["AddSectionHeader"] = function(...) end,
["AddSectionWithData"] = function(...) end,
["AfterDumpHeaderFix"] = function(...) end,
["BIF_BROWSEFORCOMPUTER"] = 4096,
["BIF_BROWSEFORPRINTER"] = 8192,
-- ----------------------------
-- View structure for `report_jobs`
-- ----------------------------
DROP VIEW IF EXISTS `report_jobs`;
CREATE
ALGORITHM=UNDEFINED DEFINER=`icheckma_dbo`@`localhost`
SQL SECURITY DEFINER
VIEW `report_jobs` AS
SELECT `report_jobs`.`subject_id` AS `report`,
BEGIN
DECLARE c CHAR(1);
DECLARE s VARCHAR(128);
DECLARE i INT DEFAULT 1;
DECLARE bool INT DEFAULT 1;
DECLARE punct CHAR(17) DEFAULT ' ()[]{},.-_!@;:?/';
SET s = LCASE( str );
WHILE i <= LENGTH( str ) DO
BEGIN
SET c = SUBSTRING( s, i, 1 );
BEGIN
DECLARE i INT DEFAULT 1;
DECLARE loc INT;
SET loc = LOCATE(CONCAT(word,' '), str, 2);
IF loc > 1 THEN
WHILE i <= LENGTH (str) AND loc <> 0 DO
SET str = INSERT(str,loc,LENGTH(word),LCASE(word));
SET i = loc+LENGTH(word);
SET loc = LOCATE(CONCAT(word,' '), str, i);
function ValidationError(func, validation, value) {
Error.call(this,
'Parameter validation failed when calling function' +
(func.name && func.name.length > 0 ? ' ' + func.name : ' ') +
' - Validated for "' + validation.expected + '" - Got value: ' +
value
);
this.func = func;
this.value = value;
this.validation = validation;
mixins.numeric = {
gt: expects('number')
(function gt(value) {
return this.valueOf() > value;
}),
gte: expects('number')
(function gte(value) {
return this.valueOf() >= value;
}),
eq: expects('number')
#include "common.h"
#include <sys/types.h>
#include <string.h>
#include <errno.h>
int execute(char cmd[]);
void print_help(void);
void daemonize(void);
void prepend(char* s, const char* t);
int save_pid(pid_t pid,const char *pid_file);
@juntalis
juntalis / singleinst.c
Created October 5, 2014 03:49
Executable wrapper for allowing only a single instance of a program to run, using a configurable number of args for the identity.
// Preconfigure
#define _UNICODE 1
#define _CONSOLE 1
#include <pch.h>
#include <crc16.h>
struct exe_args_t
{
HANDLE hMutex;
@echo off
goto main
:dirname
call set %~1=%~dp2
call set %~1=%%%~1:~0,-1%%
goto :EOF
:get_virtualenv
rem If the foldername of the virtual env contains a dot, (ex: .vip)