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
@IanColdwater
IanColdwater / twittermute.txt
Last active October 13, 2024 04:40
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@levelsio
levelsio / btc-eth-dca-buy.php
Last active October 20, 2024 21:22
This script runs daily and "Dollar Cost Average"-buys $40 BTC and $10 ETH per day
<?
//
// [ BUY BTC & ETH DAILY ON BITSTAMP ]
// by @levelsio
//
// 2017-08-23
//
// 1) buy $40/day BTC
// 2) buy $10/day ETH
//
@sebastiaanluca
sebastiaanluca / App\Http\RequestHandler.php
Last active August 14, 2017 17:13
Laravel 5.5 request handling
<?php
namespace App\Http;
use SebastiaanLuca\Flow\Http\RequestHandler as BaseRequestHandler;
use SebastiaanLuca\Flow\Http\ShowsViews;
class RequestHandler extends BaseRequestHandler
{
use ShowsViews;
@TsuiAnthonYVR
TsuiAnthonYVR / BelongsToMany.php
Created July 19, 2017 13:07
How to get Laravel to fire model attach/detach events
<?php namespace App\Relations;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
class BelongsToMany extends \Illuminate\Database\Eloquent\Relations\BelongsToMany {
/**
* Attach a model to the parent.
*
* @param mixed $id
@moso
moso / app.js
Last active December 15, 2022 07:28
laravel-mix config
// jQuery import
global.jQuery = require('jquery');
var $ = global.jQuery;
window.$ = $;
// Bootstrap 4 depends on Popper.js
// Popper.js import
//import Popper from 'popper.js';
//window.Popper = Popper;
@kevin-smets
kevin-smets / 1_kubernetes_on_macOS.md
Last active May 5, 2024 10:12
Local Kubernetes setup on macOS with minikube on VirtualBox and local Docker registry

Requirements

Minikube requires that VT-x/AMD-v virtualization is enabled in BIOS. To check that this is enabled on OSX / macOS run:

sysctl -a | grep machdep.cpu.features | grep VMX

If there's output, you're good!

Prerequisites

@justarandomgeek
justarandomgeek / gist:2c47b4aaee12f717227f867a4c030fae
Last active October 16, 2022 09:49
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 + 1.5}}
for _, entity in pairs(game.player.surface.find_entities_filtered{area = area, type = "tree"}) do
entity.die()
end
@adamwathan
adamwathan / maxBy.php
Created June 23, 2016 18:44
maxBy/minBy macros
<?php
Collection::macro('maxBy', function ($callback) {
$callback = $this->valueRetriever($callback);
return $this->reduce(function ($result, $item) use ($callback) {
if ($result === null) {
return $item;
}
return $callback($item) > $callback($result) ? $item : $result;
@ashander
ashander / unfavorite.js
Last active November 1, 2024 20:25
Delete all your favorites (unfavorite or unlike every tweet) on twitter.com (thx to @JamieMason and @b44rd for inspiring this)
// 1. Go to https://twitter.com/i/likes
// 2. Keep scrolling to the bottom repeatedly until all your favs are loaded.
// 3. Run this in your console (open in chrome by View > Developer > JavaScript Console)
// Notes: this may take a while if you have a lot of favs/likes
// you can only access your most recent ~2000 likes.
// inspired by https://gist.github.com/JamieMason/7580315
$('.ProfileTweet-actionButtonUndo').click()