Skip to content

Instantly share code, notes, and snippets.

View tarzan's full-sized avatar
💭
🥇

Maarten Jacobs tarzan

💭
🥇
  • Defacto
  • Groningen
View GitHub Profile
@tarzan
tarzan / backdoor.ex
Created July 3, 2018 19:12
An alternative to https://github.com/ueberauth/guardian_backdoor, that doesn't create tokens twice in acceptance tests.
if Mix.env() == :test do
defmodule Detroit.Guardian.Plug.Backdoor do
@moduledoc """
This plug allows you to bypass authentication in acceptance tests by passing
the token needed to load the current resource directly to your Guardian module
via a query string parameter.
This is an abstraction from https://github.com/ueberauth/guardian_backdoor
but then without needing to create the actual token twice.
"""
#
# Sets Prezto options.
#
# Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
#
# General
#
DECLARE
@UsernameLogin bit,
@AlterInlog bit,
@execute varchar(max)
set @UsernameLogin = (select isnull((select VALUE_BOOLEAN from ZSET_Settings where SETTINGKEY = 'Logon.EnableUsernameLogin'), 0))
set @AlterInlog = (select isnull((select 1 from syscolumns where name = '_INLOGNAAM' and id = (select id from sysobjects where name = 'PERS_Personen')), 0))

Keybase proof

I hereby claim:

  • I am tarzan on github.
  • I am maartenj (https://keybase.io/maartenj) on keybase.
  • I have a public key ASBa9swM1FARzoHxpGsaXD6HwGfXrdblVQGZuHimvXoXywo

To claim this, I am signing this object:

@tarzan
tarzan / SublimeLinter.sublime-settings
Created December 21, 2015 11:16
SublimeLinter3 settings
{
"user": {
"debug": false,
"delay": 0.25,
"error_color": "D02000",
"gutter_theme": "Packages/SublimeLinter/gutter-themes/Default/Default.gutter-theme",
"gutter_theme_excludes": [],
"lint_mode": "background",
"linters": {
"jscs": {
@tarzan
tarzan / active_record_cache_key_test.rb
Created September 29, 2015 13:40
Following Rails ActiveRecord test fails running on a OS that supports nano-seconds timestamps, ie NOT OS X
begin
require 'bundler/inline'
rescue LoadError => e
$stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler'
raise e
end
gemfile(true) do
source 'https://rubygems.org'
gem 'rails', github: 'rails/rails'
@tarzan
tarzan / gist:db3a5ffedd88668e7a6f
Last active August 29, 2015 14:16
Preferences.sublime-settings
{
"bold_folder_labels": true,
"caret_style": "phase",
"color_scheme": "Packages/Zissou Color Schemes/Belafonte-Night.tmTheme",
"ensure_newline_at_eof_on_save": true,
"font_size": 12.0,
"highlight_line": true,
"ignored_packages":
[
"Vintage"
# # SQLite version 3.x
# # gem install sqlite3
# #
# # Ensure the SQLite 3 gem is defined in your Gemfile
# # gem 'sqlite3'
# development:
# adapter: sqlite3
# database: db/development.sqlite3
# pool: 5
# timeout: 5000
@tarzan
tarzan / gist:7357170
Created November 7, 2013 16:10
Auth service
'use strict';
angular.module('360FeedbackApp')
.factory('Auth', function($cookieStore, Restangular) {
var accessLevels = routingConfig.accessLevels;
var userRoles = routingConfig.userRoles;
var endPoint = Restangular.all('users');
var currentUser = $cookieStore.get('user') || {
firstName: '',
@tarzan
tarzan / .jsbeautifyrc
Last active July 13, 2018 12:43
.jsbeautifyrc
{
// Details: https://github.com/victorporof/Sublime-HTMLPrettify#using-your-own-jsbeautifyrc-options
// Documentation: https://github.com/einars/js-beautify/
"html": {
"brace_style": "collapse", // "expand", "end-expand", "expand-strict"
"indent_char": " ",
"indent_scripts": "keep", // "separate", "normal"
"indent_size": 4,
"max_preserve_newlines": 10,
"preserve_newlines": true,