Skip to content

Instantly share code, notes, and snippets.

@evacchi
evacchi / example-response.json
Created September 22, 2019 15:47
Example EventBrite response
{
"pagination": {
"object_count": 378451,
"page_number": 1,
"page_size": 50,
"page_count": 200,
"has_more_items": true
},
"events": [
{
@evacchi
evacchi / Example.java
Last active February 5, 2019 12:54
SVM Crash
package ex;
import javax.script.*;
import java.util.*;
public class Example {
public static void main(String... args) {
ScriptEngineManager manager = new ScriptEngineManager();
// List<ScriptEngineFactory> factories = manager.getEngineFactories();
// for (ScriptEngineFactory factory : factories) {
// }
}
{
Y:
function(F) {
ll: function(x) F(function(y) {l:x(x), r: l(y)}.r ),
rr: ll( function(x) F(function(y) {l:x(x), r: l(y)}.r) )
}.rr,
FactGen:
function(fact) function(n) if n=0 then 1 else n*fact(n-1),
Fact: Y(FactGen),
R: Fact(10)
package io.evacchi.github;
import io.github.evacchi.*;
dialect "mvel"
rule "last0"
when
$l : Last(list.tail == null)
@evacchi
evacchi / fonts.conf
Created April 25, 2018 10:22
ugly Calibri and Cambria fonts in Firefox
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match target="font">
<test qual="any" name="family">
<string>Calibri</string>
</test>
<edit name="embeddedbitmap"><bool>false</bool></edit>
</match>
<match target="font">
abstract class Animal<F extends Food> { abstract void eats(F f);}
abstract class Food {}
class Veg extends Food {}
class Meat extends Food {}
class Grass extends Veg {}
class Carrot extends Veg {}
class Cow extends Animal<Veg> { void eats(Veg f) {}}
class Main {
public static void main(String[] args) {
@evacchi
evacchi / ghettotypealiases.java
Last active February 23, 2018 09:24
Ghetto Type Aliases using Generic Bounds
//
// the implementation for this class is in the package-private
// abstract class below. We are using type parameters to fake type aliases.
// Scroll down for details
//
public class DefinitionsBuildingContext
extends DefinitionsContextHelper<
/*EdgeT = */
Edge<ViewConnector<BPMNViewDefinition>,
Node<? extends View<? extends BPMNViewDefinition>, ?>>,
  • install from ISO, then:

    ostree remote add --set=gpg-verify=false fedora-ws-27 https://kojipkgs.fedoraproject.org/compose/ostree/27
    rpm-ostree rebase fedora-ws-27:fedora/27/x86_64/workstation
    
  • reboot

  • then login

  • then:

env XDG_SESSION_TYPE=wayland gnome-session

@evacchi
evacchi / sharedqueue.nim
Last active June 10, 2017 13:50
Shared Queue
import locks, options
#
# Simple shared queue implementation
# Translated into Nim from https://idea.popcount.org/2012-09-11-concurrent-queue-in-c/
#
type
SharedQueueNode[A] = ptr object
# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=1000
setopt appendhistory autocd extendedglob notify correct
# End of lines configured by zsh-newuser-install