This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# run prettier against the changed files between your branch and main | |
# tested on macosx | |
git diff --name-status `git merge-base HEAD main` HEAD | awk '{print $2}' | grep -E '.jsx|.tsx|.js$|.ts$' | xargs npx prettier --write |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://devhints.io/git-log-format | |
# https://stackoverflow.com/a/19169532/1123985 | |
git rev-list master --author=Name --before="12/31/2018" --after="1/1/2018" | | |
while read sha1; do | |
git show -s --format='"%s","%ci","%B"' $sha1 | tr \n' ''; echo | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://astexplorer.net/#/gist/55b79bb6a2287057b4459d5ef87528a1/34173b57c114657bd47b0441ad35cb88037e7832 | |
// Press ctrl+space for code completion | |
export default function transformer(file, api) { | |
const j = api.jscodeshift; | |
return j(file.source) | |
.find(j.ImportDeclaration) | |
.forEach(importStatement => { | |
const specifiers = j(importStatement).find(j.ImportSpecifiers); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install yamllint at https://github.com/adrienverge/yamllint | |
{ | |
"linters": { | |
"yaml": { | |
"type": "script-and-regex", | |
"include": [ | |
"(\\.yaml?$)" | |
], | |
"exclude": [], | |
"script-and-regex.script": "sh -c 'yamllint -f parsable \"$0\" || true'", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# to install rails and node on ubuntu in Soda Hall (UC Berkeley) without root access | |
# constraints: no root access. ~1536 MB limit. | |
# TODO: handle all cs169 dependencies | |
# https://github.com/saasbook/courseware/blob/5e6cd1f533cc86f8caa0ad0ed0a9fb84baf2a662/vm-setup/configure-image-0.10.2.sh | |
### RVM INSTALLATION ### | |
# https://rvm.io/rvm/install # single user installation | |
echo "Installing rvm ..." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Bundle 'brookhong/cscope.vim' | |
Bundle 'chazy/cscope_maps' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#put in <project_directory>/lib/tasks | |
namespace :export do | |
desc "Export ActiveRecord model records to a CSV file. Pass model name: model=ModelName" | |
task :to_csv => :environment do | |
require 'exportable' | |
model_name = ENV['model'] | |
open( "#{::Rails.root}" + '/log/export.pid', "w") do |file| | |
file << Process.pid | |
end |