Skip to content

Instantly share code, notes, and snippets.

View xanderificnl's full-sized avatar
💭
Rest In Piece Xander 13-09-2023

Xander xanderificnl

💭
Rest In Piece Xander 13-09-2023
View GitHub Profile
@diebels727
diebels727 / association.rb
Created March 18, 2011 00:13
Super-Meta-Polymorphic
#Where the associations table has sourcable_id,sourcable_type,targetable_id,targetable_type
class Association < ActiveRecord::Base
include Relatable
belongs_to_association :sourcable => :sourcable, :targetable => :targetable
end
#OR _any_ table that we want to be an association table can become one (if the source and target id and type columns do not exist, then the mixin creates them)
class AssociationTables < ActiveRecord::Base
@fogleman
fogleman / words.md
Last active June 27, 2024 07:55
Mnemonic Encoding Word List

Mnemonic Encoding Word List

http://web.archive.org/web/20090918202746/http://tothink.com/mnemonic/wordlist.html

  • The wordlist contains 1626 words.
  • All words are between 4 and 7 letters long.
  • No word in the list is a prefix of another word (e.g. visit, visitor).
  • Five letter prefixes of words are sufficient to be unique.
  • The words should be usable by people all over the world. The list is far from perfect in that respect. It is heavily biased towards western culture and English in particular. The international vocabulary is simply not big enough. One can argue that even words like "hotel" or "radio" are not truly international. You will find many English words in the list but I have tried to limit them to words that are part of a beginner's vocabulary or words that have close relatives in other european languages. In some cases a word has a different meaning in another language or is pronounced very differently but for the purpose of the encoding it is still ok - I assume that when the encoding is
@michenriksen
michenriksen / subdomains.lst
Last active December 25, 2023 12:54
Subdomain list for bruteforcing
0
01
02
03
0_
1
10
100
101
102
@beeman
beeman / remove-all-from-docker.sh
Created November 15, 2016 03:04
Remove all from Docker
# Stop all containers
docker stop `docker ps -qa`
# Remove all containers
docker rm `docker ps -qa`
# Remove all images
docker rmi -f `docker images -qa `
# Remove all volumes
@jeffochoa
jeffochoa / Response.php
Last active May 22, 2024 04:06
Laravel HTTP status code
<?php
// This can be found in the Symfony\Component\HttpFoundation\Response class
const HTTP_CONTINUE = 100;
const HTTP_SWITCHING_PROTOCOLS = 101;
const HTTP_PROCESSING = 102; // RFC2518
const HTTP_OK = 200;
const HTTP_CREATED = 201;
const HTTP_ACCEPTED = 202;
@lpar
lpar / ssh-agent.fish
Created November 14, 2017 19:05
Fish shell script to run ssh-agent correctly, i.e. only start a new one when necessary
#!/usr/bin/fish
#
# Fish script to run ssh-agent correctly, i.e. only start a new one when
# necessary. Drop it into ~/.config/fish/conf.d and forget about it.
#
# Uses ps and kill, everything else is done inside fish.
#
# Requires fish 2.3 for the string manipulation.
#
# Works with Fedora 26 and CentOS 7, for CentOS 6 you'll need a third party
@mcfrojd
mcfrojd / Shield_Intents.MD
Last active July 27, 2024 13:39
Working INTENTS to use with Community Hass.io Add-ons: Android Debug Bridge for your Nvidia Shield TV

Latest Update 2021-03-06 : New image showing the new "Services" in Home Assistant and got some tips from the comments below.

Credits and thanks: Home Assistant Forum users & Github users: @ocso, @wiphye, @teachingbirds, @tboyce1, @simbesh, @JeffLIrion @ff12 @rebmemer @siaox @DiederikvandenB @Thebuz @clapbr @Finsterclown


Start apps on your android device (in the examples below, my Nvidia Shield TV) from Home Assistant

alt text

Starts Youtube App

entity_id: media_player.shield
command: >-
/interface list
add comment=defconf name=WAN
add comment=defconf name=LAN
/interface list member
add interface=ether1 list=WAN
/ip firewall address-list
add address=192.168.0.0/16 list=Bogon
add address=10.0.0.0/8 list=Bogon
@laravel-shift
laravel-shift / .php-cs-fixer.php
Last active July 17, 2024 16:29
PHP CS Fixer - Laravel Coding Style Ruleset
<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$rules = [
'array_indentation' => true,
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => [
'default' => 'single_space',

Guix on WSL2

(updated versions of this document, plus more, live here)

This will show you how to get Guix running on WSL2.
We're going to go as "minimal" as possible, without starting off one of the readily available WSL2 distros.
Parts of this guide should help with understanding how to set up any custom distro on WSL, not just Guix.

Disclaimer: I'm a Guix nOOb! (hence going through the trouble of installing it on WSL2)