Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bash
# BenQ PD3220U working modes for Purism Librem 13 v4
# Add higher resolutions via xrandr
# References on issue
# https://forums.puri.sm/t/4k-output-from-librem13-hdmi-port/4441/2
# Create new modes
# NOTE: use `cvt` not `gtf` to get mode settings
# If install fails due to git permissions issue following commands first
# source: https://github.com/rust-lang/cargo/issues/3381#issuecomment-308460530
eval `ssh-agent -s`
ssh-add
cargo ...
@joebushi
joebushi / prepend-text-to-file.sh
Last active October 11, 2019 11:32
[Pre-pend string to file] using sed to pre-pend text to file #shell
# https://stackoverflow.com/questions/10587615/unix-command-to-prepend-text-to-a-file
# -i creates backup
# semi-colon is delimiter
sed -i.old '1s;^;to be prepended;' inFile
@joebushi
joebushi / cargo-git.sh
Created October 9, 2019 15:39
[Override Github protocol for https over git] #git #ssh #rust #cargo
# Read more: https://github.com/rust-lang/cargo/issues/3381#issuecomment-308460530
eval `ssh-agent -s`
ssh-add
cargo ...
@joebushi
joebushi / start-mongodb-docker.sh
Created October 8, 2019 12:31
[Start MongoDB Docker image] #Database #MongoDB #Docker
sudo docker run -d -i -t --privileged -p 27017-27019:27017-27019 --name mongodb mongo
@joebushi
joebushi / post-receive
Last active August 29, 2015 14:19 — forked from zamicol/post-receive
#!/bin/sh
#Put this script into <gitProject>/hooks/post-receive on the production server
#Make sure this script has execute permissions (chmod +x post-receive)
#You can create a group (like "git"), make it owner of this file, and add
#every user that needs to push to the that group.
echo 'start repo to prod'
@joebushi
joebushi / wp-add-live-reload.php
Last active December 29, 2015 02:19
Add live reload script to footer on WordPress in debug mode
// Add this snippet to theme functions.php
// Add script for live reload in development mode
function add_live_reload()
{
if (WP_DEBUG) {
echo "<script>document.write('<script src=\"http://' + (location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1\"></' + 'script>')</script>";
}
}
add_filter( 'wp_footer', 'add_live_reload');
@joebushi
joebushi / gist:2925924
Created June 13, 2012 19:27
Copy public ssh key to remote host
# On OS X be sure to install ssh-copy-id
brew install ssh-copy-id
# Add this function to your .bash_profile/.profile file
# Copy public key to remote host
function authorize () {
ssh-copy-id -i ~/.ssh/id_rsa.pub $@
}
@joebushi
joebushi / html5.haml
Created May 25, 2012 09:44 — forked from fnhipster/html5.haml
HTML5 HAML Template
!!! 5
%html
%head
%title= "Your Website"
%meta{ :content => "", :name => "description" }
%meta{ :content => "", :name => "author" }
%meta{ :content => "3 days", :name => "revisit-after" }
%link{ :href => "http://creativecommons.org/licenses/by/3.0/", :rel => "license", :title => "Creative Commons Attribution 3.0 Unported License" }
%link{ :href => "/feed", :rel => "alternate", :title => "Atom", :type => "application/atom+xml" }
%link{ :href => "/css/screen.css", :media => "screen", :rel => "stylesheet" }