Skip to content

Instantly share code, notes, and snippets.

View rawaludin's full-sized avatar
:octocat:
Fix stuff

Rahmat Awaludin rawaludin

:octocat:
Fix stuff
View GitHub Profile

Logo

Now Hiring: ParkatmyHouse.com

At ParkatmyHouse.com we are looking to expand our small team to include a number of new development positions ahead of a major project. Go ahead and take a look at the role descriptions. If the must haves don't quite fit, let us know anyway, you never know!


Front-end Developer

Must have

Sentry is an amazing auth system. But I really need a feature: multiple user types in the same app. And I cannot separate those in groups, because they have different table columns. After 2 days burning my head, I think I found a good solution. The magic is duplicate SentryServiceProvider with new different settings.

This was tested on Laravel 4.0 and Sentry 2. If you're using other version of Sentry, my suggestion is to follow same steps from this gist but use your local files instead copying files from here.

Lets suppose we have a fresh Sentry install with default User ambient. Now we want another ambient called Admin, with new model and different settings. How to do:

1. One model, one ambient

@rawaludin
rawaludin / Preferences.sublime-settings
Created September 2, 2014 01:23
Sublime Text Configuration
{
"auto_complete_commit_on_tab": true,
"bold_folder_labels": true,
"color_scheme": "Packages/Theme - Piatto/Piatto Dark.tmTheme",
"theme": "Piatto Dark 3.sublime-theme",
"piatto_folder_icons": true,
"draw_white_space": "all",
"ensure_newline_at_eof_on_save": true,
"font_size": 14,
"highlight_line": true,
@rawaludin
rawaludin / Default (OSX).sublime-keymap
Created September 2, 2014 06:23
Sublime Text Keymap
[
{ "keys": ["enter"], "command": "commit_completion", "context":
[
{ "key": "auto_complete_visible" },
{ "key": "setting.auto_complete_commit_on_tab", "operand": true }
]
},
]
@rawaludin
rawaludin / .zshrc
Created September 2, 2014 13:10
My ZSH Configuration
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
DEFAULT_USER="rahmatawaludin"
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="agnoster"
LANG=en_US.utf8
@rawaludin
rawaludin / gist:bdb34f02f4f7fbbfb6ac
Created September 29, 2014 08:37
template bootstrap
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Tudu App</title>
<!-- Bootstrap -->
<link href="css/bootstrap.min.css" rel="stylesheet">
@rawaludin
rawaludin / -
Created February 18, 2015 14:49
halo
@rawaludin
rawaludin / stopwatch.sh
Created March 11, 2015 14:35
simple stopwatch in bash
#!/bin/bash
function st() {
BEGIN=$(date +%s)
if [ -z "$1" ]; then
echo Starting Stopwatch...
else
echo $@...
fi
!_TAG_FILE_SORTED 2 /0=unsorted, 1=sorted, 2=foldcase/
AdminCompaniesController /Users/rahmatawaludin/Code/fundplaces/app/controllers/admin/AdminCompaniesController.php /^class AdminCompaniesController extends \\BaseController {$/;" c language:PHP
approve /Users/rahmatawaludin/Code/fundplaces/app/controllers/admin/AdminCompaniesController.php /^ public function approve()$/;" f language:PHP
asset_class_id /Users/rahmatawaludin/Code/fundplaces/app/controllers/admin/AdminCompaniesController.php /^ $asset_class_id = Input::has('asset_class_id') ? Input::get('asset_class_id') : [];$/;" v language:PHP
asset_class_id /Users/rahmatawaludin/Code/fundplaces/app/controllers/admin/AdminCompaniesController.php /^ $asset_class_id = Input::has('asset_class_id') ? Input::get('asset_class_id') : [];$/;" v language:PHP
company /Users/rahmatawaludin/Code/fundplaces/app/controllers/admin/AdminCompaniesController.php /^ $company = Company::findOrFail($id);$/;" v language:PHP
company /Users/rahmatawaludin/Code/fundplaces/app/
'use strict';
var fs = require("fs");
var FilesizeWatcher = function(path) {
var self = this;
self.callbacks = {};
if (/^\//.test(path) === false) {