Skip to content

Instantly share code, notes, and snippets.

View jasalt's full-sized avatar

Jarkko Saltiola jasalt

View GitHub Profile
@jasalt
jasalt / link_post_translation.php
Created August 26, 2024 13:10 — forked from djoo/link_post_translation.php
WPML Custom end point link 2 existing translation
<?php
/**
* Link the FR translation and the EN translation
* Called by API https://domain.com/wp-json/link_translation/post/
*/
function custom_rest_link_translation($data) {
//Source https://wpml.org/wpml-hook/wpml_set_element_language_details/
#!/bin/bash
# Adjust homserver, room, and accesstoken to your particular setup
# Script is expecting data to be piped in on STDIN
# Example:
# echo "some text" | sendmatrix
msgtype=m.text
homeserver=<homeserver>
room=<room id>
@jasalt
jasalt / gist:bd29e4fc773a5b8f6c0faeb7b4bd3ba7
Created June 28, 2020 20:07 — forked from jaukia/gist:1d41a0045ab8e9f411ff
Most active public GitHub users in Finland — Feb 2015

Most active public GitHub users in Finland

The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at GitHub.com from Wed, 12 Feb 2014 13:09:28 GMT till Thu, 12 Feb 2015 13:09:28 GMT.

Only first 1000 GitHub users according to the count of followers are taken. This is because of limitations of GitHub search. Sorting algo in pseudocode:

githubUsers
 .filter((user) -&gt; user.followers &gt; 11)

Oh my zsh.

Install with curl

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Enabling Plugins (zsh-autosuggestions & zsh-syntax-highlighting)

  • Download zsh-autosuggestions by
@jasalt
jasalt / Instructions.sh
Created June 7, 2018 16:10 — forked from GhazanfarMir/Instructions.sh
Install PHP7.2 NGINX and PHP7.2-FPM on Ubuntu 16.04
########## Install NGINX ##############
# Install software-properties-common package to give us add-apt-repository package
sudo apt-get install -y software-properties-common
# Install latest nginx version from community maintained ppa
sudo add-apt-repository ppa:nginx/stable
# Update packages after adding ppa
@jasalt
jasalt / dldjbb.py
Last active September 26, 2016 10:15 — forked from kamiheku/djbb.py
Simple Break Beat Paradise downloader
#!/usr/bin/env python3
# Download all zip files from a single bbp page eg:
# ./djbb.py http://www.breakbeat-paradise.com/samplesite/bb_synth.php
import requests
import re
import shutil
import sys
@jasalt
jasalt / iterm
Last active September 21, 2015 19:02 — forked from bobthecow/tab.bash
Open new Terminal tabs from the command line
#!/bin/bash
#
# Open new Terminal tabs from the command line to currently running ITerm2
# session
#
# Author: Justin Hileman (http://justinhileman.com)
# Modified by: Jarkko Saltiola (http://saltio.la)
#
# Installation:
# Add this file path
@jasalt
jasalt / usbreset.c
Last active September 5, 2015 07:31 — forked from x2q/usbreset.c
/* usbreset -- send a USB port reset to a USB device
*
* Compile using: gcc -o usbreset usbreset.c
*
*
* */