Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@kiddtang
kiddtang / .env
Last active December 21, 2023 09:25
proxy-manager
APP_PORT=48080
FORWARD_DB_PORT=43306
FORWARD_REDIS_PORT=46379
FORWARD_MEILISEARCH_PORT=47700
FORWARD_MAILHOG_PORT=41025
FORWARD_MAILHOG_DASHBOARD_PORT=48025
@spemer
spemer / customize-scrollbar.css
Last active April 23, 2024 06:47
✨ Customize website's scrollbar like Mac OS. Not supports in Firefox and IE.
/* Customize website's scrollbar like Mac OS
Not supports in Firefox and IE */
/* total width */
body::-webkit-scrollbar {
background-color: #fff;
width: 16px;
}
/* background of the scrollbar except button or resizer */
@geraldvillorente
geraldvillorente / import.md
Created June 14, 2017 05:03
How to import database in MySQL in Docker?

This is a simple way of importing MySQL database in Docker.

  1. In you Dockerfile you must have a shared folder. Shared folder is a directory in your host machine that is mounted to Docker instance.

  2. Put the exported sql file in the shared folder.

  3. Login to your Docker instance via docker exec -it DOCKER_CONTAINER_ID bin/bash.

  4. Login to MySQL via mysql -u USERNAME -p.

Just some notes and references for myself.

  • In bash, you can access your C:\ drive via /mnt/c/
  • ~ = C:\Users\MLM\AppData\Local\lxss\home\mlm and is different from your Windows user directory C:\Users\MLM

How to google things

@cmbaughman
cmbaughman / wordpress_encryption_fragment.php
Created May 7, 2015 13:17
Functions to decrypt and encrypt Wordpress passwords from plugin.
<?php
/* These need to go in your custom plugin (or existing plugin) */
private function encrypt($input_string, $key){
$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
$h_key = hash('sha256', $key, TRUE);
return base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $h_key, $input_string, MCRYPT_MODE_ECB, $iv));
}
@MoOx
MoOx / index.js
Last active February 9, 2024 22:44
Export/import github labels
// go on you labels pages
// eg https://github.com/cssnext/cssnext/labels
// paste this script in your console
// copy the output and now you can import it using https://github.com/popomore/github-labels !
var labels = [];
[].slice.call(document.querySelectorAll(".label-link"))
.forEach(function(element) {
labels.push({
name: element.textContent.trim(),