Skip to content

Instantly share code, notes, and snippets.

View ivorpad's full-sized avatar
🇪🇸
Working from Spain

Ivor ivorpad

🇪🇸
Working from Spain
View GitHub Profile
@goranculibrk
goranculibrk / MigrateDatabaseServers.php
Last active September 19, 2024 11:58
Synchronize Production and Local Postgres Databases.
<?php
namespace App\Console\Commands\Maintenance;
use Illuminate\Console\Command;
use Symfony\Component\Process\Process;
class MigrateDatabaseServers extends Command
{
/**
@trvswgnr
trvswgnr / compress_video
Last active September 17, 2024 13:38
portable shell script to compress videos with ffmpeg
#!/bin/sh
print_usage() {
echo "usage: compress_video <input_file>"
echo "supported formats: mp4, webm, mkv, mov, avi, flv"
}
get_extension() {
f="${1##*/}"
case "$f" in
<?
//
// AUTO KEYWORD-BASED FOLLOWER CURATION BOT (by @levelsio)
//
// File: twitterFollowerCuratorBot.php
//
// Created: May 2021
// License: MIT
//
@ivorpad
ivorpad / .md
Last active June 5, 2019 13:18
Renew Certificate with Certbot
  1. sudo service nginx-sp stop
  2. Uncomment ssl lines from /etc/nginx-sp/vhosts.d/<domain>-ssl.conf
  3. cd opt/letsencrypt
  4. sudo -H ./letsencrypt-auto certonly --standalone -d <domain>.com
  5. sudo service nginx-sp start
cd /etc/nginx-sp/vhosts.d/
@ateucher
ateucher / setup-gh-cli-auth-2fa.md
Last active May 3, 2024 11:06
Setup git on the CLI to use 2FA with GitHub

These are instructions for setting up git to authenticate with GitHub when you have 2-factor authentication set up. This authentication should be inherited by any GUI client you are using. These are intentionally brief instructions, with links to more detail in the appropriate places.

  1. Download and install the git command-line client (if required).

  2. Open the git bash window and introduce yourself to git (if required):

    git config --global user.name 'Firstname Lastname'
    git config --global user.email 'firstname.lastname@gov.bc.ca'
    
@mihow
mihow / load_dotenv.sh
Last active September 16, 2024 17:00
Load environment variables from dotenv / .env file in Bash
# The initial version
if [ ! -f .env ]
then
export $(cat .env | xargs)
fi
# My favorite from the comments. Thanks @richarddewit & others!
set -a && source .env && set +a
@tylermakin
tylermakin / Multipart MIME Email.md
Last active May 7, 2024 21:24
Multipart MIME Email Guide

Multipart MIME Email Guide

This is a guide on how to send a properly formatted multipart email. Multipart email strings are MIME encoded, raw text email templates. This method of structuring an email allows for multiple versions of the same email to support different email clients.

// Example Multipart Email:
From: sender@example.com
To: recipient@example.com
Subject: Multipart Email Example
Content-Type: multipart/alternative; boundary="boundary-string"
@pavelthq
pavelthq / custom_view.js
Last active March 27, 2024 14:51
Visual Composer: Custom markup element example
(function($) {
window.VcCustomElementView = vc.shortcode_view.extend( {
elementTemplate: false,
$wrapper: false,
changeShortcodeParams: function ( model ) {
var params;
window.VcCustomElementView.__super__.changeShortcodeParams.call( this, model );
params = _.extend( {}, model.get( 'params' ) );
if ( ! this.elementTemplate ) {
@wesbos
wesbos / tab-trigger.js
Created November 16, 2015 19:33
How to properly get a TAB trigger working with Emmet inside of JSX
{
"keys": ["tab"],
"command": "expand_abbreviation_by_tab",
// put comma-separated syntax selectors for which
// you want to expandEmmet abbreviations into "operand" key
// instead of SCOPE_SELECTOR.
// Examples: source.js, text.html - source
"context": [
{
@gokulkrishh
gokulkrishh / media-query.css
Last active September 20, 2024 07:20
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
/* CSS */