Skip to content

Instantly share code, notes, and snippets.

@claylo
claylo / jira.sql
Created April 25, 2011 21:54
Atlassian JIRA database & user creation for MySQL.
#
# You will want to pick a real password here!
#
CREATE USER 'jirauser'@'localhost' IDENTIFIED BY 'some_pass';
CREATE DATABASE jira CHARACTER SET utf8 COLLATE utf8_bin;
GRANT ALL PRIVILEGES ON jira.* to 'jirauser'@'localhost';
FLUSH PRIVILEGES;
# In case you forgot to change the password above...
# SET PASSWORD for 'jirauser'@'localhost' = PASSWORD('someother_pass');
@marteinn
marteinn / InteractiveScrollView.java
Last active May 2, 2023 22:35
ScrollView with a OnBottomReachedListener for Android. MIT license (https://opensource.org/licenses/MIT).
package se.marteinn.ui;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.ScrollView;
/**
* Triggers a event when scrolling reaches bottom.
@marchold
marchold / Android SwitchPlusClickPreference
Last active November 20, 2022 09:38
extension of SwitchPreference that allows you to add a click handler to the preference area as well as the switch. For making switch preferences that work like Android WiFi settings.
import android.content.Context;
import android.preference.SwitchPreference;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Switch;
/**
* Custom preference for handling a switch with a clickable preference area as well
@rolandyoung
rolandyoung / verifyToken.sh
Last active July 8, 2022 11:16
Using openssl to verify a JWT from Keycloak
#!/bin/bash
# tested with OpenSSL 1.0.1e-fips on Centos 6
# Note hardcoded Keycloak URL and credentials.
# Keycloak public key is in ATS-ci.key.pem with -----BEGIN PUBLIC KEY----- (etc)
assert() { if [[ $1 != $2 ]]; then echo "assert" $3; exit; fi }
url=http://192.168.10.221:8088/auth/realms/ATS-ci/protocol/openid-connect/token
resp=$(curl -X POST $url \
@BoD
BoD / .travis.yml
Last active October 27, 2020 13:25
Travis build file for Android: the whole file
language: java
dist: trusty
jdk: oraclejdk8
before_cache:
# Do not cache a few Gradle files/directories (see https://docs.travis-ci.com/user/languages/java/#Caching)
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
cache:
@mendhak
mendhak / apigateway.tf
Last active July 8, 2024 19:09
Terraform - API Gateway with greedy path (proxy+) calling httpbin. Also includes deployment
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 4.0"
}
}
}
provider "aws" {
@juanpabloaj
juanpabloaj / logging_env.py
Last active March 1, 2024 13:09
python logging, log level with environment variable
import os
import logging
LOGLEVEL = os.environ.get('LOGLEVEL', 'INFO').upper()
logging.basicConfig(level=LOGLEVEL)
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active July 20, 2024 05:29
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@jkpl
jkpl / Dockerfile
Last active February 13, 2023 15:22
saml2aws Docker image
FROM debian:stable-slim
RUN apt-get update && \
apt-get install -y ca-certificates curl && \
rm -rf /var/lib/apt/lists/*
ENV SAML2AWS_VERSION=2.16.0
ENV SAML2AWS_DOWNLOAD_URL=https://github.com/Versent/saml2aws/releases/download/v${SAML2AWS_VERSION}/saml2aws_${SAML2AWS_VERSION}_linux_amd64.tar.gz
RUN curl -L "$SAML2AWS_DOWNLOAD_URL" -o saml2aws.tar.gz && \
@Karewan
Karewan / Android: TLS 1.3 with OkHttp + Conscrypt on all Android versions (Tested on 4.1+)
Last active July 12, 2024 17:32
Android: TLS 1.3 with OkHttp and Conscrypt on all Android versions (Tested on 4.1+)
// Android 4.1+
dependencies {
implementation 'com.squareup.okhttp3:okhttp:3.12.13'
implementation 'org.conscrypt:conscrypt-android:2.5.2'
}
// Android 5.0+
dependencies {
implementation 'com.squareup.okhttp3:okhttp:4.10.0'
implementation 'org.conscrypt:conscrypt-android:2.5.2'