This file contains hidden or 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
{ | |
"description": "Zed Editor: change caps to escape", | |
"manipulators": [ | |
{ | |
"type": "basic", | |
"from": { | |
"key_code": "caps_lock" | |
}, | |
"to": [ | |
{ |
This file contains hidden or 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
# Increase speed of the animation | |
defaults write com.apple.dock autohide-time-modifier -float 0.35;killall Dock | |
# remove the delay | |
defaults write com.apple.Dock autohide-delay -float 0;killall Dock |
This file contains hidden or 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
import { useEffect, useState } from 'react' | |
const appId = process.env.REACT_APP_FACEBOOK_APP_ID || 'dev_app_id' | |
const useFacebook = () => { | |
const [fbSdkLoaded, setFbSdkLoaded] = useState(false) | |
useEffect(() => { | |
setupFacebook() | |
// eslint-disable-next-line react-hooks/exhaustive-deps |
This file contains hidden or 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
# Delete branches that are already merged (but master/development/stage) | |
git branch --merged | egrep -v "(^\*|master|development|stage)" | xargs git branch -d | |
# Delete all local branches (but master/development/stage) | |
git branch | egrep -v "(^\*|master|development|stage)" | xargs git branch -D |
This file contains hidden or 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
// =================================== | |
// ============ Slide ================ | |
// =================================== | |
/* | |
<div class"i-slides"> | |
<div class="i-slide"></div> | |
<div class="i-slide"></div> | |
<div class="i-slide"></div> | |
... |
This file contains hidden or 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
function BrowserDetection() { | |
//Check if browser is IE | |
if (navigator.userAgent.search('MSIE') !== -1) { | |
console.log('IE'); | |
} | |
//Check if browser is Chrome | |
else if (navigator.userAgent.search('Chrome') !== -1) { | |
console.log('Chrome'); | |
} | |
//Check if browser is Firefox |
This file contains hidden or 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
// Regex to get any repeated numbers in a string | |
var repeatedNumber = /(\d)\d*\1/ | |
/* | |
(\d) -> first group (a number in this case) that will be checked by \1 | |
\d* -> any quantity of digits between the number to be checked and the "checker" | |
\1 -> same stuff that is in the 1st group (in this case, a digit = \d) | |
e.g | |
00: |
This file contains hidden or 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
const debounce = (func, wait, immediate) => { | |
let timeout | |
return function() { | |
const context = this | |
const args = arguments | |
const later = () => { | |
timeout = null | |
if(!immediate) func.apply(context, args) |
This file contains hidden or 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
;(function companyNameFromEmail(emailElement, companyElement, $) { | |
const DEBOUNCE_TIME = 250 | |
const COMPANY_REGEX = /(?<=@).+(?=\.)/ | |
const $companyField = $(companyElement) | |
const $companyParagraph = $companyField.closest('p') | |
$companyParagraph.hide() | |
const toTitleCase = (string) => ( |
NewerOlder