# https://gist.github.com/6159923.git
gist=git@gist.github.com:6159923.git
git clone $gist blip_upload
# OR
git remote add origin $gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Sometimes, unicode symbols that have to be inserted in an HTML page should be escaped. | |
For example, everybody know, that’s “&” should be escaped as “&”, ” ” as “ ” and so on. | |
But what, if you should insert symbol, that you never used before. So you don’t know how it should be present or escaped. | |
Code below, helps you to get valid decimal unicode for appropriate symbol. | |
*/ | |
function getCharAsDecimalUTF8(char){ | |
var getUTF8 = escape(char); | |
console.log("&#" + parseInt(getUTF8.substring(getUTF8.match(/\%u/) !== null ? 2 : 1), 16) + ";"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM jenkinsci/blueocean:latest | |
USER root | |
RUN apk add --no-cache --update \ | |
python \ | |
python-dev \ | |
py-pip \ | |
build-base \ | |
&& pip install virtualenv \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Description: This script spins up a multi node Docker Swarm w/ Docker | |
# Networking and Consul discovery w/ Registrator | |
# Author: Ryan C Koch | |
# ryanckoch@gmail.com | |
# Usage: bash docker-playground.sh usage | |
PLAYGROUND_NAME="docker-playground" | |
CONSUL_IMAGE="progrium/consul" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u74-b02/jdk-8u74-linux-x64.rpm" | |
sudo yum -y localinstall jdk-*.rpm | |
rm -fR jdk-*.rpm | |
/usr/sbin/alternatives --config java | |
# install JCE 8 | |
wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jce/8/jce_policy-8.zip" | |
unzip jce_policy-8.zip | |
mv /usr/java/default/jre/lib/security/local_policy.jar /usr/java/default/jre/lib/security/local_policy.jar.backup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Control.Monad (void) | |
import Data.Aeson (FromJSON, ToJSON) | |
import qualified Data.Text as T | |
import GHC.Generics (Generic) | |
import Language.Plutus.Contract | |
import qualified Language.PlutusTx as PlutusTx | |
import Language.PlutusTx.Prelude | |
import Ledger | |
import qualified Ledger.Ada as Ada | |
import qualified Ledger.Constraints as Constraints |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The below is a combination of the following two things: | |
# 1) This article + corresponding Gist: https://medium.com/permutive/optimized-docker-builds-for-haskell-76a9808eb10b | |
# 2) This Reddit comment in response to the above: | |
# - https://www.reddit.com/r/haskell/comments/cl5uod/optimized_docker_builds_for_haskell/evuzccm/ | |
# It is a multi-stage Docker build with 3 stages: 1) dependencies, 2) build, and 3) deploy | |
# ------------------------------------------------------------------------------------------- | |
# STAGE 1: Dependencies | |
# ------------------------------------------------------------------------------------------- | |
FROM haskell:8.10.2 as dependencies |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Using Matcher object returned by =~ operator | |
matcher = "Hello world v1.01" =~ /.* v(\S*)/ | |
if (matcher.matches()) version = matcher[0][1] | |
assert version == "1.01" | |
// We can make this a little tidier using the 'with' method | |
version = ("Hello world v1.01" =~ /.* v(\S*)/).with { matches() ? it[0][1] : null } | |
assert version == "1.01" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## file to upload. | |
S3_UPLOAD_FILE=some/path/file.txt | |
## Specify the bucket name here. This can be found in the S3 console | |
S3_BUCKET=bucket name here | |
## The desired path relative to the root of the bucket. All folders must be forward slash '/' separated | |
S3_DESTINATION_FILE=folder/folder2/file.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Compare a file on S3 to see if we have the latest version | |
# If not, upload it and invalidate CloudFront | |
import fnmatch | |
import os | |
import boto | |
import pprint | |
import re |
OlderNewer