Skip to content

Instantly share code, notes, and snippets.

View pascal08's full-sized avatar

Pascal Lubbers pascal08

  • The Hague, Netherlands
  • 21:44 (UTC -12:00)
View GitHub Profile
@pascal08
pascal08 / SassMeister-input-HTML.html
Created April 18, 2016 16:05 — forked from mmintel/SassMeister-input-HTML.html
Generated by SassMeister.com.
<div class="class">asd</div>
@pascal08
pascal08 / mixins.scss
Created April 18, 2016 22:20
sass-bevm-mixins
$es: '__';
$vs: '--';
$mp: '-';
@function containsVariation($selector) {
$selector: selectorToString($selector);
@if str-index($selector, $vs) {
@return true;
}
@pascal08
pascal08 / bevm-nesting.md
Last active June 18, 2018 10:39
bevm-nesting
.block
.block .-modifier
.block __element
.block __element .-modifier
.block __element --variation
.block __element --variation .-modifier
.block --variation .block __element
.block __element .-modifier
@pascal08
pascal08 / BooleanLogic.java
Last active November 5, 2016 13:59
How to use boolean logic without using native booleans in Java
interface Conditional {
Boolean implies(Boolean b);
}
interface BiConditional {
Boolean equalTo(Boolean b);
@pascal08
pascal08 / bootstrap.php
Last active November 13, 2017 04:22
Laravel 5.4 Queue Standalone
<?php
require_once 'vendor/autoload.php';
require_once 'container.php';
$app = Container::getInstance();
$app->bind('database', function($app) {
$database = new Illuminate\Database\Capsule\Manager($app);
@pascal08
pascal08 / composer.json
Created January 21, 2018 19:32
PHP semver check with GIT
{
"require": {
"tomzx/php-semver-checker": "^0.11.0"
}
}
@pascal08
pascal08 / .bash_profile
Last active January 21, 2018 19:41
Turn PHP CLI XDebug on and off from command line
function php_exists() {
if ! [ -x "$(command -v php)" ]; then
echo 'b';
return 0;
fi
echo 'a';
return 1;
}
@pascal08
pascal08 / copy-all-repos-of-user.sh
Created June 18, 2018 10:40
Clone all repos of a user (using curl and bash only)
curl -s https://api.github.com/users/jobapis/repos?per_page=200 | grep \"clone_url\" | awk '{print $2}' | sed -e 's/"//g' -e 's/,//g' | xargs -n1 git clone
@pascal08
pascal08 / replace_envs.sh
Created July 21, 2018 21:57
Parse environment placeholders (useful when using Docker for example)
#!/bin/bash
# Replace variables $ENV{<environment varname>}
# (optional: $ENV{<environment varname>??<default value>}
# ----
function ReplaceEnvironmentVariable() {
# - Parse environment variable placeholders.
# - The format should be $ENV{***} where *** should match
@pascal08
pascal08 / commands
Last active September 8, 2018 23:39
Docker CLI commands
# Remove all non-running containers:
`docker rm $(sort <(docker ps -q) <(docker ps -aq) | uniq -u)`