Skip to content

Instantly share code, notes, and snippets.

@shawnz
shawnz / WarnSchemaValidator.java
Last active May 9, 2023 07:08
Hibernate schema validator that outputs warning messages instead of throwing exceptions. Tested with Hibernate 5.3.9
package org.shawnz;
import org.hibernate.boot.Metadata;
import org.hibernate.boot.model.naming.Identifier;
import org.hibernate.boot.model.relational.Sequence;
import org.hibernate.dialect.Dialect;
import org.hibernate.mapping.Column;
import org.hibernate.mapping.Selectable;
import org.hibernate.mapping.Table;
import org.hibernate.tool.schema.extract.spi.ColumnInformation;
@terrancesnyder
terrancesnyder / apiary.txt
Last active August 22, 2019 20:03
API Ary - Draft
[#ftl]
[#-- @ftlvariable name="resourceApis" type="java.util.List<com.webcohesion.enunciate.api.resources.ResourceApi>" --]
[#-- @ftlvariable name="serviceApis" type="java.util.List<com.webcohesion.enunciate.api.services.ServiceApi>" --]
[#-- @ftlvariable name="data" type="java.util.List<com.webcohesion.enunciate.api.datatype.Syntax>" --]
[#-- @ftlvariable name="title" type="java.lang.String" --]
[#-- @ftlvariable name="disableMountpoint" type="java.lang.Boolean" --]
[#-- @ftlvariable name="disableResourceLinks" type="java.lang.Boolean" --]
[#-- @ftlvariable name="apiRelativePath" type="java.lang.String" --]
[#-- @ftlvariable name="includeApplicationPath" type="java.lang.Boolean" --]
@cstancu
cstancu / DeletedClass.java
Last active April 19, 2019 20:49
--report-unsupported-elements-at-runtime test
public class DeletedClass {
}
@ixdy
ixdy / yubikey4-ssh-macos.md
Last active April 12, 2024 20:19
Setting up ssh public key authentication on macOS using a YubiKey 4

Setting up ssh public key authentication on macOS using a YubiKey 4

I largely followed Florin's blog post, but have a few notes to add regarding issues I encountered:

Basic setup notes

  1. I used a YubiKey 4, while the blog describes using a YubiKey NEO. I'm sure a YubiKey 5 would also work. I'm also running macOS 10.13.6.
  2. I installed GPGTools as recommended. However, as I'll note later, it seems that gpg-agent only automatically starts when gpg is used; for ssh, you'll need to ensure it's running.
  3. Before generating your keys, decide what key size you want to use. If you run the list command inside gpg --edit-card, look for the Key attributes line to see what is currently selected. On my YubiKey 4, it defaulted to 2048 bits for all keys:
Key attributes ...: rsa2048 rsa2048 rsa2048

How To Make A Working TWRP Device Tree For Your MediaTek Device & Start Building Them, Online

This Guide is tested on 64-bit mt6735/53 chipset device. It will also work on any 64-bit and 32-bit devices.

You will need something from your Stock ROM first. Get them all and Try to modify it using the procedure.

Note: This guide will be helpful for you if you have older mediatek devices (android-5.1 or android-6.0), but up-to-date devices can also work.

Update: This guide had a few typos and derps (Oops..), but I've tried to make it free of those now (Dated November 18, 2020)

Bonus: You can also use this tool by @SebaUbuntu, @yshalsager and @mauronofrio to auto generate the twrp tree. The tool is best if your device runs on android-9.0. The tools is still not 100% compatible to all devices, but I'll still recommend it and give it 8.5/10 in the scale of varsatility.

@yougg
yougg / proxy.md
Last active May 23, 2024 11:36
complete ways to set http/socks/ssh proxy environment variables

set http or socks proxy environment variables

# set http proxy
export http_proxy=http://PROXYHOST:PROXYPORT

# set http proxy with user and password
export http_proxy=http://USERNAME:PASSWORD@PROXYHOST:PROXYPORT

# set http proxy with user and password (with special characters)
@bernardolopes8
bernardolopes8 / BookPersister.java
Last active February 8, 2024 14:46
Jersey Pagination, Sorting, and Filtering Example
package my.application.dao;
import java.util.List;
import my.application.entity.Book;
import my.application.restutil.RequestOptions;
public interface BookPersister {
List<Book> getBooks(RequestOptions requestOptions);
}
@retronym
retronym / diff.diff
Last active March 21, 2019 22:35
Graal CE vs EE config options
--- graal-ce-config.txt 2018-05-23 13:52:18.000000000 +1000
+++ graal-ee-config.txt 2018-05-23 13:52:34.000000000 +1000
@@ -1,11 +1,11 @@
-scala@scalabench:/usr/lib/jvm$ /usr/lib/jvm/graalvm-ce-1.0.0-rc1/bin/java -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:+JVMCIPrintProperties -version
+scala@scalabench:/usr/lib/jvm$ /usr/lib/jvm/graalvm-1.0.0-rc1/bin/java -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:+JVMCIPrintProperties -version
[JVMCI properties]
jvmci.Compiler := "graal" [String]
Selects the system compiler. This must match the getCompilerName() value returned by a jdk.vm.ci.runtime.JVMCICompilerFactory provider. An empty string or the value "null" selects a compiler that will raise an exception upon receiving a compilation request. This property can also be defined by the contents of <java.home>/lib/jvmci/compiler-name.
jvmci.InitTimer = false [Boolean]
Specifies i
@tonyxu-io
tonyxu-io / linedin-login-sample-code.html
Last active August 8, 2020 13:23
Linkedin Login Sample Code #snippet
<!DOCTYPE html>
<html>
<head>
<title>Linkedin Demo</title>
<meta charset="utf-8">
<script type="text/javascript" src="//platform.linkedin.com/in.js">
api_key: 86012 cynxvvidr
onLoad: checkAuthentication
authorize: true
@raphw
raphw / Main.java
Last active May 9, 2018 19:07
Method handle invoke special
package main;
import bar.Bar;
import qux.Qux;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodType;
import java.lang.reflect.Proxy;
import java.util.function.Consumer;