Skip to content

Instantly share code, notes, and snippets.

View idleberg's full-sized avatar

Jan T. Sott idleberg

View GitHub Profile
@idleberg
idleberg / MastodonIFTTT.md
Last active June 17, 2023 21:51
Connecting IFTTT with Mastodon

Connecting IFTTT with Mastodon

As of the time of this writing, IFTTT has no integration for Mastodon. Yet, it's possible to connect the two.

Mastodon

  1. Login to your Mastodon account

  2. Go to Preferences > Developer and register a new application with write:statuses permission.

@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
@idleberg
idleberg / Install-Mcrypt.md
Last active May 31, 2023 17:13
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
@idleberg
idleberg / rle_dec.lua
Last active September 8, 2022 09:33
RLE decoder that supports Pico-8's subset of Lua
-- Helper function to repeat string
function rep(char, multiplier)
local out = ""
for i=1, multiplier do
out = out..char
end
return out
end
@idleberg
idleberg / scopes.md
Last active May 30, 2022 18:07 — forked from iambibhas/scopes.txt
List of scopes for Sublime Text and Atom. Follow three simple rules when contributing: 1. Link whenever possible, use atom.io and Package Control links (if possible) 2. Always link third-party packages, use current Markdown link structure 3. Alphabetize!
File type Sublime Text Atom
ActionScript source.actionscript.2 ?
AppleScript source.applescript [.source.applescript]
ASP source.asp ?
Batch File source.dosbatch ?
BibTex source.bibtex ?
BridleNSIS [source.nsis.bridle] [.source.nsis.bridle]
C source.c [.source.c]
C# source.cs [.source.cs]
@idleberg
idleberg / atom-macos-context-menu.md
Last active April 27, 2022 00:37
“Open in Atom” in macOS context-menu

Open in Atom

  • Open Automator
  • Create a new Service
  • Set “Service receives selected” to files or folders in any application
  • Add a Run Shell Script action
  • Set the script action to /usr/local/bin/atom -n "$@"
  • Set “Pass input” to as arguments
  • Save as Open in Atom
@idleberg
idleberg / auto-deploy.md
Created August 20, 2017 18:16 — forked from domenic/0-github-actions.md
Auto-deploying built products to gh-pages with Travis

Auto-deploying built products to gh-pages with Travis

This is a set up for projects which want to check in only their source files, but have their gh-pages branch automatically updated with some compiled output every time they push.

Create a compile script

You want a script that does a local compile to e.g. an out/ directory. Let's call this compile.sh for our purposes, but for your project it might be npm build or gulp make-docs or anything similar.

The out/ directory should contain everything you want deployed to gh-pages. That almost always includes an index.html.

@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 / avsex.md
Last active May 19, 2018 19:35
avs expressions

Bump

x, y, isBeat, isLBeat, bi

Color Modifier

red, green, blue

Dynamic Distance Modifier

@idleberg
idleberg / in_arrayi.php
Created January 23, 2018 11:48 — forked from sepehr/in_arrayi.php
PHP: Case-insensitive in_array()
<?php
/**
* Case-insensitive in_array() wrapper.
*
* @param mixed $needle Value to seek.
* @param array $haystack Array to seek in.
*
* @return bool
*/