Skip to content

Instantly share code, notes, and snippets.

View bjongbloedt's full-sized avatar

Ben Jongbloedt bjongbloedt

View GitHub Profile
@androiddrew
androiddrew / apistar_util.py
Last active August 14, 2019 17:16
Apistar 0.4 Extended JSON Response, SQLAlchemy Component, and SQLAlchemy Hook
import datetime as dt
import decimal
import typing
from apistar import types
from apistar.http import JSONResponse, Response
from apistar.server.components import Component
from sqlalchemy.engine import Engine
from sqlalchemy.orm import sessionmaker, Session, scoped_session
@rsudip90
rsudip90 / nullHandle.go
Last active February 1, 2023 03:34
How I handled the null possible value in a sql database row in golang?
package main
import (
"database/sql"
"encoding/json"
"fmt"
"reflect"
"time"
"github.com/go-sql-driver/mysql"
@a4099181
a4099181 / Convert-ToPackageReference.ps1
Last active February 18, 2021 07:00
Converts packages.config into PackageReference at *.csproj project file. Requires XSLT stylesheet available as second file in the gist.
Function Convert-ToPackageReference
{
Param ( [Parameter( Mandatory, ValueFromPipeline )][String] $inputUri,
[String] $stylesheetUri = "https://gist.githubusercontent.com/a4099181/074a6c3dd524ea0d343382137492399c/raw/cdd0fb31efd70c4c0f8c86ddb314de86ab8972e8/Convert-ToPackageReference.xsl",
[String] $resultsFile = [System.IO.Path]::GetTempFileName() )
Process {
$xslt = New-Object System.Xml.Xsl.XslCompiledTransform
$xslt.Load( $stylesheetUri )
$xslt.Transform( $inputUri, $resultsFile )
@wkwiatek
wkwiatek / app-1.spec.ts
Last active December 17, 2021 01:52
Angular 2 test snippets for Angular final version. Codebase for https://developers.livechatinc.com/blog/category/programming/angular-2/
// App
import { Component } from '@angular/core';
@Component({
selector: 'app',
template: '<span>{{ sayHello() }}</span>',
})
export class App {
public name: string = 'John';
@DenisIzmaylov
DenisIzmaylov / NOTES.md
Last active November 15, 2019 07:39
Step By Step Guide to Configure a CoreOS Cluster From Scratch

Step By Step Guide to Configure a CoreOS Cluster From Scratch

This guide describes how to bootstrap new Production Core OS Cluster as High Availability Service in a 15 minutes with using etcd2, Fleet, Flannel, Confd, Nginx Balancer and Docker.

Content

@gyandeeps
gyandeeps / git-bash.sh
Last active November 2, 2023 18:30
Bash alias for git
# Global variables
re='^[0-9]+$'
jira_name="MINT"
# Will create a new branch with name ($1) from master
# it will also make sure master is up to date from origin
workstartFunc() {
if ! [[ $1 =~ $re ]]
then
val=$1
@nzakas
nzakas / alias.md
Created September 11, 2015 17:59
Some simple scripts I use to manage open source branches

Usage:

To create a new branch that is up-to-date with the remote master:

$ ws 123

Creates the branch issue123

@cdroulers
cdroulers / build.fsx
Created May 7, 2015 00:11
FAKE target to run code coverage on NUnit tests
open Fake.OpenCoverHelper
let buildDir = "./build/"
let coverageDir = buildDir + "coverage/"
let testsDir = buildDir + "tests/"
Target "RunNUnitTests" (fun _ ->
let assembliesToTest = (" ", (!! (buildDir + "/*.Tests.dll"))) |> System.String.Join
CreateDir coverageDir
CreateDir testsDir
@husobee
husobee / gist:9ff87a6f27e9abb4a3bc
Created March 3, 2015 20:33
Example of Mocking in Golang, and Monkey Patch
package main
import "fmt"
type Something struct {}
func (s Something) Test() bool {
return false
}
type SomethingInterface interface {
@danesparza
danesparza / negroni-gorilla.go
Last active December 16, 2020 12:36
Negroni with Gorilla mux subrouter
package main
import (
"fmt"
"github.com/codegangsta/negroni"
"github.com/gorilla/mux"
"log"
"net/http"
)