Skip to content

Instantly share code, notes, and snippets.

Mislav Marohnić mislav

Block or report user

Report or block mislav

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
mislav /
Last active Apr 5, 2019
hub api example of how to fetch all comments over GraphQL
comments() {
local issue="${1?}"
shift 1
paginate hub api --cache 3600 graphql -F issue="$issue" "$@" -f query='
query ($owner: String = "{owner}", $repo: String = "{repo}", $issue: Int!, $per_page: Int = 30, $after: String) {
repository(owner: $owner, name: $repo) {
issueOrPullRequest(number: $issue) {
... on Issue {
comments(first: $per_page, after: $after) {
mislav / MultiLinkedList.sol
Created Oct 5, 2018 — forked from benzap/MultiLinkedList.sol
Multi Linked List Implementation in Solidity
View MultiLinkedList.sol
pragma solidity ^0.4.24;
Multiple Linked List Storage
Dynamic Storage Contract for storing multiple linked lists each
uniquely identified by a key. Implementation allows for
mislav / untar.go
Created Oct 24, 2017
Go program to untar multiple gzipped tarballs listed on the command line
View untar.go
package main
import (
mislav / es6-symbol-iterators.js
Created Aug 31, 2017
DOM iterables on top of es6-symbol polyfill
View es6-symbol-iterators.js
function iterator() {
const self = this
let i = 0
return {
next: function() {
return {
done: i === self.length,
value: self[i++]
mislav /
Last active Jul 24, 2017
Open specific editor based on directory contents
export EDITOR_XCODEPROJ='open -a XCode'
export EDITOR_TSCONFIG='code'
export EDITOR_DEFAULT='atom'
export EDITOR='magic-open'
mislav / nginx.conf
Last active Apr 23, 2017
SSL nginx configuration for my personal site using Let's Encrypt
View nginx.conf
# primary HTTPS config
server {
listen 443 ssl;
ssl_certificate /etc/letsencrypt/live/;
ssl_certificate_key /etc/letsencrypt/live/;
root /home/app/blog/_site;
index index.html;
mislav / star-trek-all.tsv
Last active Oct 25, 2016
List of Star Trek: The Original Series episodes ranked by their meta-score aggregated from several sites
View star-trek-all.tsv
S-EP episode title score
1-01 The Man Trap -33
1-02 Charlie X 26
1-03 Where No Man Has Gone Before 34
1-04 The Naked Time 64
1-05 The Enemy Within 30
1-06 Mudd's Women -31
1-07 What Are Little Girls Made Of? -1
1-08 Miri -30
1-09 Dagger of the Mind 8
mislav / no_last_pages.rb
Created Oct 11, 2016
Example will_paginate renderer that avoids rendering high page numbers
View no_last_pages.rb
require 'action_view'
require 'will_paginate/view_helpers/action_view'
require 'will_paginate/collection'
current_page = 10
total_pages = 31
class NoLastPages < WillPaginate::ActionView::LinkRenderer
# Make sure no page links are rendered after the `:gap` item that follows
# the current page number.
mislav /
Created Oct 3, 2016
Publish a git branch and open a tmux split that reports the outcome of CI
# Pushes the current branch to origin and opens a tiny tmux split to track
# the CI status. Upon completion, speaks the status aloud using `say`.
set -e
if [ "$1" != "--wait" ]; then
git push -u origin HEAD
tmux split-window -dv -l 2 "'$0' --wait"
ref="$(git rev-parse -q HEAD)"
mislav /
Created Aug 14, 2016
Script to keep your Twitter archive up to date
set -e
cd "${0%/*}"
export GEM_HOME="${PWD}/.gem"
if [ ! -x "${GEM_HOME}/bin/grailbird_updater" ]; then
/usr/bin/gem install grailbird_updater --no-rdoc --no-ri
You can’t perform that action at this time.