Skip to content

Instantly share code, notes, and snippets.

@rwilkes
rwilkes / 500px.user.js
Created August 16, 2017 13:27 — forked from homleen/500px.user.js
Show 500px photo url.
// ==UserScript==
// @match http://500px.com/photo/*
// ==/Userscript==
'use strict';
(function(){
var imgPlaceHolder = document.querySelector('.nude_placeholder');
var imgUrl = imgPlaceHolder.nextSibling.src;
@rwilkes
rwilkes / 500px.user.js
Created August 16, 2017 13:27 — forked from oldcai/500px.user.js
Enable copy 500px images and image links by right click at the image
// ==UserScript==
// @name copy 500px images
// @namespace http://www.oldcai.com/
// @version 0.1
// @description copy 500px images
// @author You
// @match https://500px.com/photo/*
// @grant none
// ==/UserScript==
using OpenQA.Selenium;
using OpenQA.Selenium.Edge;
using System;
namespace EdgeDriverTests
{
public class Program
{
/*
* This assumes you have added MicrosoftWebDriver.exe to your System Path.
@rwilkes
rwilkes / gimg_dirurl.js
Created February 11, 2018 00:43 — forked from iambibhas/gimg_dirurl.js
Google Image Search Direct Link to Image
// ==UserScript==
// @name Google Image Direct Link
// @namespace http://userscripts.org/users/192333
// @include http*://*.google.co.in/search*
// @version 1
// @grant GM_deleteValue
// @grant GM_getValue
// @grant GM_setValue
// @grant GM_info
// ==/UserScript==
@rwilkes
rwilkes / APIGet.ps1
Created March 23, 2018 21:38 — forked from jimmypc92/APIGet.ps1
PowerShell IIS Administration API demo
# Add type to handle the API certificate
add-type @"
using System.Net;
using System.Security.Cryptography.X509Certificates;
public class ITrustACertificatePolicy : ICertificatePolicy {
public ITrustACertificatePolicy() {}
public bool CheckValidationResult(
ServicePoint sPoint, X509Certificate cert,
WebRequest wRequest, int certProb) {
@rwilkes
rwilkes / compress.iss
Last active February 4, 2020 21:55 — forked from fvicente/compress.iss
Compress a directory in inno setup
function MakeBackup(indir, outfile: String): Boolean;
var
res: Boolean;
fso: Variant;
winShell: Variant;
f: Variant;
inObj: Variant;
outObj: Variant;
begin
res := FALSE;
@rwilkes
rwilkes / gist:6aef03692d6181a159ae14f3c6765689
Created April 26, 2018 01:53 — forked from meng-hui/gist:3311509
Inno Setup Script starting point
; Starting point of creating an Inno Setup Script
; See the Inno Setup documentation at http://www.jrsoftware.org/
#define SourceFileDir ""
#define IncludeFramework true
#define IsExternal "external"
[setup]
;name of your application
AppName=
procedure ConvertConfig(xmlFileName: String);
var
xmlFile: String;
xmlInhalt: TArrayOfString;
strName: String;
strTest: String;
tmpConfigFile: String;
k: Integer;
begin
xmlFile := ExpandConstant('{app}') + '\' + xmlFileName;
@rwilkes
rwilkes / gist:fe09d3de56a8d32d1baea44ac0175f83
Last active April 26, 2018 01:59 — forked from lextm/gist:3185774
Inno Setup script sample for advanced part 2
[Code]
// function IsModuleLoaded to call at install time
// added also setuponly flag
function IsModuleLoaded(modulename: String ): Boolean;
external 'IsModuleLoaded@files:psvince.dll stdcall setuponly';
// function IsModuleLoadedU to call at uninstall time
// added also uninstallonly flag
function IsModuleLoadedU(modulename: String ): Boolean;
external 'IsModuleLoaded@{app}\psvince.dll stdcall uninstallonly' ;
@rwilkes
rwilkes / innosample.pas
Created April 26, 2018 01:59 — forked from lextm/innosample.pas
Inno Setup script sample for advanced part 3
function Count(What, Where: String): Integer;
begin
Result := 0;
if Length(What) = 0 then
exit;
while Pos(What,Where)>0 do
begin
Where := Copy(Where,Pos(What,Where)+Length(What),Length(Where));
Result := Result + 1;
end;