Skip to content

Instantly share code, notes, and snippets.

View samuelcar's full-sized avatar

Samuel Carvajal samuelcar

View GitHub Profile
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
@samuelcar
samuelcar / numberOfPaths.js
Created September 15, 2015 10:42
Solving the "Number of Paths" problem using JavaScript
var numberOfPaths = function(matrix, i, j, size) {
var count = 0;
if (i == size - 1 && j == size - 1) {
return matrix[i][j];
}
if (i == size - 1) {
return matrix[i][j + 1]
}
if (j == size - 1) {
return matrix[i + 1][j]
@samuelcar
samuelcar / 0_reuse_code.js
Last active August 29, 2015 14:15
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
<?php
/**
* A controller plugin for protecting forms from CSRF
*
* Works by looking at the response and adding a hidden element to every
* form, which contains an automatically generated key that is checked
* on the next request against a key stored in the session
*
* @author Jani Hartikainen <firstname at codeutopia net>
*/
@samuelcar
samuelcar / reload_page.js
Created January 26, 2015 10:41
Reload the page using AJAX via JS
function reload_page(){
$.ajax(
{
url:"",
context:document.body,
success: function(s,x){
$(this).html(s);
}
}
);
@samuelcar
samuelcar / update-on-input.js
Last active August 29, 2015 14:13
detects when the user inputs over a forms field
var propertyChangeUnbound = false;
$("#testbox").on("propertychange", function(e) {
if (e.originalEvent.propertyName == "value") {
alert("Value changed!");
}
});
$("#testbox").on("input", function() {
if (!propertyChangeUnbound) {
$("#testbox").unbind("propertychange");
@samuelcar
samuelcar / routes.php
Created July 4, 2014 10:02
Route filters for Login, inGroup and hasAccess using sentry on laravel (taken from laravel snippets)
/**
* Sentry filter
*
* Checks if the user is logged in
*/
Route::filter('Sentry', function()
{
if ( ! Sentry::check()) {
return Redirect::route('cms.login');
}