Skip to content

Instantly share code, notes, and snippets.

View lislis's full-sized avatar
🍿
Derp

lislis lislis

🍿
Derp
View GitHub Profile
@lislis
lislis / functions.php
Created October 21, 2014 11:15
Get a list of all blogs in a Wordpress mulisite installation with an image for each blog
/*
* This is kind of a hack but it gets the job done.
* Paste this in your theme's functions.php
* The function returns an array of all blogs in the multisite network.
* For the image I make use of Wordpress' custom header functionality
*/
function get_all_blogs() {
$blogs = array();
$count = 0;
@lislis
lislis / offlineCtx.js
Last active September 15, 2015 21:28
analyse a sound file and play it after that
offlineCtx = new OfflineAudioContext(1, 44100 * 60, 44100);
offlineAnalyser = offlineCtx.createAnalyser();
offlineAnalyser.fftSize = 4096;
offlineProcessor = offlineCtx.createScriptProcessor(16384, 1, 1);
offlineProcessor.connect(offlineCtx.destination);
offlineSource = offlineCtx.createBufferSource();
@lislis
lislis / anti-pong.clj
Created June 17, 2016 14:39
A rough prototype for anti-pong for Quil in Clojure
(ns quil-games.core
(:require [quil.core :refer :all]
[quil.middleware :as m])
(:gen-class))
(defn setup []
{:score 0
:ball
{:x 0
:y 60
@lislis
lislis / spezi.zsh-theme
Last active April 14, 2017 15:18
zsh theme
# ZSH Theme - Preview: http://gyazo.com/8becc8a7ed5ab54a0262a470555c3eed.png
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
local user='%{$fg[blue]%}%n%{$reset_color%}'
local host='@$fg[magenta]%}%m%{$reset_color%}:%{$reset_color%}'
local current_dir='%{$fg[yellow]%}%~%{$reset_color%}'
local git_branch='$(git_prompt_info)%{$reset_color%}'
PROMPT="╭─${user}${host}${current_dir} ${git_branch}
@lislis
lislis / .travis.yml
Created September 5, 2018 14:08
Headless Chrome Config on Travis with Rails and Capybara
# [...]
addons:
chrome: stable
@lislis
lislis / scroll.js
Created January 16, 2019 17:45
Fixed nav fade out on scroll-down, fade in on scroll up, vanilla js
// based on the jquery version of https://medium.com/@mariusc23/hide-header-on-scroll-down-show-on-scroll-up-67bbaae9a78c
var didScroll;
var lastScrollTop = 0;
var delta = 8; // to prevent 'accidental' trigger
var navbarHeight = 85; // probably in css
var navbarElem = document.querySelector('.navbar');
window.addEventListener('scroll', function (ev) {
didScroll = true;
@lislis
lislis / event.md
Last active October 5, 2021 11:52
Hugo ical template

title: "Event title" slug: event-title date: "2020-03-02T19:30:00+01:00" summary: "the standard says this should be less than 75 characters!" end: "2020-03-02T22:00:00+01:00" location: "Event location if known" organizer: name: "Your name" email: "your@email.com"

@lislis
lislis / rails_new.sh
Created March 17, 2020 20:03
rails new without things
rails new --skip-action-mailer --skip-action-mailbox --skip-action-text --skip-active-storage --skip-action-cable --skip-javascript --skip-turbolinks --skip-sprockets --skip-git --skip-keep --skip-listen some_name
@lislis
lislis / passwords.md
Created March 19, 2020 13:31
General Security Tips

Passwords

What makes a stromg password?

Password length

These days a strong password should have at least 12 characters of length. The more the better, because if an attacker does not know anything about our password, they have to try every possible combination and the options increase exponentially!

Numbers, uppercase letters etc

While it's a good idea to increase the entropy in the characterset you're using for your password (like, how many options there are for a single character in the password if an attacker had to guess all possible combinations), it only makes sense if it's truely random. Humans are actually very bad at thinking of randomnes.

@lislis
lislis / abstract.md
Created July 20, 2020 15:10
CEST - Talk

From Nand to Dinner - A Midsummer Night's Talk

Summer vacation is the perfect time to travel, experience different places and learn about the world. With the current state of the world however, let's stay home. Let's still travel though, to the land of electronics, experience logic gates and learn about dinner.


Lisa is a freelance creative technologist focusing on how individuals and society interact with technology.