Skip to content

Instantly share code, notes, and snippets.

@devdrops
devdrops / example.md
Last active December 13, 2024 15:30
Mysqldump from Docker container

Mysqldump from Docker container

docker exec -i mysql_container mysqldump -uroot -proot --databases database_name --skip-comments > /path/to/my/dump.sql

OBS

  • This will generate a dump.sql file in your host machine. Awesome, eh?
  • Avoid using --compact on your dump. This will make MySQL check your constraints which will cause troubles when reading your file (damm you MySQL). And don't use --force to fix this scenario: recreate your dump without --compact ¯_(ツ)_/¯
@cobyism
cobyism / gh-pages-deploy.md
Last active December 13, 2024 15:30
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).

@tugytur
tugytur / offline-election-howto.md
Last active December 13, 2024 15:28
Simulate the Polkadot offline-election
#!/usr/bin/env bash
set -e
readonly CONTENT_MAIN_TF='module "wrapper" {}'
readonly CONTENT_VARIABLES_TF='variable "items" {
description = "Maps of items to create a wrapper from. Values are passed through to the module."
type = any
default = {}
}'
@gyulkkajo
gyulkkajo / c_cpp_properties.json
Last active December 13, 2024 15:27
IntelliSense config file for Linux kernel X86_64.
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}",
"LINUX_PATH/include",
"LINUX_PATH/include/uapi",
"LINUX_PATH/include/generated",
"LINUX_PATH/arch/x86/include",
@lucprincen
lucprincen / Save.php
Last active December 13, 2024 15:25
Saves a WordPress FSE pattern on the local environment.
<?php
namespace WotW\Theme\Patterns;
use WotW\Theme\Contracts\Interfaces\Hookable;
class Save implements Hookable{
public function register_hooks(): void {
@almas
almas / ubuntu-on-mbp-a1707.md
Last active December 13, 2024 15:23 — forked from rob-hills/ubuntu-22.04-mbp-a1707.md
Ubuntu LTS on MacBook Pro 2017 (A1707, MBP 14,3)(T1 chip)

Summary

Notes to install Ubuntu 22.04.4LTS (Upgraded to 24.04LTS) up and running on my 2017 MacBook Pro 15 inch (MacBookPro14,3).

Now everything except the TouchID (Fingerprint), Suspend and Hibernation seems to work for me.

About Ubuntu 24.04LTS: I tried to install Ubuntu 24.04 and didn't have success. There was a crash issue during installation. https://bugs.launchpad.net/subiquity/+bug/2065310 But I installed 22.04 and upgraded it to the 24.04LTS later and it working same as 22.04.4.

Useful References (not mentioned in the text)

@by12380
by12380 / amazon-lp-from-leetcode.txt
Last active December 13, 2024 15:22
Amazon LP Questions from LeetCode Interview Experiences
1.https://interviewgenie.com/blog-1/category/Amazon+interviews
2.https://www.youtube.com/channel/UCw0uQHve23oMWgQcTTpgQsQ/playlists
3.https://medium.com/@scarletinked/are-you-the-leader-were-looking-for-interviewing-at-amazon-8301d787815d
Tell me about a situation where you had a conflict with someone on your team. What was it about? What did you do? How did they react? What was the outcome?
Give an example of when you saw a peer struggling and decided to step in and help. What was the situation and what actions did you take? What was the outcome?
Tell me about a time you committed a mistake?
Tell me about a time when your earned your teammate's trust?
@genyrosk
genyrosk / REISUB.md
Created November 3, 2022 18:52
REISUB: A gentle Linux restart

REISUB

If a Linux machine locks up or freezes completely, use REISUB to restart it more gently than pushing the Power Button.

Hold down Alt and the SysReq (Print Screen) keys, and then type R E I S U B, with 2-3 second delays between the key presses to give the commands a better chance to complete.

  • R: Switch the keyboard from raw mode to XLATE mode
  • E: Send the SIGTERM signal to all processes except init
  • I: Send the SIGKILL signal to all processes except init
  • S: Sync all mounted filesystems
@athlan
athlan / AnnotationTypeInformationMapper.java
Created September 22, 2015 19:30
Spring Data Mongo custom _class value
package selly.spring.data.convert;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.config.BeanDefinition;