- Validate email regex - https://stackoverflow.com/a/46181/7905132
View create-markdown-table-from-package.json-file.py
This file contains 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 json | |
import requests | |
# Read package.json file | |
with open('package.json', 'r') as file: | |
package_json = json.load(file) | |
# Extract dependencies and their versions | |
dependencies = package_json.get('dependencies', {}) |
View usePropertyChangeTracker.js
This file contains 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 * as React from 'react' | |
export function usePropertyChangeTracker({ data, property, callback }) { | |
const previousDataRef = React.useRef([]) | |
React.useEffect(() => { | |
const previousData = previousDataRef.current | |
for (let i = 0; i < data.length; i++) { | |
const previousItem = previousData[i] |
View Bookmarks.md
View index.md
Disable Spotlight
https://apple.stackexchange.com/questions/144474/mds-and-mds-stores-constantly-consuming-cpu
As you know, the mds and mds_stores are Spotlight activities.
The reason why your Spotlight is so active could be a number of things; it could be you have an app or multiple apps constantly changing some folder contents.
First let's check whether Spotlight is the cause of the fans running so much. To test this, run the following in your terminal:
View eu-countries.ts
This file contains 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
export type EUCountry = { | |
name: string | |
currency: string | |
code: string | |
} | |
export const EU_COUNTRIES: EUCountry[] = [ | |
{ | |
name: 'Austria', | |
currency: 'euro', |
View countries.ts
This file contains 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
export interface Country { | |
name: string | |
code: string | |
} | |
export const CountryList: Country[] = [ | |
{ name: "Afghanistan", code: "AF" }, | |
{ name: "Albania", code: "AL" }, | |
{ name: "Algeria", code: "DZ" }, | |
{ name: "American Samoa", code: "AS" }, |
View commands.txt
This file contains 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
// Must install ImageMagick first | |
http://www.imagemagick.org/script/index.php | |
//This compresses a jpg with no visible loss of quality. Add in your own file names for target.jpg and result.jpg | |
convert -strip -interlace Plane -sampling-factor 4:2:0 -quality 85% target.jpg result.jpg | |
// This does the same as above but to an entire folder (will overwrite original files): | |
mogrify -strip -interlace Plane -sampling-factor 4:2:0 -quality 85% *.jpg | |
//This does the same thing but to all subfolders as well (Be careful with this one it will overwrite all original files) |
View usersettings.json
This file contains 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
{ | |
"editor.tabSize": 4, | |
"editor.detectIndentation": false, | |
"telemetry.enableTelemetry": false, | |
"workbench.startupEditor": "newUntitledFile", | |
"terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe", | |
"emmet.includeLanguages": { | |
"vue-html": "html" | |
}, | |
"explorer.confirmDelete": false, |
View filters.js
This file contains 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 Vue from 'vue' | |
export function formatDateRo(date) { | |
return new Date(date).toLocaleDateString('ro-RO') | |
} | |
export function roundToTwo(num) { | |
return +(Math.round(num + 'e+2') + 'e-2') | |
} |
View Math.uuid.js
This file contains 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
/*! | |
Math.uuid.js (v1.4) | |
http://www.broofa.com | |
mailto:robert@broofa.com | |
Copyright (c) 2010 Robert Kieffer | |
Dual licensed under the MIT and GPL licenses. | |
*/ | |
/* |
NewerOlder