Skip to content

Instantly share code, notes, and snippets.

@ytkang
ytkang / mongodbIndexExporter.js
Last active May 6, 2024 08:15
Mongodb Index exporter importer
/*
How to export
* mongo is mongoshell command
mongo dbname --quiet mongodbIndexExporter.js > index.js
*/
let collectionNames = db.getCollectionNames();
let index_data = {'collections': []};
for (let i in collectionNames) {
@GetVladimir
GetVladimir / Setup-iCloud+-Custom-Domain-Catch-All-email-with-Gmail.md
Last active May 6, 2024 08:12
How to setup iCloud+ Custom Domain Catch All email with Gmail

How to setup iCloud+ Custom Domain Catch All email with Gmail

I've recently tested on how to move the custom domain catch all email from G Suite to the new iCloud+ Catch All feature and wanted to share my experience.

The end result is having Custom Domain email and Catch All routing, that can be fully used via Gmail, including receiving and sending emails.


The steps

  • Setup your Custom Domain (or subdomain) with iCloud+
@wojteklu
wojteklu / clean_code.md
Last active May 6, 2024 08:12
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@yogthos
yogthos / clojure-beginner.md
Last active May 6, 2024 08:11
Clojure beginner resources

Introductory resources

@jordienr
jordienr / tailwind.config.ts
Created July 15, 2023 09:10
Tailwind SVG Grid Background
// Remember to install mini-svg-data-uri
// Follow me on twitter for memes @jordienr
import { type Config } from "tailwindcss";
const {
default: flattenColorPalette,
} = require("tailwindcss/lib/util/flattenColorPalette");
const svgToDataUri = require("mini-svg-data-uri");
export default {
@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active May 6, 2024 08:10
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This no longer works in browser!

Note

This no longer works if you're alone in vc! Somebody else has to join you!

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
@magicdude4eva
magicdude4eva / zsh-syntax-highlighting paste performance improvement
Last active May 6, 2024 08:10
zsh-syntax-highlighting paste performance improvement
Add the following in .zshrc:
...
plugins=(osx git zsh-autosuggestions zsh-syntax-highlighting zsh-nvm docker kubectl)
...
### Fix slowness of pastes with zsh-syntax-highlighting.zsh
pasteinit() {
OLD_SELF_INSERT=${${(s.:.)widgets[self-insert]}[2,3]}
zle -N self-insert url-quote-magic # I wonder if you'd need `.url-quote-magic`?
@amundo
amundo / saveJSON.js
Created November 22, 2014 01:44
a simple function to export a JSON file
function saveJSON(data, saveAs){
var stringified = JSON.stringify(data, null, 2);
var blob = new Blob([stringified], {type: "application/json"});
var url = URL.createObjectURL(blob);
var a = document.createElement('a');
a.download = saveAs + '.json';
a.href = url;
a.id = saveAs;
document.body.appendChild(a);
@handcoding
handcoding / Ashley’s Light Fader.yaml
Last active May 6, 2024 08:07
This script for Home Assistant will fade a lamp over time with your choice of easing, including varieties of ease-in, ease-out, and ease-in-out.
alias: Ashley’s Light Fader
description: >
Fades a lamp over time. If you have any questions or comments about this
script, feel free to tweet Ashley Bischoff at @FriendlyAshley. Released under
the Apache 2.0 license. (v2.0)
fields:
light:
name: 💡 Light
description: entity_id of the lamp.
selector:
@cobyism
cobyism / gh-pages-deploy.md
Last active May 6, 2024 08:07
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).