Skip to content

Instantly share code, notes, and snippets.

View tommyskott's full-sized avatar
👨‍💻
Swedish Freelancer

Tommy Borgenfalk Skott tommyskott

👨‍💻
Swedish Freelancer
View GitHub Profile
@tommyskott
tommyskott / _insta-curl.sh
Created March 29, 2022 09:54
Curl instagram user's posts to a file on the desktop
#!/bin/bash
curl https://www.instagram.com/instagram/\?__a\=1 > ~/Desktop/insta.json
@tommyskott
tommyskott / ffmpeg_shrink.sh
Last active March 29, 2022 08:10
Scale down all jpgs in a folder to a set size and save them with a suffix
#!/bin/bash
# Requires ffmpeg
# Scale down all jpgs in a folder to a set size and save them with a suffix
for i in *.jpg; do ffmpeg -i "${i}" -vf scale=1200:-1 "${i%.*}_small.jpg"; done
@tommyskott
tommyskott / tools.md
Last active October 3, 2023 21:52
A list of links to some of the tools I use.
@tommyskott
tommyskott / Xcode - shortcuts.md
Last active December 22, 2021 22:51
Xcode - shortcuts and other goodies

Xcode - shortcuts and other goodies

Build

cmd + b

Build and run

cmd + r
@tommyskott
tommyskott / autoloader.php
Last active June 21, 2022 09:37
Require WordPress mu-plugins in vanilla wp projects.
<?php
/*
Plugin Name: B&S Autoloader
Plugin URI: https://github.com/borgenfalkskott
Description: Mu-plugin autoloader for vanilla Wp.
Version: 1.1.0
Author: Borgenfalk & Skott
Author URI: https://borgenfalk.se
License: MIT
*/
@tommyskott
tommyskott / .tarignore
Created April 29, 2021 22:16
Ignore file for when creating new tar files.
.git
.gitignore
.gitkeep
.babelrc
.editorconfig
.vscode
docker
docker-compose.yml
.env.example
phpcs.xml
@tommyskott
tommyskott / tar.sh
Created April 29, 2021 22:05
Create a tar file from all of the folder contents.
tar -czhf ${CI_COMMIT_TAG}.tar.gz -X .tarignore *

Wp Api

Cleaner payload:

/wp-json/wp/v2/posts?_fields[]=title&_fields[]=content

Homebrew

When brew cleanup fails with permission errors, try:

sudo chown -R "$(whoami)":admin /usr/local/lib
@tommyskott
tommyskott / scp.md
Last active December 16, 2021 08:49
SCP - Cheat Sheet

SCP - secure copy protocol

Transfer files from unix machines.

In this example, we have setup the credentials for our remote server with the alias of xwing. This allows us to connect to the server without having to type all the credentials every time.

You just simply connect by typing: ssh xwing

We don't need to login before we run the scp command, so let's logout and setup the ssh config.

Type exit to logout.