Skip to content

Instantly share code, notes, and snippets.

View QuynhVir's full-sized avatar
🏠
Working from home

Vir QuynhVir

🏠
Working from home
  • Midgard
View GitHub Profile
@QuynhVir
QuynhVir / made-with-love.html
Created December 3, 2019 14:22 — forked from oliveratgithub/made-with-love.html
Various HTML-snippets to add "Made with love" to your website
<!-- Example #1 - no styling -->
Made with ❤ in Switzerland
<!-- Example #2 - inline-styled ❤ -->
Made with <span style="color: #e25555;">&#9829;</span> in Switzerland
Made with <span style="color: #e25555;">&hearts;</span> in Switzerland
<!-- Example #3 - CSS-style class for ❤ -->
<style>.heart{color:#e25555;}</style>
Made with <span class="heart"></span> in Switzerland
@QuynhVir
QuynhVir / svg2icns
Created November 25, 2019 07:12 — forked from zlbruce/svg2icns
covert svg to icns (with imagemagick)
#!/bin/bash
echo "*** SVG 2 ICNS ***"
if [ $# -ne 1 ]; then
echo "Usage: svg2icns filename.svg"
exit 100
fi
filename="$1"
name=${filename%.*}
ext=${filename##*.}
echo "processing: $name"
@QuynhVir
QuynhVir / environment
Created October 18, 2019 14:18
setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory
nano /etc/environment
add these lines...
LANG=en_US.utf-8
LC_ALL=en_US.utf-8
sudo nano /etc/sysctl.conf
fs.file-max=6510126
vm.overcommit_memory=1
net.core.somaxconn=65535
sudo sysctl -p
sudo nano /etc/security/limits.conf
@QuynhVir
QuynhVir / rc.local
Created October 8, 2019 09:03
Disable fucking Transparent Huge Pages in /etc/rc.local
#!/bin/bash
/bin/echo 'never' > /sys/kernel/mm/transparent_hugepage/enabled
exit 0
NAME HEX uint32 int32 CATEGORY DESC UPDATE NAME HEX2 NAME HEX uint32 int32 CATEGORY DESC UPDATE NAME PRICE1 PRICE2 HIGH_PRICE
BLIMP3 0xEDA4ED97 3987008919 -307958377 AFTER HOURS EDA4ED97 BLIMP3 0xEDA4ED97 3987008919 -307958377 AFTER HOURS " 895,000 " " 1,190,350 " " 1,190,350 "
FREECRAWLER 0xFCC2F483 4240635011 -54332285 AFTER HOURS FCC2F483 FREECRAWLER 0xFCC2F483 4240635011 -54332285 AFTER HOURS " 597,000 " " 597,000 "
MENACER 0x79DD18AE 2044532910 2044532910 AFTER HOURS 79DD18AE MENACER 0x79DD18AE 2044532910 2044532910 AFTER HOURS " 1,775,000 " " 1,775,000 "
MULE4 0x73F4110E
@QuynhVir
QuynhVir / gist:289618282a16091c0949b8d7fcd45a94
Last active March 26, 2020 09:50 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@QuynhVir
QuynhVir / main.go
Created January 17, 2019 18:34
Facebook Graph API and Go http request example
package main
import (
"fmt"
"net/http"
"io/ioutil"
"encoding/json"
)
type Page struct {
@QuynhVir
QuynhVir / ReadFile.go
Created January 17, 2019 16:06 — forked from thedevsaddam/ReadFile.go
Reading file, line by line in Go lang using scanner
package main
import (
"bufio"
"fmt"
"os"
)
func main() {
@QuynhVir
QuynhVir / con.go
Created January 17, 2019 15:10
Limit number of goroutines running
package main
import "fmt"
const MAX = 20
func main() {
sem := make(chan int, MAX)
for {
sem <- 1 // will block if there is MAX ints in sem