Skip to content

Instantly share code, notes, and snippets.

View nWidart's full-sized avatar
💭
Available For Hire

Nicolas Widart nWidart

💭
Available For Hire
View GitHub Profile
@nWidart
nWidart / gist:32332c2c2330feff5f029cc7ff3e4fb5
Created June 30, 2020 09:34 — forked from justarandomgeek/gist:2c47b4aaee12f717227f867a4c030fae
Factorio Command: Remove all trees in 5000 tile radius
/c
pos = game.player.position
area = {{pos.x - 5000, pos.y - 5000}, {pos.x + 5000, pos.y + 5000}}
for _, entity in pairs(game.player.surface.find_entities_filtered{area = area, type = "tree"}) do
entity.die()
end
Internal error. Please refer to http://jb.gg/ide/critical-startup-errors
com.intellij.ide.plugins.MainRunner$StartupAbortedException: Fatal error initializing 'com.intellij.openapi.actionSystem.ActionManager'
at com.intellij.ide.plugins.PluginManager.handleComponentError(PluginManager.java:121)
at com.intellij.openapi.components.impl.PlatformComponentManagerImpl.handleInitComponentError(PlatformComponentManagerImpl.java:33)
at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentConfigComponentAdapter.getComponentInstance(ComponentManagerImpl.java:520)
at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentConfigComponentAdapter.getComponentInstance(ComponentManagerImpl.java:462)
at com.intellij.openapi.components.impl.ComponentManagerImpl.getComponent(ComponentManagerImpl.java:189)
at com.intellij.openapi.actionSystem.ActionManager.getInstance(ActionManager.java:28)
at com.intellij.openapi.actionSystem.ex.ActionManagerEx.getInstanceEx(ActionManagerEx.
@nWidart
nWidart / docker-cleanup-resources.md
Created February 9, 2018 08:36 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@nWidart
nWidart / bash.sh
Created January 12, 2018 08:03
Enable/Disable Chrome swipe back gesture
# Enable
defaults write com.google.Chrome.plist AppleEnableSwipeNavigateWithScrolls -bool TRUE
# Disable
defaults write com.google.Chrome.plist AppleEnableSwipeNavigateWithScrolls -bool FALSE
Verifying that "nwidart.id" is my Blockstack ID. https://onename.com/nwidart
@nWidart
nWidart / open-laravel-sidebar.js
Last active May 26, 2021 11:14
A Script to import into Tampermonkey Chrome extension to open all laravel sidebar items.
// ==UserScript==
// @name New Userscript
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://laravel.com/docs/5.3
// @grant none
// ==/UserScript==
  • Modify: composer.json to use php 5.6.4 and laravel 5.3.*

  • Modify: config/app.php

  • Modify: app/Http/Kernel.php

    • replace can line with:
  • 'can' => \Illuminate\Auth\Middleware\Authorize::class,

@nWidart
nWidart / gist:e311f71fc65d53c91a945b05912593aa
Created June 27, 2016 20:49
Return array of all classes implementing the Iterator Interface
<?php
// Source: http://stackoverflow.com/questions/3993759/php-how-to-get-a-list-of-classes-that-implement-certain-interface
print_r(
array_filter(
get_declared_classes(),
function ($className) {
return in_array('Iterator', class_implements($className));
}
var gulp = require('gulp'),
shell = require('gulp-shell'),
gutil = require('gulp-util');
var publishAssets = function (evt) {
var changedFilePath = evt.path;
var splitFilePath = changedFilePath.split('/');
var moduleLocation = splitFilePath.indexOf('Modules') + 1;
var moduleName = splitFilePath[moduleLocation];
@nWidart
nWidart / validation.php
Last active May 31, 2020 13:42
A extensions validation rule for Laravel 5
<?php
// For example in AppServiceProvider
Validator::extend('extensions', function ($attribute, $value, $parameters) {
return in_array($value->getClientOriginalExtension(), $parameters);
});
Validator::replacer('extensions', function($message, $attribute, $rule, $parameters) {
return str_replace([':attribute', ':values'], [$attribute, implode(',', $parameters)], $message);
});