Skip to content

Instantly share code, notes, and snippets.

View KABBOUCHI's full-sized avatar
🎯
Focusing

Georges KABBOUCHI KABBOUCHI

🎯
Focusing
View GitHub Profile
@KABBOUCHI
KABBOUCHI / WebhooksController.php
Created February 27, 2017 22:45 — forked from benluxford/WebhooksController.php
Stripe Webhook Controller with Event Checking for Laravel 5; based on Laracasts lesson - How to Accept Payments: Cleaner Webhook Management: https://laracasts.com/series/how-to-accept-payments-with-stripe/episodes/10 ... Thanks to @JeffreyWay @laracasts @taylorotwell @laravel
<?php
namespace App\Http\Controllers;
use Stripe\Stripe;
use Stripe\Event;
use Illuminate\Http\Request;
class WebhooksController extends Controller
{
@KABBOUCHI
KABBOUCHI / toggle-menu.js
Created May 27, 2017 21:06 — forked from Bradcomp/toggle-menu.js
Toggles the .is-active class for a hamburger menu
(function() {
var burger = document.querySelector('.nav-toggle');
var menu = document.querySelector('.nav-menu');
burger.addEventListener('click', function() {
burger.classList.toggle('is-active');
menu.classList.toggle('is-active');
});
})();
# stop script on error signal
set -e
# remove old deployment folders
if [ -d "/home/forge/weather-deploy" ]; then
rm -R /home/forge/weather-deploy
fi
if [ -d "/home/forge/weather-backup" ]; then
rm -R /home/forge/weather-backup
fi
@KABBOUCHI
KABBOUCHI / sluggenerator.cs
Created July 10, 2017 20:11 — forked from paracycle/sluggenerator.cs
Slug Generator - C# - String Extension Method
/// <summary>
/// Generates a permalink slug for passed string
/// </summary>
/// <param name="phrase"></param>
/// <returns>clean slug string (ex. "some-cool-topic")</returns>
public static string GenerateSlug(this string phrase)
{
var s = phrase.RemoveAccent().ToLower();
s = Regex.Replace(s, @"[^a-z0-9\s-]", ""); // remove invalid characters
s = Regex.Replace(s, @"\s+", " ").Trim(); // single space
@KABBOUCHI
KABBOUCHI / bulma.blade.php
Created September 8, 2017 18:16 — forked from tompec/bulma.blade.php
Bulma blade template for Laravel 5.4 pagination
@if ($paginator->hasPages())
<nav class="pagination is-centered">
@if ($paginator->onFirstPage())
<a class="pagination-previous" disabled>Previous</a>
@else
<a href="{{ $paginator->previousPageUrl() }}" rel="prev" class="pagination-previous">Previous</a>
@endif
@if ($paginator->hasMorePages())
<a class="pagination-next" href="{{ $paginator->nextPageUrl() }}" rel="next">Next</a>
@KABBOUCHI
KABBOUCHI / JSONEditor.cs
Created September 10, 2017 12:17 — forked from paullj/JSONEditor.cs
A JSON Editor in the inspector. Preview and more information in comments 🙂
using System.IO;
using System.Linq;
using System.Globalization;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using UnityEngine;
using UnityEditor;
using System;
@KABBOUCHI
KABBOUCHI / JSONEditor.cs
Created September 10, 2017 12:17 — forked from paullj/JSONEditor.cs
A JSON Editor in the inspector. Preview and more information in comments 🙂
using System.IO;
using System.Linq;
using System.Globalization;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using UnityEngine;
using UnityEditor;
using System;
@KABBOUCHI
KABBOUCHI / EnsureQueueListenerIsRunning.php
Created October 28, 2017 17:40 — forked from ivanvermeyen/EnsureQueueListenerIsRunning.php
Ensure that the Laravel 5.1 queue listener is running with "php artisan queue:checkup" and restart it if necessary. You can run this automatically with a cron job: http://laravel.com/docs/scheduling
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
class EnsureQueueListenerIsRunning extends Command
{
/**
* The name and signature of the console command.
@KABBOUCHI
KABBOUCHI / RemoteArtisan.php
Created December 21, 2017 18:53 — forked from simonhamp/RemoteArtisan.php
RemoteArtisan: A way to call another Laravel/Lumen application's artisan command from the context of the current application.
<?php
namespace App;
use Dotenv\Dotenv;
use Symfony\Component\Process\Process;
class RemoteArtisan
{
/**
@KABBOUCHI
KABBOUCHI / .bash_profile
Created January 7, 2018 16:07 — forked from JeffreyWay/.bash_profile
Prettier git logs
alias gl="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"