Skip to content

Instantly share code, notes, and snippets.

View willwright82's full-sized avatar
👾
parsleybox.com

Will Wright willwright82

👾
parsleybox.com
View GitHub Profile
*vimtips.txt* For Vim version 7.3.
------------------------------------------------------------------------------
" new items marked [N] , corrected items marked [C]
" *best-searching*
/joe/e : cursor set to End of match
3/joe/e+1 : find 3rd joe cursor set to End of match plus 1 [C]
/joe/s-2 : cursor set to Start of match minus 2
/joe/+3 : find joe move cursor 3 lines down
/^joe.*fred.*bill/ : find joe AND fred AND Bill (Joe at start of line)
/^[A-J]/ : search for lines beginning with one or more A-J
@willwright82
willwright82 / sqliteToPostgres.md
Last active September 22, 2022 00:32
Swap out sqlite for postgres in a fresh Rails install

Gemfile

  • Delete the line with sqlite and replace it with:
gem 'pg'

database.yml

@willwright82
willwright82 / mac-overflow-scroll.css
Created April 4, 2022 14:25
Force display scrollbar on Mac OS using CSS — Source: https://davidwalsh.name/osx-overflow
::-webkit-scrollbar {
-webkit-appearance: none;
width: 7px;
}
::-webkit-scrollbar-thumb {
border-radius: 4px;
background-color: rgba(0, 0, 0, .5);
-webkit-box-shadow: 0 0 1px rgba(255, 255, 255, .5);
}
@willwright82
willwright82 / git-deployment.md
Last active March 4, 2022 12:09 — forked from noelboss/git-deployment.md
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

<!DOCTYPE html>
<html lang="en" class="no-js">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<title>Unique page title - My Site</title>
<script type="module">
document.documentElement.classList.remove('no-js');
@willwright82
willwright82 / db_pull.rake.rb
Created July 6, 2016 08:39
Pulling the production database to your local development database (Rails + Postgres)
# lib/tasks/db_pull.rake
# via https://martinschurig.com/posts/2015/02/pulling-production-database-to-local-machine-rails-task/
namespace :db do
desc 'Pull production db to development'
task :pull => [:dump, :restore]
task :dump do
dumpfile = "#{Rails.root}/tmp/latest.dump"
puts 'PG_DUMP on production database...'
production = Rails.application.config.database_configuration['production']
@willwright82
willwright82 / check_array_for_sum.rb
Created March 15, 2017 15:27
A Ruby solution for Google's Interview question: Check if any 2 numbers of an array add up to 8 (https://www.youtube.com/watch?v=XKu_SEDAykw)
def check_array_for_sum?(array, sum)
!!array.combination(2).detect { |a, b| a + b == sum }
end
sum = 8
array = [1, 2, 4, 9]
check_array_for_sum?(array, sum) # returns false
array = [1, 2, 4, 4]

ZSH Tips by ZZapper

zzappers Tips Home

Updated : 01Aug16 N Marks New C Corrected/Changed

> zsh -f   # start a "clean" version of zsh (without your startup files)
print $ZSH_VERSION
[Tips Home](http://www.zzapper.co.uk/)
@willwright82
willwright82 / ag-search-replace.sh
Created January 31, 2020 15:03
Search and Replace using AG — The Silver Surfer
ag -l "search string" | xargs sed -i '' -e 's/from/to/g'

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites