Skip to content

Instantly share code, notes, and snippets.

View Rigellute's full-sized avatar
💭
I may be slow to respond.

Alexander Keliris Rigellute

💭
I may be slow to respond.
View GitHub Profile
@Rigellute
Rigellute / add-flow.sh
Created May 26, 2018 11:45
Add flow annotation to all files in src directory
#!/bin/bash
# Based on http://stackoverflow.com/questions/151677/tool-for-adding-license-headers-to-source-files
for i in $(find -L src -type f -name '*.js')
do
if ! grep -q @flow $i
then
(echo "// @flow") > flowificator
cat flowificator $i >$i.new && mv $i.new $i
rm flowificator
@Rigellute
Rigellute / SQL highlighting in Javascript.md
Last active December 14, 2018 01:43
Add syntax highlighting for SQL queries composed in .js files in Atom.

Open preferences in atom and find/install language-babel.

Open the settings of language-babel.

Add /* sql */:source.sql to the Javascript tagged template literal grammer extensions.

Now write your queries like this /* sql */`SELECT * FROM users`. Make sure the query is in backticks `.

Enjoy the pretty queries!