Skip to content

Instantly share code, notes, and snippets.

View f-f's full-sized avatar
🍝
All undocumented software will be reverse-engineered and rewritten

Fabrizio Ferrai f-f

🍝
All undocumented software will be reverse-engineered and rewritten
View GitHub Profile
@martin-hewitt
martin-hewitt / gist:2e022bba0775c8ac1e39
Created January 20, 2015 10:55
Docker Stack - Ghost, piwik & ownCloud under SSL'd nginx
# Get a server, somehow. Mine runs CentOS 7
# All commands to be run as root, so either sudo su, or add sudo to each one
# Install Docker
yum install docker
# This nginx proxy listens to the main Docker socket for containers starting
# and stopping. It then reads the VIRTUAL_HOST environment variable for that
# container and creates a proxy route for each one. Containers without a
# VIRTUAL_HOST environment variable will be ignored. This fork also allows
@pesterhazy
pesterhazy / react-native-only.py
Created August 5, 2016 13:55
Filter "react-native log-ios" output for relevant app logs
#!/usr/bin/env python
# Cleans up the output of "react-native log-ios" by
# removing all output not related to your app, similarly
# to how it works in the XCode debug window
#
# Usage: react-native log-ios | ./react-native-only.py "<string>"
#
# where "<string>" is the name of your app as known
# to the iOS logging system. E.g. "SimpleExampleApp"
@vikeri
vikeri / debug-re-frame-subs.clj
Last active September 3, 2016 15:35
re-frame debug sub macro
;; A macro that replaces reg-sub, it inserts debug print statements into reg-sub if a flag of choice is set
;; Developed since 0.8.0 does not work with re-frame-tracer
;; Use it by replacing re-frame.core/reg-sub with this macro
(defmacro reg-sub [label & sub]
(let [fun (last sub)
arg (get-in (vec fun) [1 1 1])
[before after] (split-at 2 fun)
new-fun (concat before [`(js/console.log "Sub: " [~label ~arg])] after)]
(if (= "true" env/PRODUCTION) ;; Or whatever way you want to disable this, may also be done by replacing js/console.log above
@dustingetz
dustingetz / gist:71fe73f8599b13c9e59e
Last active October 4, 2016 12:11
hypercrud livecoding demo
;; Datomic uses immutability to make read queries come from in-app process instead of network.
;; Web service backed by datomic can have same performance characteristics - browser ajax read
;; queries can come from in-browser. Changes browser programming model - can code as if all data
;; is local. Removes all read-IO from browser apps. Components that do IO can now compose.
;; Still ACID & relational queries like datomic.
;;
;; Other solutions to same problem: Facebook Relay/GraphQL, Netflix Falcor, Om Next
@bhauman
bhauman / compiler-options-schema.clj
Last active August 8, 2017 21:19
A Schema for ClojureScript Options
(ns cljs.compiler-options-schema
(:require
[clojure.spec :as s]
[clojure.string :as string]
;; for initial dev
[clojure.test :refer [deftest is testing]]))
(defn non-blank-string? [x] (and (string? x) (not (string/blank? x))))
(defonce ^:private registry-ref (atom {}))
@mbutz
mbutz / gist:8bf1a47a608a368272f2
Last active November 2, 2017 19:24
Sonic Pi Sequencer - Beta 2
# Sonic Pi Sequencer (v2)
# Simplified notation of synth lines, can now play chords
use_debug false
set_volume! 1
use_bpm 120 # beat = quarter note
# TODO
# Make 'play_rhythm_bar' to work with an array of samples like 'play_melody_bar'
@hellerve
hellerve / capitalize-string.carp
Last active January 19, 2020 15:13
Our solutions to the puzzles from the Clojure Berlin Meetup in January, in Carp
; as an introduction, we tried to do string capitalization by hand,
; using as many different interesting idioms as possible
(defn capitalize-char [c]
(if (Char.lower-case? c)
(=> c
(to-int)
(- 32)
(from-int))
c))
@bbarker
bbarker / purescript-rpi4-howto.md
Last active June 6, 2020 12:26
Building or Installing PureScript on the Raspberry Pi 4 with Raspbian and the Nix package manager

Prerequisites

  • A Raspberry Pi 4 with Raspbian 10
  • At least a 32GB SD card and probably at least 10GB of free space available.

Overview

Increase swap space, switch to a 64-bit kernel to use Nix aarch64 packages, and use Nix packages where possible. At the time of this writing it was only necessary to build PureScript (purs) itself; you can check Hydra to see

Experimental Generation of Interpersonal Closeness

Instructions to Subjects Included With Task Slips Packet

This is a study of interpersonal closeness, and your task, which we think will be quite enjoyable, is simply to get close to your partner. We believe that the best way for you to get close to your partner is for you to share with them and for them to share with you. Of course, when we advise you about getting close to your partner, we are giving advice regarding your behavior in this demonstration only, we are not advising you about your behavior outside of this demonstration.

In order to help you get close we've arranged for the two of you to engage in a kind of sharing game. You're sharing time will be for about one hour, after which time we ask you to fill out a questionnaire concerning your experience of getting close to your partner.

You have been given three sets of slips. Each slip has a question or a task written on it. As soon as you both finish reading these instructions, you should

@sjsyrek
sjsyrek / world-building-with-tom-harding.md
Last active February 7, 2021 21:14
World-Building in Haskell with Tom Harding

Here's the unusually long linkography from the Zoom chat during World Building in Haskell with Tom Harding:

Perlin noise youtube playlist: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6bgPNQAdxQZpJuJCjeOr7VD

Tom's repo: https://github.com/i-am-tom/world-building-in-haskell/blob/7c75b3711c021bf32f2c4c521accf03a32c7597d/src/Data/Vect.hs

The inventor of Liquid Haskell Ranjit Jhala is funny: https://www.youtube.com/watch?v=Ci48kqp11F8

Fun Prolog stuff, totally off-topic: https://arxiv.org/abs/1809.02840