Skip to content

Instantly share code, notes, and snippets.

@jw3
jw3 / build-git.sh
Created February 5, 2016 00:35 — forked from pescobar/build-git.sh
compile git with openssl instead of gnutls
#!/usr/bin/env bash
# Clear out all previous attempts
rm -rf "/tmp/source-git/"
# Get the dependencies for git, then get openssl
sudo apt-get install build-essential fakeroot dpkg-dev -y
sudo apt-get build-dep git -y
sudo apt-get install libcurl4-openssl-dev -y
mkdir -p "/tmp/source-git/"
@jw3
jw3 / jdk_download.sh
Created March 14, 2016 16:43 — forked from P7h/jdk_download.sh
Script to download JDK / JRE / Java binaries from Oracle website from terminal / shell / command line / command prompt
##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### #####
### Shell script to download Oracle JDK / JRE / Java binaries from Oracle website using terminal / command / shell prompt using wget.
### You can download all the binaries one-shot by just giving the BASE_URL.
### Script might be useful if you need Oracle JDK on Amazon EC2 env.
### Script is updated for every JDK release.
### Features:-
# 1. Resumes a broken / interrupted [previous] download, if any.
# 2. Renames the file to a proper name with including platform info.
import scalatags.Text.all._
import collection.mutable
// http://flatuicolors.com/
val red = "#c0392b"
val green = "#27ae60"
val yellow = "#f39c12"
val blue = "#2980b9"
val magenta = "#8e44ad"
val cyan = "#16a085"
val black = "#000"
import cats.data.StateT
import cats.implicits._
import scala.collection.JavaConverters._
import scala.concurrent.{Await, Future}
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.duration.Duration
import twitter4j._, twitter4j.conf.ConfigurationBuilder
object YourTweetsAreTooLong {
private type PagingState = (Long, Option[Long])
@jw3
jw3 / fix_includes.sh
Created April 12, 2018 22:45 — forked from Canta/fix_includes.sh
Fix include/include_tasks with tags for ansible v2.5
#!/bin/bash
# This dirty script is supposed to run on your ansible directory.
# It could obviously be done better, but it's just a single use script, so I don't really care.
# Worked fine with bash 4.2
# Anyway, check its syntax (at least the first line, the one setting the RESULT var), and use with caution.
# The script implements what's suggested here:
# http://docs.ansible.com/ansible/2.5/porting_guides/porting_guide_2.5.html#dynamic-includes-and-attribute-inheritance
@jw3
jw3 / googlenet.py
Created January 5, 2019 18:35 — forked from joelouismarino/googlenet.py
GoogLeNet in Keras
from scipy.misc import imread, imresize
from keras.layers import Input, Dense, Convolution2D, MaxPooling2D, AveragePooling2D, ZeroPadding2D, Dropout, Flatten, merge, Reshape, Activation
from keras.models import Model
from keras.regularizers import l2
from keras.optimizers import SGD
from googlenet_custom_layers import PoolHelper,LRN
def create_googlenet(weights_path=None):
@jw3
jw3 / .geotiff_headers.md
Created June 2, 2020 16:21 — forked from perrygeo/.geotiff_headers.md
Parsing geotiff headers

Optimized determination of Geotiff bounds

This is functional but is merely a workaround until we get vsis3 - you can try out preliminary vsis3 support with GDAL 2.1 and rasterio 0.32a1

Goal: Based on the GeoTiff and TIFF specs, manually parse out tags to allow for the most IO-efficient reading of georeferencing information.

It works almost the same as rio info --bounds but gives a json array, and it's fast

$ time rio info --bounds R4C1.tif

153.984375 24.2578125 154.072265625 24.345703125

openssl genrsa -out ca.key 2048
openssl req -new -x509 -days 3650 -key ca.key -out ca.crt
#:: CZ
#:: Prague
#:: Mrackova
#:: Whatever You Need
#::
#:: domain.cz
#:: email@domain.com
@jw3
jw3 / GORILLA.BAS
Created June 29, 2022 13:56 — forked from caffo/GORILLA.BAS
QBasic Gorillas
' Q B a s i c G o r i l l a s
'
' Copyright (C) IBM Corporation 1991
'
' Your mission is to hit your opponent with the exploding banana
@jw3
jw3 / README.md
Created February 1, 2025 14:50 — forked from goliatone/README.md
Postgres TRIGGER to call NOTIFY with a JSON payload

This TRIGGER function calls PosgreSQL's NOTIFY command with a JSON payload. You can listen for these calls and then send the JSON payload to a message queue (like AMQP/RabbitMQ) or trigger other actions.

Create the trigger with notify_trigger.sql.

When declaring the trigger, supply the column names you want the JSON payload to contain as arguments to the function (see create_triggers.sql)

The payload returns a JSON object: