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> | |
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); | |
void RunMessageLoop(const MSG& msg); | |
void OnIdle(const MSG& msg); | |
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) | |
{ | |
const wchar_t szClassName[] = L"myWindowClass"; |
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
let test1 = new Promise(function(resolve, reject) { | |
resolve('promise 1 result'); | |
//reject('promise 1 result'); | |
}); | |
test1 | |
.then((test1Result) => { | |
console.log('then 1 ' + test1Result); | |
return new Promise(function(resolve, reject) { |
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
using System.IO; | |
using System.Net; | |
using System.Net.Mail; | |
using System.Net.Mime; | |
namespace SendViaGmail | |
{ | |
class Program | |
{ | |
static void SendEmail(SmtpClient smtp, MailAddress from, MailAddress to, string subject, string body, string attachmentPath) |
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 | |
set -e | |
VMPATHS=() | |
VMNAMES=() | |
VMCONFS=() | |
SSPATHS=() | |
TGZNAME=/srv/backups/vmbackup-`date '+%y%m%d-%H%M%S'`.tar.gz | |
TGZLINK=/srv/backups/vmbackup-current.tar.gz |
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
# source http://stackoverflow.com/questions/36200323/get-and-replace-assemblyversion-from-assemblyinfo-cs | |
function Update-Version($path, $pattern, $template, $newVersion) | |
{ | |
(Get-Content $path) | ForEach-Object{ | |
if($_ -match $pattern){ | |
$fileVersion = [version]$matches[1] | |
$now = Get-Date | |
$newVersion = "{0}.{1}.{2}.{3}" -f $now.Year, $now.ToString("MMdd"), $now.ToString("HHmm"), ($fileVersion.Revision+1) | |
$template -f $newVersion |
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
protected static WebRequest CreateRequest(string url, string secret) | |
{ | |
var xml = @" | |
<soapenv:Envelope xmlns:soapenv=""http://schemas.xmlsoap.org/soap/envelope/"" xmlns:ns=""https://service/1/0""> | |
<soapenv:Header/> | |
<soapenv:Body> | |
<ns:Request> | |
<ns:FirstName>XXX</ns:FirstName> | |
<ns:LastName>YYY</ns:LastName> | |
</ns:Request> |
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
using NLog; | |
using NLog.Targets; | |
/* | |
<?xml version="1.0" encoding="utf-8" ?> | |
<configuration> | |
<configSections> | |
<section name="nlog" type="NLog.Config.ConfigSectionHandler, NLog"/> | |
</configSections> | |
<startup> |
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
const path = require('path'); | |
const kpio = require('keepass.io'); | |
const db = new kpio.Database(); | |
const dbPath = path.join(__dirname, 'TestDB_Password1234.kdbx'); | |
db.addCredential(new kpio.Credentials.Password('Password1234')); | |
const findGetFieldValue = (array, key) => { |
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
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0"; | |
let fs = require('fs'); | |
let mw = require('nodemw'); | |
let count = 0; | |
let client = new mw({ | |
protocol: "http", | |
server: 'en.wikipedia.org', | |
path: '/w', | |
debug: false |
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
@echo off | |
set cassie_running=0 | |
set creeper_running=0 | |
set roguecode_running=0 | |
call:stopVmIfItIsRunning "roguecode" roguecode_running | |
call:stopVmIfItIsRunning "creeper" creeper_running | |
call:stopVmIfItIsRunning "cassie" cassie_running |
NewerOlder