Skip to content

Instantly share code, notes, and snippets.

View andstor's full-sized avatar
🚂
Training

André Storhaug andstor

🚂
Training
View GitHub Profile
@andstor
andstor / git_remember_credentials.md
Last active October 13, 2018 14:09
Git credential cache, no more repeating passwords!

Command for remembering your password:

git config --global credential.helper 'cache --timeout 28800'

Above command will tell git to cache your password for 8 hours.

Make git forget this password

@andstor
andstor / .bash_profile
Last active October 13, 2018 14:19
Example `.bash_profile` file
# Edit this file
alias aliases="vim ~/.bash_profile" # usage: type `aliases` in Terminal
# Navigate to location
alias home="cd ~"
alias desktop="cd ~/Desktop/"
alias sites="cd ~/Documents/Sites/"
# Navigate to project directory
alias work="cd ~/Dropbox/Work/"
@andstor
andstor / uniquify_named_sql_parameters.php
Last active July 23, 2019 22:29
PHP function for allowing use of a named SQL parameter multiple times. See https://docs.moodle.org/dev/Data_manipulation_API#Placeholders
/**
* Make all named SQL parameters unique and
* generate a new parameter array with the unique parameters.
* @param string $sql The SQL with patameters to uniquify
* @param array $params The patameters to uniquify
* @return array
*/
function uniquify_sql_params($sql, $params): array {
$pattern = "/:([a-zA-Z0-9_]+)/";
$paramsres = [];
@andstor
andstor / setup-headless-chrome.sh
Last active March 8, 2021 01:07
Bash script to install/setup chromedriver for headless selenium testing
#!/bin/bash
#
# Bash script to setup headless Selenium (uses Chrome)
# Add Google Chrome's repo to sources.list
sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
# Install tools:
apt-get -y update
apt-get -y install wget unzip curl gnupg
@andstor
andstor / blacklist.filter
Created February 18, 2022 00:47
Synology Drive Client blacklist
[Version]
major = 1
minor = 1
[Common]
black_dir_prefix = "/Backup", "/Moments"
max_length = 0
max_path = 0
[File]
@andstor
andstor / andstor-gpt-j-6b-smart-contract-server.ipynb
Last active March 28, 2022 08:44
andstor/gpt-j-6B-smart-contract-server.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.