Skip to content

Instantly share code, notes, and snippets.

Avatar
:shipit:

Tyler Rockwood rockwotj

:shipit:
View GitHub Profile
@fundter
fundter / automatic-to-explicit-module.sh
Created Feb 1, 2019
Turn a non-modular jar into a modular jar (Java module)
View automatic-to-explicit-module.sh
# Generate module-info.java
jdeps --generate-module-info <output-path-for-module-info.java> <path-to-non-modular-jar>
# Compile the module-info.java
javac --patch-module <name-of-the-module>=<path-to-non-modular-jar> <path-to-module-info.java>
# Update jar with module-info
cd <directory-containing-module-info.class> # avoid path prefix to module-info for next command
jar uf <path-to-non-modular-jar> module-info.class
@DGrady
DGrady / subprocess_filter.py
Last active Jul 30, 2022
Stream data asynchronously through a subprocess in Python
View subprocess_filter.py
"""
Problem: provide two-way communication with a subprocess in Python.
See also:
- https://kevinmccarthy.org/2016/07/25/streaming-subprocess-stdin-and-stdout-with-asyncio-in-python/
- http://eli.thegreenplace.net/2017/interacting-with-a-long-running-child-process-in-python/
"""
import asyncio
import sys
@asciimike
asciimike / BUILD
Last active Jul 11, 2022
Example of how to reference a CocoaPod in Bazel
View BUILD
ios_app(
name = "App",
hdrs = ["src/*.h"],
srcs = ["src/*.m"],
deps = [
"@SDWebImage//:latest_library",
],
)
ios_test(
@bsilver8192
bsilver8192 / BUILD
Created Mar 17, 2016
Basics of generating a compile_commands.json file with Bazel
View BUILD
py_binary(
name = 'generate_compile_command',
srcs = [
'generate_compile_command.py',
],
deps = [
'//third_party/bazel:extra_actions_proto_py',
],
)
@lopezjurip
lopezjurip / README.md
Created Sep 26, 2015
OSX Homebrew: docker-machine setup
View README.md

Prerequisites

Make sure you have installed Homebrew and (Homebrew-Cask)[http://caskroom.io/].

# Install Homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

# Install Homebrew-cask
brew install caskroom/cask/brew-cask
View gist:e12d731ba01ba58f0006
package services
import java.lang.reflect.Type
import com.google.gson._
import org.joda.time.format.ISODateTimeFormat
import org.joda.time.{DateTime, DateTimeZone}
object Serializers {
@soheilhy
soheilhy / nginxproxy.md
Last active Aug 11, 2022
How to proxy web apps using nginx?
View nginxproxy.md

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@devunwired
devunwired / GifDecoder.java
Last active Mar 7, 2022
An optimized implementation of GifDecoder for Android devices.
View GifDecoder.java
/**
* Copyright (c) 2013 Xcellent Creations, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
@jjarmoc
jjarmoc / gist:1571540
Created Jan 6, 2012
Quoted Printable encode/decode bash aliases - suitable for pipelining
View gist:1571540
# To decode:
# qp -d string
# To encode:
# qp string
alias qpd='perl -MMIME::QuotedPrint -pe '\''$_=MIME::QuotedPrint::decode($_);'\'''
alias qpe='perl -MMIME::QuotedPrint -pe '\''$_=MIME::QuotedPrint::encode($_);'\'''
function qp {
if [[ "$1" = "-d" ]]
then