Skip to content

Instantly share code, notes, and snippets.

View andersonpem's full-sized avatar
💭
Always living and learning

AndersonPEM andersonpem

💭
Always living and learning
View GitHub Profile
@andersonpem
andersonpem / README.md
Last active March 5, 2024 11:27
Fix: nordvpn doesn't connect on Linux, KDE, etc

Sometimes NordVPN doesn't work out of the box to connect to its services on Linux, especially on distros that use KDE. Or when some terminals like Terminator are the default. For some reason.

I debugged the issue and created a custom handler to get the job done. As well as a log writer.

You must have curl installed.

To run this script, go:

bash <(curl -s https://gist.githubusercontent.com/andersonpem/f58349b7f9bb4eca446f84298e92d8de/raw/41fb5f78b47dd4535a214e486e3be4c0b9cffe1d/runme.sh)
@bpolaszek
bpolaszek / bootstrap.php
Last active December 19, 2023 19:49
Symfony shortcuts for Pest
<?php
# tests/bootstrap.php
declare(strict_types=1);
namespace App\Test;
use ApiPlatform\Core\Bridge\Symfony\Bundle\Test\Client;
use App\Entity\User;
use App\Kernel;
@hikiko4ern
hikiko4ern / .bash_aliases
Last active October 29, 2023 20:24
Pikachu test passed (demo: https://asciinema.org/a/236096)
# /------------------------------------------\
# | don't forget to download the .tp file |
# | and place it in the user's directory :› |
# | |
# | also install lolcat: |
# | https://github.com/busyloop/lolcat |
# \------------------------------------------/
alias test-passed='if [ "$?" -eq "0" ]; then lolcat ~/.tp -a -s 40 -d 2; fi;'
@Ocramius
Ocramius / Caddyfile
Last active March 11, 2024 22:14
Example docker + docker-compose + caddy + traefik setup that routes to multiple apps from one exposed HTTP port
:80 {
root /serve
}

Create a /bin/sh wrapper to your docker container and then point PHP Intellisense at the wrapper:

#!/bin/sh

docker run \
    --rm \
    -i \
    --network=host \
 -v "$HOME":"$HOME":ro \
@eszterkv
eszterkv / fontsizer.js
Last active July 22, 2018 04:16
JS snippet for increasing or decreasing font size in a HTML document using jQuery.
function resize(increase_or_decrease) {
const direction = increase_or_decrease;
// First arg is the direction, elements to change follow
for (let i = 1; i < arguments.length; i++) {
let fontsize = parseInt($(arguments[i]).css('font-size'));
if (direction === 'increase') {
fontsize++;
if (fontsize > 20) fontsize = 20; // Prevent text from getting too big
} else if (direction === 'decrease') {
fontsize--;
@wdullaer
wdullaer / install.sh
Last active April 2, 2024 20:33
Install Latest Docker and Docker-compose on Ubuntu
# Ask for the user password
# Script only works if sudo caches the password for a few minutes
sudo true
# Install kernel extra's to enable docker aufs support
# sudo apt-get -y install linux-image-extra-$(uname -r)
# Add Docker PPA and install latest version
# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
# sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
@shakyShane
shakyShane / category.php
Created September 4, 2012 20:29
Create a Permalink from a page title - Laravel
<?php
class Category extends Eloquent
{
/**
* -----------------------------------
* Make Permalink from a Title.
* -----------------------------------
*
@fernandoaleman
fernandoaleman / Linux Static IP
Created March 23, 2012 16:20
How To Configure Static IP On CentOS 6
## Configure eth0
#
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
BOOTPROTO=static