Skip to content

Instantly share code, notes, and snippets.

View idleberg's full-sized avatar

Jan T. Sott idleberg

View GitHub Profile
@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
*/
@idleberg
idleberg / build_scummc.sh
Created November 14, 2017 22:21
Build ScummC on macOS
# Pre-requisites
brew install bison
brew link bison --force
# Clone ScummC
git clone https://github.com/AlbanBedel/scummc
cd scummc
# Build
./configure
@idleberg
idleberg / gulp.sh
Created September 11, 2017 06:57
Spawn Gulp in sub-folder relative to Git root
#!/bin/sh
GIT_ROOT="$(git rev-parse --show-toplevel)"
DIRECTORY="$GIT_ROOT/path/to/subfolder"
printf "Spawning gulp in \"$DIRECTORY\"\n\n"
gulp --cwd "$DIRECTORY" $@
@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 / pynsist.sublime-build
Created July 22, 2017 11:48
Pynsist build file for Sublime Text
{
"selector": "source.ini",
"cmd": ["pynsist", "$file"],
"variants": [
{ "name": "No MakeNSIS",
"cmd": ["pynsist", "--no-makensis", "$file"]
}
]
}
@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 / sublime-text-macos-context-menu.md
Last active February 20, 2024 09:37 — forked from vincentmac/sublime-text-osx-context-menu.md
“Open in Sublime Text” in macOS context-menu

This list has been updated for Big Sur (and later). Since I don't use these versions, this guide might still need further improvements. For older macOS versions, please see this older revision.

Open in Sublime Text

  • Open Automator
  • Quick Action
  • Set “Service receives selected” to files or folders in any application
  • Add a Run Shell Script action
  • Set the script action to /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl -n "$@"
  • Set “Pass input” to as arguments
@idleberg
idleberg / atomizr_features.md
Last active March 24, 2017 06:33
Atomizr Feature Comparison
Functionality [Ruby][1] [Node][2] [Atom][3] [Sublime Text][4]
Atom to Sublime Text                     ✓       ✓      
Atom to TextMate
Atom to Visual Studio Code
Sublime Text to Atom
Sublime Text to TextMate
Sublime Text to Visual Studio Code
TextMate to Atom
TextMate to Sublime Text
@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>