cd ~/.ssh
ssh-keygen -t rsa -C "my@personal" -f "github-personal"
ssh-keygen -t rsa -C "my@work" -f "github-work"
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
// console messages | |
console\.(log|warn|error|info|debug|trace|time|timeEnd|timeLog|table|count|countReset|group|groupEnd|groupCollapsed|assert|clear|dir|dirxml)\([\s\S]*?\);? | |
// comments | |
// .*$|/\*[\s\S]*?\*/ |
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
// removes all rounded classes | |
(^\s*|\s+)rounded(-[a-z]+)? | |
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
////////// 1. Blank link | |
function remove_links_around_images($content) { | |
// Use regex to remove anchor tags around image tags | |
$pattern = '/<a[^>]*>(\s*<img[^>]*>\s*)<\/a>/i'; | |
$replacement = '$1'; // Keep the image tag and remove the anchor tag | |
$content = preg_replace($pattern, $replacement, $content); | |
return $content; | |
} |
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 { paraglide } from "@inlang/paraglide-next/plugin"; | |
import createMDX from "@next/mdx"; | |
// Define paraglide configuration | |
const paraglideConfig = { | |
paraglide: { | |
project: "./project.inlang", | |
outdir: "./src/paraglide", | |
}, | |
basePath: "", |
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
# Credits: https://www.kaggle.com/discussions/general/74235#2193182 | |
# Step 1: | |
# Use below code to upload your kaggle.json to colab environment (you can download kaggle.json from your Profile->Account->API Token) | |
from google.colab import files | |
files.upload() | |
# Step 2: | |
# Below code will remove any existing ~/.kaggle directory and create a new one. It will also move your kaggle.json to ~/.kaggle |
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
from google.colab import drive | |
drive.mount('/content/drive') | |
!cp <output-directory-name> -r /content/drive/MyDrive/<destination-directory-name> | |
# !cp whale-data -r /content/drive/MyDrive/whale-data-unzipped |
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
/* | |
Remove child categories from Wordpress permalink (https://example.com/%category%/%postname%/ custom structure) | |
https://example.com/category/sub-category/post-name to https://example.com/category/post-name | |
*/ | |
function remove_child_categories_from_permalinks( $category ) { | |
while ( $category->parent ) { | |
$category = get_term( $category->parent, 'category' ); | |
} |
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 custom_excerpt_length( $length ) { | |
return 45; // Use any integer per your requirement. | |
} | |
add_filter( 'excerpt_length', 'custom_excerpt_length', 999 ); |
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 cc_mime_types($mimes) { | |
$mimes['svg'] = 'image/svg+xml'; | |
return $mimes; | |
} | |
add_filter('upload_mimes', 'cc_mime_types'); |
NewerOlder