Skip to content

Instantly share code, notes, and snippets.

View florisvlasveld's full-sized avatar

Floris Vlasveld florisvlasveld

View GitHub Profile
@florisvlasveld
florisvlasveld / macos_bootstrap.sh
Last active April 19, 2020 20:31 — forked from codeinthehole/osx_bootstrap.sh
Script to install stuff I want on a new macOS machine
#!/usr/bin/env bash
#
# Bootstrap script for setting up a new macOS machine
# This should be idempotent so it can be run multiple times.
echo "Starting bootstrapping"
# Check for Homebrew, install if we don't have it
if test ! $(which brew); then
echo "Installing homebrew..."
@florisvlasveld
florisvlasveld / disable.sh
Last active December 22, 2019 08:27
Disable bunch of #$!@ in Catalina
#!/bin/bash
# IMPORTANT: Don't forget to logout from your Apple ID in the settings before running it!
# IMPORTANT: You will need to run this script from Recovery. In fact, macOS Catalina brings read-only filesystem which prevent this script from working from the main OS.
# This script needs to be run from the volume you wish to use.
# E.g. run it like this: cd /Volumes/Macintosh\ HD && sh /Volumes/Macintosh\ HD/Users/sabri/Desktop/disable.sh
# WARNING: It might disable things that you may not like. Please double check the services in the TODISABLE vars.
# Get active services: launchctl list | grep -v "\-\t0"
# Find a service: grep -lR [service] /System/Library/Launch* /Library/Launch* ~/Library/LaunchAgents
class User < ObjectJSONMapper::Base
  delegate :name, to: :local
end

User.find(1).name
# GET http://localhost:3000/users/1
# SELECT * FROM users WHERE id = 1 LIMIT 1
@florisvlasveld
florisvlasveld / Gmail Wacht op Antwoord
Created January 12, 2014 14:10
Google Apps Scripts, de eerste om het label "Wacht op antwoord" automatisch te verwijderen van een mailtje zodra het weer in de inbox zit.
function _getLabel() {
var label_text = "Wacht op antwoord";
var label = GmailApp.getUserLabelByName(label_text);
return label;
}
function removeLabel() {
var label = _getLabel();
var threads = GmailApp.search('label:Wacht-op-antwoord');