Skip to content

Instantly share code, notes, and snippets.

View wunki's full-sized avatar
🏠
Working from my home in the Netherlands.

Petar Radošević wunki

🏠
Working from my home in the Netherlands.
View GitHub Profile
@wunki
wunki / gist:badf76c400a037032b095c759b90c6d0
Last active November 3, 2023 06:32
Emacs with PGTK, native compilation and JSON on Ubuntu
# Checkout Emacs
$ git clone git://git.sv.gnu.org/emacs.git
# Vanilla Emacs requirements
$ sudo apt install build-essential autoconf libgtk-3-dev libgnutls28-dev libtiff5-dev libgif-dev libjpeg-dev libpng-dev libxpm-dev libncurses-dev texinfo adwaita-icon-theme-full
# Required for Native JSON
$ sudo apt install libjansson4 libjansson-dev
# Required for GCC
@wunki
wunki / inspiration.clj
Created March 25, 2023 09:49
Babashka script to inspire you. Can be used as startup for your terminal.
#!/usr/bin/env bb
(require '[clojure.string :as str])
(def user (str/capitalize
(str (System/getenv "USER"))))
(def words-of-inspiration
(list "The best way to predict the future is to invent it. -Alan Kay"
"A point of view is worth 80 IQ points. -Alan Kay"
const std = @import("std");
// Errors which can be returned when parsing the command line arguments.
const ParseArgsError = error{TooManyArguments};
// The different commands which may be run.
const Command = union(enum) {
startRepl,
runInterpreter: []const u8,
};
@wunki
wunki / unique_chars.rs
Created June 8, 2014 20:04
Unique character check in Rust
use std::os;
fn unique_chars(s: &str) -> bool {
let v: Vec<char> = s.chars().collect();
let mut y = v.clone();
y.dedup();
v.len() == y.len()
}
@wunki
wunki / Dockerfile
Created October 8, 2018 12:26
Continuous integration and deployment for a Clojure project on Gitlab
# Note, this dockerfile only works if you move the .jar
# file into the project directory first. This was done
# to get a clean, without any paths, artifact on Gitlab
FROM openjdk:8-jre-alpine
RUN mkdir -p /app /app/resources
WORKDIR /app
COPY *-standalone.jar .
COPY resources/pegasus/public .
CMD java -jar pegasus-0.1.0-SNAPSHOT-standalone.jar
@wunki
wunki / anonymous-gist.org
Created October 14, 2015 08:53
Run Ubuntu with iohyve

Setup new server

  • iohyve create ubuntuguest 8G
  • iohyve set ubuntuguest loader=grub-bhyve
  • iohyve set ubuntuguest os=debian
  • iohyve set ubuntuguest ram=512M
  • iohyve set ubuntuguest cpu=2
  • iohyve set ubuntuguest con=nmdm1
  • iohyve install ubuntuguest ubuntu-14.04.3-server-amd64.iso
  • Drop in the console: iohyve console ubuntuguest
function curl_time -d "Measure the response time for a given URL"
curl -so /dev/null -w "\
namelookup: %{time_namelookup}s\n\
connect: %{time_connect}s\n\
appconnect: %{time_appconnect}s\n\
pretransfer: %{time_pretransfer}s\n\
redirect: %{time_redirect}s\n\
starttransfer: %{time_starttransfer}s\n\
-------------------------\n\
total: %{time_total}s\n" $argv
@wunki
wunki / config
Last active June 28, 2018 08:06
Faster SSH connections by putting this in your `.ssh/config`. Don't forget to create the `~/.ssh/sockets` directory for it to work.
Host *
ControlMaster auto
ControlPath ~/.ssh/sockets/%r@%h-%p
ControlPersist 600
@wunki
wunki / wercker.yml
Created June 20, 2013 20:41
Wercker deployment script for Clojure.
box: wercker/default
services:
- wercker/postgresql
- wercker/rabbitmq
- wercker/redis
build:
steps:
- script:
name: install clojure
code: |
@wunki
wunki / gist:61ddfd0f199c8f6318c57aef9922ef86
Created March 29, 2018 14:21
Iceberg theme for Termite
# Iceberg color scheme.
[colors]
foreground = #d2d4de
background = #161821
foreground_bold = #d2d4de
cursor = #d2d4de
cursor_foreground = #161821
highlight = #6b7089
# black