Skip to content

Instantly share code, notes, and snippets.

View idleberg's full-sized avatar

Jan T. Sott idleberg

View GitHub Profile
@idleberg
idleberg / iscc
Created May 18, 2016 10:31 — forked from derekstavis/iscc
Compile InnoSetup scripts on unices
#!/bin/sh
# For installation and usage, please refer to my blog post:
# http://derekstavis.github.io/posts/creating-a-installer-using-inno-setup-on-linux-and-mac-os-x/
#
# The MIT License (MIT)
#
# Copyright (c) 2014 Derek Willian Stavis
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
@idleberg
idleberg / .htaccess
Last active November 25, 2017 12:06
Baikal Server Apache settings for iOS and macOS
# Last tested with Baikal 0.4.6
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
# iOS 9.2
RewriteRule /.well-known/carddav /html/card.php [R,L]
RewriteRule /.well-known/caldav /html/cal.php [R,L]
# Mac OS X 10.10
Redirect /.well-known/carddav /html/card.php
</IfModule>
@idleberg
idleberg / sublime-brew.py
Last active November 17, 2015 15:49
Install Brew dependencies for Sublime Packages, e.g. linters
# https://gist.github.com/idleberg/df8f04ec04d2b523d5ff
import os, sublime, sublime_plugin, subprocess
# Array of required Brew packages
packages = [
''
]
def plugin_loaded():
@idleberg
idleberg / sublime-npm.py
Last active November 17, 2015 15:48
Install npm dependencies (global) for Sublime Packages, e.g. linters
# https://gist.github.com/idleberg/ca5714fd2b9607db02b8
import os, sublime, sublime_plugin, subprocess
# Array of required Node packages
packages = [
''
]
def plugin_loaded():
@idleberg
idleberg / droppid.sh
Last active October 5, 2018 00:34
Script to alter the priority of the Dropbox client (on Mac OS X)
#!/bin/bash
# droppid v0.2.3
# Public Domain Mark 1.0
# https://gist.github.com/idleberg/81ed196f2401be045893
#
# Usage: sudo [sh] droppid.sh [priority]
# Check for sudo
if [ "$EUID" -ne 0 ]; then
@idleberg
idleberg / sublime-chmod.py
Last active February 24, 2024 02:17
Make files of Sublime Text package executable, runs on installation/upgrade
# https://gist.github.com/idleberg/03bc3766c760bb4b81e3
import os, stat, sublime, sublime_plugin
# Array of files, relative to package directory
files = [
'my-script.sh'
]
def plugin_loaded():
@idleberg
idleberg / spotlight_indexing.md
Last active December 15, 2015 01:55
Enable Spotlight indexing for drives

Enable Spotlight indexing for volumes (network shares, external disks, etc.) in Terminal

# enable indexing
mdutil /Volumes/name -i on

# disable indexing
mdutil /Volumes/name -i off

# check indexing status
@idleberg
idleberg / DropboxIgnore.md
Last active June 4, 2023 12:02
Ignore node_modules/bower_components folders in your Dropbox

This script scans your Dropbox (or any given folder) for folders stored in the ignore array and excludes them from syncing. Makes use of the official Dropbox CLI

I'm a beginner at bash, so all improvements are welcome!

#!/bin/bash

set -e

# SETTINGS
<?php
session_start();
if (isset($_GET["locale"])) {
$locale = $_GET["locale"];
} else if (isset($_SESSION["locale"])) {
$locale = $_SESSION["locale"];
} else {
$locale = "en_US";
@idleberg
idleberg / Install-Mcrypt.md
Last active June 24, 2025 10:26
Install Mcrypt on macOS

Setup php-mcrypt on macOS (and versions of Mac OS X)

These steps should have been mentioned in the prerequisites of the Laravel Installation Guide, since I'm surely not the only person trying to get Laravel running on macOS.

Install

Install Mcrypt using Homebrew and PECL (comes with PHP)

# PHP 7.3