Skip to content

Instantly share code, notes, and snippets.

View dannyvassallo's full-sized avatar

Dan Vassallo dannyvassallo

View GitHub Profile
@bouzou4
bouzou4 / directory-print
Last active February 18, 2025 21:48
Concatenates the contents of specified file types into a single file, with headers indicating the source files.
#!/bin/zsh
# Help message function
function show_help() {
cat <<- EOF
Usage: ${0} [OPTIONS] -e EXTENSIONS
Concatenates the contents of specified file types into a single file, with headers indicating the source files.
OPTIONS:
-d Directory to start looking for files (default is current directory)
-e Extensions to include, comma-separated. Example: js,jsx,ts
@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 December 2, 2024 05:08
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 March 26, 2025 18:10
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 12, 2025 17:55
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 %>
...