Skip to content

Instantly share code, notes, and snippets.

View juntalis's full-sized avatar

Charles Grunwald juntalis

View GitHub Profile
/**
*
* WOW64Ext Library
*
* Copyright (c) 2014 ReWolf
* http://blog.rewolf.pl/
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
# encoding: utf-8
"""
generate.py
TODO: Description
This program is free software. It comes without any warranty, to
the extent permitted by applicable law. You can redistribute it
and/or modify it under the terms of the Do What The Fuck You Want
To Public License, Version 2, as published by Sam Hocevar. See
http://sam.zoy.org/wtfpl/COPYING for more details.
@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)
@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;
#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);
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')
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;
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);
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 );
-- ----------------------------
-- 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`,