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
# Install a bunch of Windows DLLs needed to make Native work | |
# https://ubuntuhandbook.org/index.php/2021/05/wine-6-9-released-install-in-ubuntu-21-04-20-04/ | |
sudo apt install --install-recommends winehq-staging | |
wine 'wineboot' | |
sudo apt install winetricks | |
# on manjaro with x11 this worked fine | |
winetricks vcrun2013 gdiplus urlmon | |
# on arch with wayland (amd) I needed | |
winetricks dxvk vcrun2013 gdiplus urlmon |
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
/* | |
What happens? | |
- `new Type().what` is looked up with a call to `get` on the proxy | |
- a function is returned that will look up `METHOD_NAME` when called | |
- `METHOD_NAME` is called because of the `()` behind `new Type().what` | |
- if `METHOD_NAME` exists on you object, your own function is called | |
- if not, because of prototypal inheritance, `get` is called again | |
- `name` is now `METHOD_NAME` and we can throw as we know `METHOD_NAME` is not implemented on the type | |
credits http://soft.vub.ac.be/~tvcutsem/proxies/ |
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
<project xmlns="http://maven.apache.org/POM/4.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>gd.wa</groupId> | |
<artifactId>minimal-pom</artifactId> | |
<version>1.0-SNAPSHOT</version> | |
<packaging>jar</packaging> |
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
# download jdk-8-linux-arm-vfp-hflt.tar.gz from oracle | |
$ sudo tar zxvf jdk-8-linux-arm-vfp-hflt.tar.gz -C /opt | |
# ... | |
$ sudo update-alternatives --install /usr/bin/javac javac /opt/jdk1.8.0_06/bin/javac 1 | |
$ sudo update-alternatives --install /usr/bin/java java /opt/jdk1.8.0_06/bin/java 1 |
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
(async function () { | |
var webHookUrl = "https://hooks.slack.com/triggers/a/b/c"; | |
// credits chatgpt | |
function isoWeek(date) { | |
// copy date so don't modify original | |
date = new Date(date); | |
// set to nearest thursday (current date + 4 - current day) % 7 | |
date.setUTCDate(date.getUTCDate() + 4 - (date.getUTCDay() || 7)); |
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
Array.prototype.foldLeft = function (sum, callback) { | |
var head, | |
list = Array.prototype.slice.call(this); | |
if (list.length) { | |
head = list.shift(1); | |
return list.foldLeft(callback(sum, head), callback); | |
} | |
return sum; | |
}; |
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
// Load plugins | |
var gulp = require('gulp'), | |
sass = require('gulp-ruby-sass'), | |
autoprefixer = require('gulp-autoprefixer'), | |
minifycss = require('gulp-minify-css'), | |
jshint = require('gulp-jshint'), | |
uglify = require('gulp-uglify'), | |
imagemin = require('gulp-imagemin'), | |
rename = require('gulp-rename'), | |
clean = require('gulp-clean'), |
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
import java.lang.reflect.InvocationHandler; | |
import java.lang.reflect.Method; | |
import java.lang.reflect.Proxy; | |
class DynamicInvocationHandler implements InvocationHandler { | |
@Override | |
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { | |
return 42; | |
} |
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
import java.lang.reflect.ParameterizedType; | |
public class TypeArgumentTest { | |
public static void main(String[] args) { | |
abstract class Super<T> { | |
public Class findTypeArgument() { | |
ParameterizedType genericSuperclass = (ParameterizedType) this.getClass().getGenericSuperclass(); |
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
# one: string | |
#INSERT INTO `torgeirtester.schema_one` values ("one"); | |
# one: string, two: number | |
#INSERT INTO `torgeirtester.schema_two` values ("one", 2); | |
# three: boolean | |
#INSERT INTO `torgeirtester.schema_three` values (true); | |
SELECT * FROM `torgeirtester.schema_*`; |
NewerOlder