Skip to content

Instantly share code, notes, and snippets.

View pilotgeraldb's full-sized avatar
😎
being awesome

Gerald B. pilotgeraldb

😎
being awesome
View GitHub Profile
@smaeda-ks
smaeda-ks / pre-request.js
Last active October 27, 2022 12:44
Postman OAuth signature generator (Pre-request Scripts)
/*
* This is a Pre-request script for Postman client to remediate OAuth 1.0a issue
* where certain request fails if it has a query parameter that includes some special characters.
*
* NOTE: This Pre-script is only available for "GET" request.
* There's a workaround for POST request.
* See: https://github.com/twitterdev/postman-twitter-ads-api/issues/2
*
* In order to use this Pre-request script, you need to change your "Authorization" type to
* "No Auth" only for the target request and do not apply to the top-level object.
@collatzz
collatzz / Stub.cs
Created January 15, 2018 16:22
Wraps the Moq Mock<T> class to prevent using Verify methods on a true stub class
using Moq;
namespace Fakes
{
internal class Stub<T> where T : class
{
private Mock<T> _mock;
internal Stub()
: this(new Mock<T>()) { }
@mistercoffee66
mistercoffee66 / jquery-dosomething-ES6.js
Last active November 6, 2019 16:03
ES6 module importing jQuery plugin
//jquery-dosomething-ES6.js
//after modification
//assumes jQuery is avail as global or via NPM etc
import jQuery from 'jquery'
export default function() {
+function($) {
var $this = $(this);
var newText = $this.data('text');
@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

using System;
using System.Collections.Generic;
using System.Data;
using System.Linq.Expressions;
using System.Reflection;
using System.Text;
using AutoMapper;
using AutoMapper.Mappers;
namespace IronToby.Vandelay
@joey-qc
joey-qc / TSQL-to-POCO
Created September 26, 2013 06:56
A simple TSQL script to quickly generate c# POCO classes from SQL Server tables and views. You may tweak the output as needed. Not all datatypes are represented but this should save a bunch of boilerplate coding. USAGE: Run this query against the database of your choice. The script will loop through tables, views and their respective columns. Re…
declare @tableName varchar(200)
declare @columnName varchar(200)
declare @nullable varchar(50)
declare @datatype varchar(50)
declare @maxlen int
declare @sType varchar(50)
declare @sProperty varchar(200)
DECLARE table_cursor CURSOR FOR
@digitaljhelms
digitaljhelms / gist:4287848
Last active November 23, 2025 17:07
Git/GitHub branching standards & conventions

Branching

Quick Legend

Description, Instructions, Notes
Instance Branch
@rtipton
rtipton / ReadFromEventLog.cs
Created March 24, 2010 01:29
C# -- Read From Event Logs
using System;
using System.Text;
class Program
{
static void Main(string[] args)
{
StringBuilder sb = new StringBuilder();
System.Diagnostics.EventLog log = new
System.Diagnostics.EventLog("Application");