Skip to content

Instantly share code, notes, and snippets.

View jericrealubit's full-sized avatar
🎯
Focusing

jeric realubit jericrealubit

🎯
Focusing
View GitHub Profile
@jericrealubit
jericrealubit / gist:55cfc0f447c8587fb3c4e31b3b1335c4
Created September 13, 2017 20:56
The then() method returns a Promise. It takes up to two arguments: callback functions for the success and failure cases of the Promise.
authService.login = function(credentials) {
// we need this to return a promise but we also want to hook into the promise.
return ApiInterface.makeRequest('/api/auth', 'POST', credentials)
.then( function(response) { // success
Session.setAuthToken(response.data.authToken);
Session.initDataStore('order-details', credentials);
$rootScope.$emit(AUTH_EVENTS.loginSuccess);
})
.catch( function(error) { // failed
@jericrealubit
jericrealubit / gist:3ecf16c698dc411e291a09b0fb2d9342
Created September 13, 2017 20:56
The then() method returns a Promise. It takes up to two arguments: callback functions for the success and failure cases of the Promise.
authService.login = function(credentials) {
// we need this to return a promise but we also want to hook into the promise.
return ApiInterface.makeRequest('/api/auth', 'POST', credentials)
.then( function(response) { // success
Session.setAuthToken(response.data.authToken);
Session.initDataStore('order-details', credentials);
$rootScope.$emit(AUTH_EVENTS.loginSuccess);
})
.catch( function(error) { // failed
@jericrealubit
jericrealubit / rabbitmq.txt
Created September 13, 2017 20:49 — forked from sdieunidou/rabbitmq.txt
create admin user on rabbitmq
rabbitmqctl add_user test test
rabbitmqctl set_user_tags test administrator
rabbitmqctl set_permissions -p / test ".*" ".*" ".*"
@jericrealubit
jericrealubit / readme.md
Created June 30, 2017 05:18 — forked from nasrulhazim/readme.md
Send Welcome Email Notification with Event and Listener

Send Welcome Email Notification with Event and Listener

Step 1

Create SendWelcomeEmailNotification notification

php artisan make:notification SendWelcomeEmailNotification
@jericrealubit
jericrealubit / gist:8af8d878fc55629e7804e3e9ab2e1263
Last active June 27, 2017 21:36
Creditcard Validation AMEX is not accepted: This validation is in the 4th input box in the credit card input form. Will show error msg when the user input 3 numbers in the 4th input box.
$(document).ready(function() {
var cc_4 = $("input[name='cc_4']");
cc_4.blur( function() { // DEV-599
if ( (cc_4.val().length) == 3 ) {
var no_amex = "Sorry American Express is not accepted.";
if ( $('#cc_number-E').length ) {