Skip to content

Instantly share code, notes, and snippets.

Avatar

Huy Tran htr3n

View GitHub Profile
@htr3n
htr3n / termite-install.sh
Created Aug 19, 2019
Debian/Ubuntu-specific termite installation script
View termite-install.sh
#!/usr/bin/env sh
sudo apt-get install -y \
git \
g++ \
libgtk-3-dev \
gtk-doc-tools \
gnutls-bin \
valac \
intltool \
@htr3n
htr3n / cloudSettings
Last active Aug 6, 2020
VSCode/Codium settings
View cloudSettings
{"lastUpload":"2020-08-06T03:09:50.018Z","extensionVersion":"v3.4.3"}
@htr3n
htr3n / ubuntu-installation.md
Created Jun 19, 2019
Installing and setting a working Ubuntu box
View ubuntu-installation.md

Software Management

Ubuntu/Linux Tools

APT (Ubuntu's Advanced Packaging Tool)

# installing a package
sudo apt install zsh
View win-installation.md

System

ssh-keygen -t rsa -b 4096 -C "hoang.huy.tran@gmail.com"

PowerShell

  • Windows PowerShell was built upon .NET and only worked on Windows
  • PowerShell Core is open sourced and built on .NET Core 2.x, work on Windows, Linux, macOS, ARM
@htr3n
htr3n / macos-ramdisk.md
Last active Jul 5, 2020
Creating RAM disk in macOS
View macos-ramdisk.md

Built-in

diskutil erasevolume HFS+ 'RAM Disk' `hdiutil attach -nobrowse -nomount ram://XXXXX`

where XXXXX is the size of the RAM disk in terms of memory blocks.

Notes:

@htr3n
htr3n / firefox-optimization.md
Last active May 20, 2019
Firefox Quantum optimization
View firefox-optimization.md

about:config

  • Set browser.download.animateNotifications to False
  • Set security.dialog_enable_delay to 0
  • Set network.prefetch-next to False (Only on slow internet connections)
  • Set browser.newtabpage.activity-stream.feeds.telemetry to false
  • Set browser.newtabpage.activity-stream.telemetry to false
  • Set browser.ping-centre.telemetry to false
  • Set toolkit.telemetry.archive.enabled to false
  • Set toolkit.telemetry.bhrPing.enabled to false
View HelloWorld.java
@RestController
class HelloWorld {
@RequestMapping("/")
public String hello(){
return "Hello World!";
}
}
View Customer.java
package io.github.htr3n.springjdbcsimple.entity;
public class Customer {
private Integer id;
private String name;
private String email;
public Integer getId() {
return id;
}
View text-gradient.css
/*
https://stackoverflow.com/a/37832318/339302
*/
.rainbow2 {
background-image: -webkit-linear-gradient(left, #E0F8F7, #585858, #fff); /* For Chrome and Safari */
background-image: -moz-linear-gradient(left, #E0F8F7, #585858, #fff); /* For old Fx (3.6 to 15) */
background-image: -ms-linear-gradient(left, #E0F8F7, #585858, #fff); /* For pre-releases of IE 10*/
background-image: -o-linear-gradient(left, #E0F8F7, #585858, #fff); /* For old Opera (11.1 to 12.0) */
background-image: linear-gradient(to right, #E0F8F7, #585858, #fff); /* Standard syntax; must be last */
color:transparent;
@htr3n
htr3n / walk.py
Last active Apr 22, 2019
Python -- traverse a folder
View walk.py
import os
for dirname, dirnames, filenames in os.walk('.'):
# print path to all subdirectories first.
for subdirname in dirnames:
print(os.path.join(dirname, subdirname))
# print path to all filenames.
for filename in filenames:
print(os.path.join(dirname, filename))
You can’t perform that action at this time.