Skip to content

Instantly share code, notes, and snippets.

View rippo's full-sized avatar

Richard Wilde rippo

View GitHub Profile
@rippo
rippo / gist:c6cde230b6aee0e1830bc0efba6005e6
Created February 16, 2024 16:07
client side checkout.js for paypal
async function createOrderCallback() {
try {
const response = await fetch("/payV2/checkout", {
method: "POST",
headers: {
"Content-Type": "application/json",
}
});
const orderData = await response.json();
@rippo
rippo / gist:f39dfe259bad3ae27b89032b5cbbc17c
Created February 13, 2024 08:48
Enable ssl on a .net 4.5 site
FROM Stack Overflow
https://stackoverflow.com/a/54697319/15410
I see this EXACT problem from time to time, when using SSL, and have found that (especially when working on someone else's project in a team environment) the Visual Studio project web settings (SSL ports) sometimes get messed up. Here's what I do to fix them:
In Solution Explorer, click your project.
@rippo
rippo / GitVersionIncrement.ps1
Last active August 9, 2021 15:31 — forked from nbarnwell/GitVersionIncrement.ps1
Simple PowerShell script to create the appropriate next tag on a git repo
function New-Tag {
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[Parameter(Mandatory=$true)]
[string] $Tag)
process {
if ($PSCmdlet.ShouldProcess("git tag $Tag")) {
Write-Verbose "git tag $Tag"
git tag $Tag
}
private static Task<string> foo = null;
private static async Task<string> GetFooDataAsync()
{
async Task<string> GetFooDataInternal()
{
var response = await myHttpClient.GetFooAsync();
return response.data;
}
const puppeteer = require('puppeteer');
/**
* This is a thin wrapper so that we use a singleton of
* the browser that puppeteer creates
*/
class Browser {
setUp(done) {
const puppeteerOpts = this.options && this.options.puppeteer ?
this.options.puppeteer :
@rippo
rippo / Connection.cs
Created January 22, 2018 15:22 — forked from lancscoder/Connection.cs
Dapper Getting Started
public class ConnectionFactory {
public static DbConnection GetOpenConnection() {
var connection = new SqlConnection("MyConnectionString");
connection.Open();
return connection;
}
}
@rippo
rippo / account.login.page.js
Last active October 19, 2017 09:32
Page object pattern using chromeless
var AccountLoginPage = function (chromeless, options) {
this.chromeless = chromeless
this.options = options
this.usernameLocator = 'input[id="Username"]'
this.passwordLocator = 'input[id="Password"]'
this.submitButtonLocator = 'form input[type="submit"]'
this.inputWithValidationErrorLocator = 'input.input-validation-error'
this.usernameRequiredValidationLocator = '.field-validation-error[data-valmsg-for="Username"]'
[HtmlTargetElement("div")]
public class VisibilityTagHelper : TagHelper
{
public bool IsVisible { get; set; } = true;
public override void Process(TagHelperContext context, TagHelperOutput output)
{
if (!IsVisible)
output.SuppressOutput();
select concat('public ',tps.dest,' ',column_name,'{get;set;}') as code
from information_schema.columns c
join(
select 'char' as orign ,'string' as dest union all
select 'varchar' ,'string' union all
select 'longtext' ,'string' union all
select 'datetime' ,'DateTime' union all
select 'text' ,'string' union all
select 'bit' ,'int' union all
select 'bigint' ,'int' union all
@rippo
rippo / loop.casper.js
Created May 5, 2017 09:03
Showing how to loop using casper js
/*eslint strict:0*/
/*global CasperError, console, phantom, require*/
var casper = require("casper").create({
verbose: true
});
// The base links array
var links = [
"http://google.com/",