Skip to content

Instantly share code, notes, and snippets.

View kadikraman's full-sized avatar
💚

Kadi Kraman kadikraman

💚
View GitHub Profile
@kadikraman
kadikraman / .eslintrc.js
Created May 1, 2024 12:50
Example of disallowing logical operators in JSX
module.exports = {
// other rules
rules: {
'no-restricted-syntax': [
'error',
{
selector:
"JSXElement > JSXExpressionContainer > LogicalExpression[operator!='??']",
message: 'Use ternary operator instead',
},
@kadikraman
kadikraman / checkout-from-fork.sh
Created February 13, 2021 21:30
Checkout a PR locally from a work
# 123 is the PR number
git fetch origin pull/123/head:pr/123 && git checkout pr/123
git reset --hard upstream/master
docker run -e "ACCEPT_EULA=true" -e "MSSQL_PID=Express" -e "SA_PASSWORD=suchpass123@" -p 1433:1433 microsoft/mssql-server-linux
kill $(ps aux | grep flow | grep -v grep | awk '{print $2}')

Keybase proof

I hereby claim:

  • I am kadikraman on github.
  • I am hellokadi (https://keybase.io/hellokadi) on keybase.
  • I have a public key ASDG7VvFroU2sJhdL6yt4kkk9EtOy4Q_FMzBXl3wKe5UbAo

To claim this, I am signing this object:

@kadikraman
kadikraman / package-json-version.bash
Created March 27, 2018 12:32
Get the package.json version from the terminal/bash
cat package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[",]//g'
@kadikraman
kadikraman / importAndExportFile.js
Created March 19, 2018 14:29
Import a file and immediately export
export { default as CircleAdd } from './icons/CircleAdd';
export { default as TagRemove } from './icons/TagRemove';
@kadikraman
kadikraman / requireBasedOnRegex.js
Last active June 22, 2017 10:01
(Webpack) require a bunch of files based on a regex
/*
Instead of
require('../../blah/stories.js');
require('../../blah/blah/stories.js');
...
*/
const req = require.context('../', true, /stories\.js$/);
function loadStories() {