Skip to content

Instantly share code, notes, and snippets.

View codeshrew's full-sized avatar
🏂
❄️

Stefan Liedle codeshrew

🏂
❄️
  • Colorado
View GitHub Profile
@codeshrew
codeshrew / Redirect to one page
Last active August 29, 2015 13:56
.htaccess to redirect all pages to the main page
# .htaccess file to redirect all pages to the page/directory specified at the end in the RewriteRule
RewriteEngine On
RewriteCond %{REQUEST_URI} !=/index.html
RewriteCond %{REQUEST_URI} !=/
RewriteCond %{REQUEST_URI} ^(?!/assets/.*$) # This line prevents all contents of this directory from being redirected
RewriteRule ^ / [R=301]
@codeshrew
codeshrew / outlook-disable-autodiscover.scpt
Last active August 29, 2015 13:56
Simple Applescript to switch off Outlook's annoyingly aggressive autodiscover feature
# Outlook has an annoying habit of autodiscovering the internal server and switching your configuration, no matter how many times you manually set it.
# This script will switch off autodiscover so that it will keep whatever manual configuration you give it.
# The only thing you need to do is change INSERT_ACCOUNT_NAME to the name of the account you want this to apply to.
# To reenable autodiscover, just change 'false' to 'true' and run the script again.
tell application "Microsoft Outlook"
set background autodiscover of exchange account "INSERT_ACCOUNT_NAME" to false
end tell
@codeshrew
codeshrew / gist:9240352
Created February 26, 2014 22:44
hosts file settings to optimize .local resolving on Mac
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 something.local
::1 something2.local
::1 something3.local
::1 localhost
fe80::1%lo0 localhost
@codeshrew
codeshrew / open-chrome-disable-web-security.scpt
Last active March 31, 2019 22:27
Launches Google Chrome with web security disabled. This disables the same origin policy for API calls and can ease development from a dev environment not in a server's CORS settings
(* Launches Google Chrome with web security disabled.
This disables the same origin policy for API calls and can
ease development from a dev environment not in a server's CORS settings *)
(* This same command can be sent to Canary by changing
'Google Chrome.app' to 'Google Chrome Canary.app' *)
do shell script "open -a 'Google Chrome.app' --args --disable-web-security --allow-running-insecure-content"
(* If you want to not use your current user in Chrome you can set --user-data-dir to point to /tmp
@codeshrew
codeshrew / angular-select.html
Created October 25, 2014 17:04
Angular select directive with initial selection and track by
<!-- This is an example for initiating the selection in a dropdown to a saved setting
In this case, we're using mongo to store a collection of programs and another to store a collection of projects
The projects reference the ObjectId of a program at `project.program` -->
<select
ng-init="selectedProgram.program = { _id: project.program }"
ng-change="project.program = selectedProgram.program._id"
ng-model="selectedProgram.program"
ng-options="program.name for program in programs track by program._id">
<!-- To have a default selection if there is no match to a program _id, just set an option with an empty value -->

Keybase proof

I hereby claim:

  • I am codeshrew on github.
  • I am stefanliedle (https://keybase.io/stefanliedle) on keybase.
  • I have a public key ASAW4Og2lZZnz-OdezjJR24IU8hE-ohJU2T33ETqS0T9Ago

To claim this, I am signing this object: