Skip to content

Instantly share code, notes, and snippets.

@auycro
auycro / ATourOfGo38.go
Last active August 29, 2015 13:57
A Tour of Go' Exercises
//A Tour of Go #38
//Exercise: Slices
package main
import "code.google.com/p/go-tour/pic"
func Pic(dx, dy int) [][]uint8 {
f:= make([][]uint8,dy)
for y:=0;y<dy;y++{
@auycro
auycro / CSVParser.go
Created March 17, 2014 05:24
CSVParser
package main
import (
"encoding/csv"
"fmt"
"io"
"os"
)
func main() {
@auycro
auycro / DB2SqlMonitor.sql
Created April 4, 2014 01:46
DB2 SQL Event Monitor
--
update monitor switches using statement on ;
--Create Event Monitor
create event monitor ykrkmonapp for statements write to file 'd:/tmp';
--Set Event Monitor Active
set event monitor ykrkmonapp state=1 ;
--Drop Event Monitor
@auycro
auycro / GetComputerSID.pas
Created June 4, 2014 23:52
get HKLM.software.....{userSID}
uses
SysUtils,
Variants,
ActiveX,
ComObj;
function ConvertSidToStringSid(Sid: PSID; out StringSid: PChar): BOOL; stdcall; external 'ADVAPI32.DLL' name {$IFDEF UNICODE} 'ConvertSidToStringSidW'{$ELSE} 'ConvertSidToStringSidA'{$ENDIF};
function SIDToString(ASID: PSID): string;
var
@auycro
auycro / GSend.go
Last active August 29, 2015 14:02
Sending Email via CMD ref. https://github.com/jimlawless/gsend/
// Copyright 2013 - by Jim Lawless
// License: MIT / X11
// See: http://www.mailsend-online.com/license2013.php
//
// Bear with me ... I'm a Go noob.
package main
import (
"log"
@auycro
auycro / getDesktopPath.pas
Created June 13, 2014 03:26
Get Desktop Path #Delphi
uses ShlObj, ComObj, ActiveX;
//GET DESKTOP FOLDERS
function GetSystemPath(Folder: Integer): string;
var
PIDL: PItemIDList;
Path: LPSTR;
AMalloc: IMalloc;
begin
Path := StrAlloc(MAX_PATH);
@auycro
auycro / TaskScheduler.cs
Created June 26, 2014 01:30
C#によるタスクスケジューラへの登録 http://tzedeck.seesaa.net/article/388838290.html
public void RegisterTaskDefinition()
{
ITaskService taskservice = null;
try
{
taskservice = new TaskScheduler.TaskScheduler();
taskservice.Connect(null, null, null, null);
ITaskFolder rootfolder = null;
try
{
@auycro
auycro / CheckDLL.pas
Last active August 29, 2015 14:04
DLL Check
//http://stackoverflow.com/questions/21180094/how-to-get-a-list-of-used-dlls
//http://msdn.microsoft.com/en-us/library/windows/desktop/ms683201(v=vs.85).aspx
//http://delphi.wikia.com/wiki/Dynamic_Link_Library_(DLL)
uses
SysUtils,
Windows,
TlHelp32;
{$R *.res}
@auycro
auycro / vbsEncode.vbs
Created December 16, 2014 23:50
microsoft-script-encode-vbs
'Option Explicit
'Sub aa()
Dim oEncoder, oFile, oFSO 'As Object
Dim oStream, sSourceFile
Dim sDest, sFileOut, oEncFile
Set oEncoder = CreateObject("Scripting.Encoder")
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oFile = oFSO.GetFile("C:\ExcelMacro.vbs")
@auycro
auycro / spritesheetGen.m
Last active September 22, 2016 06:56
generate sprite from sprite sheet
//http://stackoverflow.com/questions/20271812/use-a-one-image-sprite-sheet-in-sprite-kit-ios
Entity *cookie = [[Entity alloc] initWithSpriteSheetNamed:@"cookie_sheet" withinNode:map sourceRect:CGRectMake(0, 0, 32, 32) andNumberOfSprites:6];
- (id) initWithSpriteSheetNamed: (NSString *) spriteSheet withinNode: (SKSpriteNode *) scene sourceRect: (CGRect) source andNumberOfSprites: (int) numberOfSprites {
// @param numberOfSprites - the number of sprite images to the left
// @param scene - I add my sprite to a map node. Change it to a SKScene
// if [self addChild:] is used.