Skip to content

Instantly share code, notes, and snippets.

View jsonmurphy's full-sized avatar

Jason Murphy jsonmurphy

View GitHub Profile
@ledongthuc
ledongthuc / Readme.md
Last active March 23, 2020 08:19
[Github Actions][Go] Check pull requests before merging

Create template actions that's used to verify Go language pull requests before merging. It's easy to custom the flow, tools with your case.

Put pr_checker.yml or pr_checker_simple.yml to .github/workflows/ and see how it works with your pull requests. Make sure you are allows to use actions of Github.

  • pr_checker.yml is using by mine with full checking tools. It will make sure every Go langauge pull requests will be buildable, testable, passed security checking and error-able code checking.
  • pr_checker_simple.yml is more simpler with buildable, testable.

References:

@neuni
neuni / openvpn_on_google_cloud.md
Created February 28, 2017 13:34
Create a openVPN server on Google Cloud Platform to connect to your Google Cloud network using openVPN and/or to route your internet traffic through the VPN (Road Warrior Scenario)

Install openVPN server on Google Cloud using Pritunl

Purpose:

Create a openVPN server on Google Cloud Platform to connect to your Google Cloud network using openVPN and/or to route your internet traffic through the VPN (Road Warrior Scenario)

Create instance

  • Create new instance in default network
  • Chosse Ubuntu 16.04 LTS
@tamlyn
tamlyn / README.md
Last active July 7, 2022 09:48
Execution order of Jest/Jasmine test code

Execution order of Jest/Jasmine test code

While tests run in source order, surrounding code does not which can lead to hard to debug issues.

Compare the test file below with the sample output below that and note the order of the log messages.

Key points

  • Any code not inside of it, beforeAll, afterAll, beforeEach or afterEach runs immediately on initialisation.
  • This means code at the end of your file runs before even your before hooks.
@pesterhazy
pesterhazy / reagent-ref-functions.clj
Last active January 19, 2023 11:31
Using ref functions with reagent
;; React supports "refs" as a way for a component to get a
;; handle to its children. Classically, refs were string-based.
;; Recent versions of React support callback attributes as a
;; more elegant variant of accessing DOM notes or components.
;;
;; This example uses a Form-3 component as per
;; https://github.com/Day8/re-frame/wiki/Creating-Reagent-Components
;;
;; For callback refs, see React's documentation
;; https://facebook.github.io/react/docs/more-about-refs.html
@sosedoff
sosedoff / 1_simple.go
Created July 16, 2016 18:45
Golang Custom Struct Tags Example
package main
import (
"fmt"
"reflect"
)
// Name of the struct tag used in examples
const tagName = "validate"
@josephspurrier
josephspurrier / sshclient.go
Last active September 10, 2022 02:23
Golang SSH Client
package main
import (
"bufio"
"io/ioutil"
"os/signal"
//"syscall"
"fmt"
"log"
"os"
@jeffweiss
jeffweiss / mix.exs
Last active December 18, 2018 23:13
Retrieving application version number in mix.exs from git describe
defmodule MyApp.Mixfile do
use Mix.Project
def project do
[app: :my_app,
version: get_version,
elixir: "~> 1.0",
elixirc_paths: elixirc_paths(Mix.env),
compilers: Mix.compilers,
build_embedded: Mix.env == :prod,
@statonjr
statonjr / datomic-dynamic-find-clause.md
Last active April 14, 2021 22:28
Datomic Dynamic Find Clause

We're working on a project that uses the Datomic Pull API to pull specific attributes out of Datomic entities. Here's an example of query that uses the Pull API:

(d/q '[:find [(pull ?e [:sales/deal_number :sales/deal_close_date :sales/state]) ...] 
       :in $ ?date 
       :where [?e :sales/deal_close_date ?d _ _] [(> ?d ?date)]] 
       db 
       (days-ago-at-midnight 1))
@bsima
bsima / boot-project.clj
Last active August 29, 2015 14:10
Sometimes you want to use boot as a scripting platform on top of Leinengen. Paste this code at the top of your build.boot file. It reads in the project.clj file and stores it as a map named "project" which you can then use with `set-env!` to setup your environment.
(set-env! :dependencies '[[leiningen-core "2.5.0"]])
(use 'leiningen.core.project)
(eval (read-string (slurp "project.clj")))
(set-env!
:source-paths (:source-paths project)
:resource-paths (:resource-paths project)
:dependencies (:dependencies project))
@csim
csim / dropzone.knockout.js
Last active August 30, 2016 14:18
Dropzone Knockout binding
ko.bindingHandlers.dropzone = {
init: function(element, valueAccessor)
{
var value = ko.unwrap(valueAccessor());
var options = {
maxFileSize: 15,
createImageThumbnails: false,
};