Skip to content

Instantly share code, notes, and snippets.

View danielturus's full-sized avatar
🎯
Focusing

Daniel Turuș danielturus

🎯
Focusing
View GitHub Profile
@cheeaun
cheeaun / ocr.sh
Last active December 6, 2023 20:38
macOCR script for Raycast. Preview https://twitter.com/cheeaun/status/1395973544983425025
#!/bin/bash
# Dependency: requires macOCR
# Download: https://github.com/schappim/macOCR
# @raycast.schemaVersion 1
# @raycast.title macOCR
# @raycast.mode silent
# @raycast.author Lim Chee Aun
# @raycast.authorURL https://github.com/cheeaun
@Reeska
Reeska / rename-js-to-jsx.js
Last active April 23, 2024 20:04
A script to convert .js to .jsx when they contains JSX tags
// node ./rename-js-to-jsx.js ./my/folder
const fs = require('fs')
const path = require('path')
// Options
const src = process.argv[2] ?? './'
const pattern = process.argv[3] ? new RegExp(`${process.argv[3]}$`) : /.js$/
const newExtension = process.argv[4] ?? '.jsx'
@gargroh
gargroh / useCellRangeSelection.js
Created December 12, 2019 11:26
[React Table v7] [useCellRangeSelection] Excel like cell range selection in react table
import React from 'react';
import {
actions,
makePropGetter,
ensurePluginOrder,
functionalUpdate,
useConsumeHookGetter,
useGetLatest
} from '../../react-table/utils';

If .DS_Store was never added to your git repository, simply add it to your .gitignore file.

If you don't have one, create a file called

.gitignore

In your the root directory of your app and simply write

server {
location ~* (serviceworker\.js)$ {
add_header 'Cache-Control' 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
expires off;
proxy_no_cache 1;
}
}
@paceaux
paceaux / tinyRules.css.md
Last active April 3, 2024 01:19
Tiny rules for how to name things in CSS and JS

Tiny rules for how to name stuff

CSS

How to name CSS classes

Stateful Class names

Is it a state that is only one of two conditions? (i.e. a boolean)

@jherax
jherax / filterArray.js
Last active February 23, 2024 12:59
Filters an array of objects with multiple match-criteria.
/**
* Filters an array of objects using custom predicates.
*
* @param {Array} array: the array to filter
* @param {Object} filters: an object with the filter criteria
* @return {Array}
*/
function filterArray(array, filters) {
const filterKeys = Object.keys(filters);
return array.filter(item => {
@adamjohnson
adamjohnson / publickey-git-error.markdown
Last active April 18, 2024 01:00
Fix "Permission denied (publickey)" error when pushing with Git

"Help, I keep getting a 'Permission Denied (publickey)' error when I push!"

This means, on your local machine, you haven't made any SSH keys. Not to worry. Here's how to fix:

  1. Open git bash (Use the Windows search. To find it, type "git bash") or the Mac Terminal. Pro Tip: You can use any *nix based command prompt (but not the default Windows Command Prompt!)
  2. Type cd ~/.ssh. This will take you to the root directory for Git (Likely C:\Users\[YOUR-USER-NAME]\.ssh\ on Windows)
  3. Within the .ssh folder, there should be these two files: id_rsa and id_rsa.pub. These are the files that tell your computer how to communicate with GitHub, BitBucket, or any other Git based service. Type ls to see a directory listing. If those two files don't show up, proceed to the next step. NOTE: Your SSH keys must be named id_rsa and id_rsa.pub in order for Git, GitHub, and BitBucket to recognize them by default.
  4. To create the SSH keys, type ssh-keygen -t rsa -C "your_email@example.com". Th
@ngs
ngs / table.mkdn
Created May 24, 2012 16:04
Unicode character table

A

Description Entity Preview
A With Acute, Latin Capital Letter Á Á
A With Acute, Latin Small Letter á á
A With Breve, Latin Small Letter ă ă
A With Caron, Latin Small Letter ǎ ǎ
A With Circumflex, Latin Capital Letter  Â
A With Circumflex, Latin Small Letter â â