Skip to content

Instantly share code, notes, and snippets.

View Surreal9's full-sized avatar

John Arnold Surreal9

  • Hypergiant
  • Canada
View GitHub Profile
@parties
parties / renameReactJsToJsx.sh
Last active September 18, 2024 13:35
rename all *.js files containing React markup to *.jsx
# finds all *.js files that have either `</` or `/>` tags in them and renames them to *.jsx
find ./src -type f -name '*.js' -not -name '*.jsx' -not -name '*.ejs' -exec bash -c 'grep -l -E "</|/>" "$0"' {} \; -exec bash -c 'mv "$0" "${0%.js}.jsx"' {} \;
@ChugunovRoman
ChugunovRoman / .bashrc
Last active January 6, 2024 10:04
Alias for npm run with auto completing a npm scripts from package.json from current directory.
alias nr="npm run"
_npm_scripts() {
# check package.json file in current directory
if [ ! -f ./package.json ]; then
return
fi
local scripts="$(node -e 'const { scripts } = require(`./package.json`); if (!scripts) process.exit(); let a = Object.entries(scripts); for (let s in scripts) { console.log(s); }' | grep -E ^$2)"
local -a toks
@noelbundick
noelbundick / LICENSE
Last active September 17, 2024 11:37
Exclude WSL installations from Windows Defender realtime protection
MIT License
Copyright (c) 2018 Noel Bundick
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@mrtns
mrtns / gist:78d15e3263b2f6a231fe
Last active September 20, 2024 17:28
Upgrade Chrome from Command Line on Ubuntu
# Install
# via http://askubuntu.com/questions/510056/how-to-install-google-chrome
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
sudo apt-get update
sudo apt-get install google-chrome-stable
# Update
@ericlbarnes
ericlbarnes / filters.php
Created July 16, 2013 17:30 — forked from anonymous/filters.php
Laravel CSRF Ajax
/**
* Filter to check for CSRF attacks from the ajax requests.
*/
Route::filter('csrf_header', function()
{
if (Session::token() != Request::header('x-csrf-token'))
{
throw new Illuminate\Session\TokenMismatchException;
}
});