Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

logbasex logbasex

🎯
Focusing
View GitHub Profile
@logbasex
logbasex / gist:631f00c7b6d7b83280babf3afa84385c
Created Feb 6, 2021 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup
View gist:631f00c7b6d7b83280babf3afa84385c

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@logbasex
logbasex / mysql-docker.sh
Created Oct 26, 2020 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
View mysql-docker.sh
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
View Effective_Engineer.md

FWIW: I'm not the author of the content presented here (which is an outline from Edmond Lau's book). I've just copy-pasted it from somewhere over the Internet, but I cannot remember what exactly the original source is. I was also not able to find the author's name, so I cannot give him/her the proper credits.


Effective Engineer - Notes

What's an Effective Engineer?

View apache-poi-example.java
XSSFRow pre = sheet.createRow(0);
XSSFCell titleCell = pre.createCell(0);
titleCell.setCellType(CellType.STRING);
titleCell.setCellValue("Sent Email Detailed Statistics");
XSSFFont font = workbook.createFont();
font.setFontHeightInPoints((short) 25);
XSSFCellStyle titleStyle = workbook.createCellStyle();
XSSFColor grey = new XSSFColor(new java.awt.Color(255,195,1));
titleStyle.setFillBackgroundColor(grey);
@logbasex
logbasex / setup-mysql.sh
Created Jun 13, 2020 — forked from sheikhwaqas/setup-mysql.sh
Install MySQL Server on Ubuntu (Non-Interactive Installation)
View setup-mysql.sh
# Download and Install the Latest Updates for the OS
apt-get update && apt-get upgrade -y
# Set the Server Timezone to CST
echo "America/Chicago" > /etc/timezone
dpkg-reconfigure -f noninteractive tzdata
# Enable Ubuntu Firewall and allow SSH & MySQL Ports
ufw enable
ufw allow 22
View findLargestElementInArray.java
public static int getLargerNumber(int a, int b) {
int c = a - b;
//get sign bit's value
int k = (c >> 31) & 0x1;
return a - k * c;
}
public static void main(String[] args) {
//--------------------------------
@logbasex
logbasex / FindLargestElementInCollection.java
Last active Jun 5, 2020
This solution implement by bitwise operator.
View FindLargestElementInCollection.java
package com.algorithm.bitwise;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
import java.util.stream.Stream;
public class FindLargestElementV2 {
//MSB: most significant bit.
public static long countGreaterOrEqualElementWithSameMSB(List<Integer> seq, int valueAtMSBIndex) {
View Usage of @AliasFor.md

Usage of @AliasFor

In Spring's many annotations, it is often found that many different attributes of different annotations play the same role, such as @RequestMapping's value attribute and path attribute. In order to keep their behavior consistent, such as the value of value and the value of path can not conflict, their values should always be equal. To handle these issues uniformly, Spring created the @AliasFor tag.

The @AliasFor tag has the following usage methods.

1, explicit use within the same annotation

For example, the usage in @RequestMapping:

View docker-note.md

One liner to stop / remove all of Docker containers:

docker stop $(docker ps -a -q)

docker rm $(docker ps -a -q)

View postgresql-note.sql
## Regex: https://www.postgresql.org/docs/9.3/functions-matching.html
` select url, thumbnail from media WHERE url !~* '.jpg|.mp4|.mov|.jpeg|.png|.mp3';`