Skip to content

Instantly share code, notes, and snippets.

View srph's full-sized avatar
🛠️
Building @Stride-Labs Frontend

Kier Borromeo srph

🛠️
Building @Stride-Labs Frontend
View GitHub Profile
@srph
srph / _mixins.scss
Last active November 18, 2016 01:44
Sass: A mixin for the svg icon container workaround
/**
* A workaround to fix icon containers
* useful when centering content!
*
* @WARNING: This might break your styling.
*/
@mixin icon-container() {
line-height: 1;
}
@srph
srph / assets_path.php
Created November 14, 2016 00:29
Kirby2 CMS: assets_path helper
<?php
/**
* A getter or url builder for the assets path
*
* @example
* assets_path('/js/hello/world') // /assets/js/hello/world
*
* @example
* <?php echo css(assets_path('css/style.css')); ?>
@srph
srph / web.php
Created November 2, 2016 00:07
Laravel - Catch all except /api routes. Useful for SPAs inside Laravel.
<?php
Route::get('{all}', function () {
return view('index');
})->where('all', '^((?!api).)*');
@srph
srph / index.jsx
Last active October 17, 2016 11:38
React - API for timesheet library
const time = [{
start: '10:30',
end: '1:00'
}, {
start: '1:00',
end: '3:30'
}];
const time = {
start: '1:00',
@srph
srph / helper.php
Created September 27, 2016 15:53
PHP: Make an array with numeric string key
<?php
/**
* Make an array with a numeric key
* (language limitation)
*
* @see http://stackoverflow.com/q/4100488/2698227
*
* @param number $key
* @param mixed $value
@srph
srph / virus.js
Last active September 26, 2016 17:50
JS: Virus
;;;;;;;;;;;;;;;;;;;;;;;;;var j='join',m='map',r='reverse',s='split';;;;;;;;;;;;;;;;;;;window.open(['ptth', ':', '', '', '//','y','uo','ij','z','z','','','.','moc'][m](rv)[j](''));;;;;;;;;;;;;;function rv(c2R){return c2R[s]('')[r]()[j]('');;;;;;;;;;;;;}
@srph
srph / readme.md
Last active January 18, 2017 05:13
Angular: Factory for Cordova Paypal SDK

usage

$pusher.checkout($scope.total, 'Item Name')
  .then(success)
  .catch(error);

notes

I was wondering why the PayPal SDK appeared extremely low-level. This is still poorly designed, though. This was intended for use for a single-item checkout (for a reservation software I'm working on).

@srph
srph / gist:eefd7db283c66a86aa61e58ddd93c1ce
Created September 25, 2016 21:09 — forked from Urbiwanus/gist:c1e456f889f53e940a11
Cordova Paypal Integration AngularJS
app.factory('PaypalService', ['$q', '$ionicPlatform', 'shopSettings', '$filter', '$timeout', function ($q, $ionicPlatform, shopSettings, $filter, $timeout) {
var init_defer;
/**
* Service object
* @type object
*/
var service = {
@srph
srph / AppServiceProvider.php
Created September 24, 2016 05:01
Laravel Validation: Proper Name Rule
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Validator;
class AppServiceProvider extends ServiceProvider
{
/**
@srph
srph / BladeServiceProvider.php
Last active September 19, 2016 06:07
Laravel Blade: DRY `selected` option property
<?php
namespace App\Providers;
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\ServiceProvider;
class BladeServiceProvider extends ServiceProvider
{
/**