Skip to content

Instantly share code, notes, and snippets.

View davidjeddy's full-sized avatar
🏎️
Rockin' in the new world.

David J Eddy davidjeddy

🏎️
Rockin' in the new world.
View GitHub Profile
@m-coding
m-coding / regex-yyyy-mm-dd.js
Last active January 22, 2024 06:36
javascript regex to match date pattern YYYY-MM-DD
// allows YYYY/M/D and periods instead of slashes
// http://stackoverflow.com/questions/24989065/trying-to-validate-yyyy-mm-dd
/^\d{4}[\/.]\d{1,2}[\/.]\d{1,2}$/
// YYYY-MM-DD and YYYY-M-D
// http://stackoverflow.com/questions/6177975/how-to-validate-date-with-format-mm-dd-yyyy-in-javascript
/^\d{4}\-\d{1,2}\-\d{1,2}$/
// YYYY-MM-DD
// https://gist.github.com/arth2o/8471150
@pubkey
pubkey / Mad_Catz_linux.bash
Last active January 18, 2024 09:44
Mad Catz R.A.T. 7/9 on Linux ubuntu/mint
#The mouse will suck on linux because of the programmable buttons.
#This script will change the button-delegation so that the mouse doesn't stuck.
#@link https://community.linuxmint.com/hardware/view/10217
sudo mkdir /etc/X11/xorg.conf.d
sudo rm /etc/X11/xorg.conf.d/910-rat.conf
# add the following to the file
echo "Section \"InputClass\"" >> /etc/X11/xorg.conf.d/910-rat.conf
@gwillem
gwillem / ansible-bootstrap-ubuntu-16.04.yml
Created June 16, 2016 21:59
Get Ansible to work on bare Ubuntu 16.04 without python 2.7
# Add this snippet to the top of your playbook.
# It will install python2 if missing (but checks first so no expensive repeated apt updates)
# gwillem@gmail.com
- hosts: all
gather_facts: False
tasks:
- name: install python 2
raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal)
@larsar
larsar / shared_folder_centos_virtualbox.txt
Created January 27, 2012 08:04
Mount shared folder on CentOS in VirtualBox
# The VirtualBox documentation[1] for how to install guest additions
# for Linux on a virtual host is somewhat messy. So here is what
# I did to make it work.
# Install the packages required
yum update
yum install gcc kernel-devel make
reboot
@OnesimusUnbound
OnesimusUnbound / quote.txt
Last active August 16, 2023 16:24
Programming Quotes
[T]he difference between a bad programmer and a
good one is whether he considers his code or his
data structures more important. Bad programmers
worry about the code. Good programmers worry about
data structures and their relationships.
-- Linus Torvalds
~~~
Clarity and brevity sometimes are at odds.
When they are, I choose clarity.
-- Jacob Kaplan-Moss
@jameswilson
jameswilson / .gitconfig
Created February 15, 2017 19:40
git tree - a shorthand alias for a pretty cli git log graph
# Place this in your home directory's ~/.gitconfig file
[alias]
# a shorthand alias for a pretty cli git log graph
tree = "!git log --graph --decorate --pretty=format:'%C(yellow)%h %Cred%cr %Cblue(%an)%C(cyan)%d%Creset %s' --abbrev-commit --all"
@seyhunak
seyhunak / seeds.rb
Created December 7, 2013 14:54
Rails - Import SQL file as seed
unless Rails.env.production?
connection = ActiveRecord::Base.connection
connection.tables.each do |table|
connection.execute("TRUNCATE #{table}") unless table == "schema_migrations"
end
sql = File.read('db/import.sql')
statements = sql.split(/;$/)
statements.pop
@marianposaceanu
marianposaceanu / linux_fun.md
Last active January 29, 2023 20:31
How to have some fun using the terminal.

Linux fun-o-matic

How to have some fun using the terminal.

  1. Install cowsay [0] via : sudo apt-get install cowsay
  2. Install fortune [1] via : sudo apt-get install fortune
  3. Make sure you have Ruby installed via : ruby -v
  4. Install the lolcat [2] via : gem gem install lolcat
  5. Profit!
@matthewmccullough
matthewmccullough / git-deletealltags.bsh
Created April 1, 2011 20:29
Script to delete all tags both locally and remotely
for t in `git tag`
do
git push origin :$t
git tag -d $t
done
@upgundecha
upgundecha / Brewfile
Last active October 7, 2022 06:40
Brewfile for tools listed in https://github.com/ibraheemdev/modern-unix
# tools from https://github.com/ibraheemdev/modern-unix
tap "cantino/mcfly"
tap "clementtsang/bottom"
brew "bat"
brew "exa"
brew "lsd"
brew "git-delta"
brew "dust"
brew "duf"
brew "broot"