Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View leabdalla's full-sized avatar
🏠
Working from home

Leandro Abdalla leabdalla

🏠
Working from home
View GitHub Profile
@Toanzzz
Toanzzz / delete-slack-messages.js
Last active January 21, 2020 18:53 — forked from firatkucuk/delete-slack-messages.js
Deletes slack public/private channel and chat messages.
#!/usr/bin/env node
// Channel ID is on the the browser URL.: https://mycompany.slack.com/messages/MYCHANNELID/
// Token can get from: https://api.slack.com/custom-integrations/legacy-tokens
// Pass it as a parameter: node ./delete-slack-messages.js TOKEN CHANNEL_ID
// Or use it without download the script: curl -Ls RAW_GIST_URL | node - TOKEN CHANNEL_ID
// GLOBALS #############################################################################################################
const [, , token, channel, _delay = 300] = process.argv
@j3j5
j3j5 / gist:8b3e48ccad746b90a54a
Last active November 16, 2023 15:11
Adyen Test Card Numbers
Adyen Test Card Numbers
These cards are only valid on our TEST system and they will never involve any actual transaction or transfer of funds. The TEST card numbers will not work on the Adyen LIVE Platform.
For all cards use the following expiration and CVV2/CVC2/or CID for Amex.
For all cards:
Expiration Dates CVV2 / CVC3 CID (American Express)
08/2018 OR 10/2020 737 7373
@leabdalla
leabdalla / Laravel Sentry 2 with multiple user types.md
Last active February 10, 2024 10:57
Laravel Sentry 2 with multiple user types, finally.

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

@sineld
sineld / multiLanguageL4.php
Created May 15, 2013 11:23
multiLanguageL4.php
<?php
// http://stackoverflow.com/questions/16559421/t-can-not-switch-language-in-laravel4?utm_source=laravel
// app/routes.php
Route::get('lang/{lang}', function($lang)
{
Session::put('my.locale', $lang);
return Redirect::to('/');
});
@kapv89
kapv89 / query-logger.php
Last active January 8, 2019 15:21
Log Queries in L4
<?php
Event::listen('illuminate.query', function($query, $bindings, $time) {
static $count;
if(App::make('env') === 'local')
{
$logFile = __DIR__.'/../storage/logs/queries';
ob_start();
var_dump($bindings, $query);
$str = ob_get_clean();
if($count === null)
@StefanoRausch
StefanoRausch / Default (OSX).sublime-keymap
Created February 14, 2013 16:26
Sublime : 2 Columns Layout Management
[
{ "keys" : [ "alt+1" ], "command" : "focus_group", "args" : { "group" : 0 } },
{ "keys" : [ "alt+2" ], "command" : "focus_group", "args" : { "group" : 1 } },
{ // workspace left
"keys" : [ "ctrl+alt+super+left" ],
"command" : "run_multiple_commands",
"args" : {
@rajraj
rajraj / es.sh
Created January 3, 2012 20:07 — forked from aaronshaf/es.sh
Install ElasticSearch on CentOS 6
cd ~
sudo yum update
sudo yum install java-1.7.0-openjdk.i686 -y
wget https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.9.tar.gz -O elasticsearch.tar.gz
tar -xf elasticsearch.tar.gz
rm elasticsearch.tar.gz
mv elasticsearch-* elasticsearch
sudo mv elasticsearch /usr/local/share