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
ps1_status() { | |
if [ $? -ne 0 ]; then | |
echo ":(" | |
else | |
echo ":)" | |
fi | |
} | |
function configure_prompt() { | |
local PS_RESET="\[\e[00m\]" |
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 python3 | |
import argparse as ap | |
import contextlib as cl | |
import os | |
import pathlib | |
import shlex | |
import sys | |
import tarfile | |
import urllib.request as ur |
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 -e | |
set -o pipefail | |
BUILDPACK_HOME=$(cd "$(dirname "$0")" && cd .. && pwd) | |
STEPS="$BUILDPACK_HOME/steps" | |
BUILD_DIR=$1 | |
CACHE_DIR=$2 | |
ENV_DIR=$3 |
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 | |
import sys | |
import subprocess as s | |
import optparse as o | |
import urllib2 as u | |
import json as j | |
import re | |
import os | |
import errno |
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
package com.example.jersey2; | |
import javax.ws.rs.Consumes; | |
import javax.ws.rs.POST; | |
import javax.ws.rs.Path; | |
import javax.ws.rs.core.MediaType; | |
import javax.ws.rs.core.MultivaluedMap; | |
import javax.ws.rs.core.Response; | |
import org.springframework.stereotype.Component; |
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 -e | |
## usage: mvn-debug <target...> | |
## or: SUSPEND=y mvn-debug <target...> | |
## or: DEBUG_PORT=2000 mvn-debug <target> | |
SUSPEND="${SUSPEND:-n}" | |
DEBUG_PORT="${DEBUG_PORT:-8000}" | |
export MAVEN_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,address=${DEBUG_PORT},server=y,suspend=${SUSPEND} ${MAVEN_OPTS}" |
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
function screenToSvg(svg, x, y) { | |
var point = svg.createSVGPoint(); | |
point.x = x; | |
point.y = y; | |
var screenMatrix = svg.getScreenCTM(); | |
var svgMatrix = screenMatrix.inverse(); | |
return point.matrixTransform(svgMatrix); | |
} |
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
class my_app { | |
$checkout = "/vagrant" | |
$virtualenv = "/home/vagrant/env" | |
python::virtualenv { $virtualenv: | |
ensure => present, | |
owner => "vagrant", | |
version => "system", | |
} |
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
class system-update { | |
exec { 'apt-get update': | |
command => 'apt-get update', | |
path => ['/usr/bin', '/bin', '/usr/sbin', '/sbin'], | |
} | |
Exec['apt-get update'] -> Package<| |> # before all packages | |
$sysPackages = [ "build-essential", "nmap", "skipfish", "curl", "libcurl4-openssl-dev" ] | |
package { $sysPackages: |
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
void writeFoo(File file, Structure data) throws IOException { | |
try (OutputStream fout = new FileOutputStream(file)) { | |
writeHeader(fout); // writeHeader is marked 'throws IOException' and contains no try/catch | |
writeContent(fout, data); // ditto | |
} | |
} |
NewerOlder