Skip to content

Instantly share code, notes, and snippets.

View dannyvassallo's full-sized avatar

Dan Vassallo dannyvassallo

View GitHub Profile
@adipasquale
adipasquale / rails-tests.yml
Last active March 5, 2021 16:10
GitHub Action for CI Rails Tests with a specific ruby version, minitest, Chrome Headless and PostgreSQL
# .github/workflows/rails-tests.yml
name: Rails Tests
on: [push]
jobs:
build:
runs-on: ubuntu-latest
env:
PGHOST: localhost
PGUSER: postgres
RAILS_ENV: test
@seeliang
seeliang / lint-only-changed-files.MD
Last active April 10, 2024 09:44
How to lint only changed files?

find out the differences

use git diff to generate file list

git diff --name-only master

limited to certain file types

add ext filter

@jherax
jherax / configure.md
Last active May 2, 2024 21:54
VS Code: Debugging with Jest

VS Code: Debugging Jest

Sometimes, debugging with console.log is not enough to find out what is happening in the code, as console.log prints only plain objects but neither functions nor objects with circular references. Besides, it's possible you may need to know the context and flow of the code.

Read more about debugging with VS Code in VS Code: Debugging.

@jdhom
jdhom / mistel-barocco-md600.md
Last active September 3, 2023 13:09
Mistel Barocco MD600 Programming and Firmware

Mistel Barocco MD600 RGB Split Keyboard

keyboard firmware

What I remap

CapsLock is RCTRL    ... i do this on all keyboards
FN CapsLock is RCTRL ... was accidently toggling capslock with fn+capslock
LCTRL is FN ... arrow/pg/home on right half, FN+arrow I now prefer on ALL keyboards... so nice
@sebmarkbage
sebmarkbage / The Rules.md
Last active April 22, 2024 04:41
The Rules of React

The Rules of React

All libraries have subtle rules that you have to follow for them to work well. Often these are implied and undocumented rules that you have to learn as you go. This is an attempt to document the rules of React renders. Ideally a type system could enforce it.

What Functions Are "Pure"?

A number of methods in React are assumed to be "pure".

On classes that's the constructor, getDerivedStateFromProps, shouldComponentUpdate and render.

@jgamblin
jgamblin / slackoutlook.scpt
Created April 19, 2017 12:39
Set your slack status based on Outlook calendar.
launch application "Microsoft Outlook"
launch application "Slack"
property startDate : current date
property endDate : startDate + (10 * minutes)
property cachedStatus : ""
property results : {}
property running : true
global emailAddress
@silviorelli
silviorelli / gist:ad8e1d80bdc0245eb7e7
Created February 3, 2016 09:34
Install Ruby 1.8.7 on Mac OSX 10.11 El Capitan with rbenv
brew install apple-gcc42 openssl libyaml libffi
xcode-select --install
export CC=/usr/local/bin/gcc-4.2
export CFLAGS='-g -O2'
export RUBY_CONFIGURE_OPTS=--with-openssl-dir=`brew --prefix openssl`
export CONFIGURE_OPTS=--with-openssl-dir=`brew --prefix openssl`
rbenv install 1.8.7-p375
@TSMMark
TSMMark / .bash_profile
Last active March 7, 2016 21:22
.bash_profile
### http://git-prompt.sh/
source ~/.git-prompt.sh
### Set PS1
export PS1="[\[\033[32m\]\w\[\033[0m\]]\$(__git_ps1)\n\[\033[1;36m\]\u\[\033[32m\]$ \[\\033[0m\]"
export PATH=/usr/local/bin:~/bin:$PATH
### Set SublimeText as default editor
ln -sf "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" ~/bin/subl
@dannyvassallo
dannyvassallo / _form.html.erb
Last active February 18, 2016 04:35
How to get Materialize CSS radio buttons in platformatec simple form for Rails 4.
<!-- In your simple_form use this code but change the column name, collection values, and model reference -->
...
<%= f.input :campaign_type, :label => false, :collection => [['Both Media Types', 'Both Media Types'], ['Just Video', 'Just Video'], ['Just Photo', 'Just Photo']], :label_method => :last, :value_method => :first, :as => :materialize_radio_buttons, :checked => @campaign.campaign_type %>
...
@nickcernis
nickcernis / mailchimp-popup-for-wordpress.md
Last active July 28, 2022 14:49
MailChimp Popup Script that works with WordPress sites

MailChimp's default popup scripts can break on WordPress sites that use jQuery/jQuery UI unless you include their embed code as the final elements before the closing body tag.

Including them in this way isn't always possible or easy with WordPress.

The code below is an alternative implementation of the loader that forces MailChimp's popup scripts to appear below all other scripts upon page load.

To use it, modify the baseUrl, uuid, and lid attributes with the ones from the original popup script that MailChimp supplies.