Skip to content

Instantly share code, notes, and snippets.

View dvgamerr's full-sized avatar
🦥
ไม่ชอบออกไปไหน

Kananek Thongkam dvgamerr

🦥
ไม่ชอบออกไปไหน
View GitHub Profile
@dvgamerr
dvgamerr / string.md
Last active June 4, 2018 07:16 — forked from rauschma/string.md

Strings

String.prototype.*

ไม่มีฟังชั่นใดๆ ที่แก้ไขตัวแปรโดยตรง this – ฟังชั่นจะส่งค่าสตริงตัวใหม่คืนกลับมาให้เสมอ

  • charAt(ตำแหน่ง: ตัวเลข): คืนค่าเป็นข้อความ ES1

    Returns the character at index pos, as a string (JavaScript does not have a datatype for characters). str[i] is equivalent to str.charAt(i) and more concise (caveat: may not work on old engines).

@dvgamerr
dvgamerr / curse-hell.md
Created May 16, 2018 08:10
Manga Generate link bot Project
http://www.curse-hell.net/bbs/forum.php?mod=guide&view=new
@dvgamerr
dvgamerr / stream.md
Last active May 12, 2018 18:37
stream game get list

C:\Program Files (x86)\Steam\userdata\{ID64toDirName}\config\localconfig.vdf

//id = 76561198006499496 
public static string ID64toDirName(Int64 id)
{
    return (id - 0x0110000100000000).ToString();
}
@dvgamerr
dvgamerr / Clean Docker.md
Created May 11, 2018 15:56
Clean Docker

Disk usage using df command:

$ docker system df

Returns something like this,

TYPE TOTAL ACTIVE SIZE RECLAIMABLE Images 35 6 8.332GB 7.364GB (88%) Containers 12 12 417.6MB 0B (0%) Local Volumes 67 2 2.828GB 2.828GB (100%)

@dvgamerr
dvgamerr / LICENCE SUBLIME TEXT.md
Last active May 10, 2018 10:53
sublime text 3 build 3170, 3164

Mac|Linux nano /etc/hosts

and paste this line at very bottom of file, save and exit

127.0.0.1 license.sublimehq.com

Fixed: flush/clear First, flush/clear DNS cache (e.g. sudo systemd-resolve --flush-caches for systemd-resolved). Second, restart your computer.

Windows c:\windows\system32\drivers\etc\hosts

@dvgamerr
dvgamerr / Preferences.sublime-settings
Created April 23, 2018 09:41
Preferences.sublime-settings
{
"always_show_minimap_viewport": true,
"bold_folder_labels": true,
"color_scheme": "Packages/Material Theme/schemes/Material-Theme.tmTheme",
"font_options":
[
"gray_antialias",
"subpixel_antialias"
],
"font_size": 10,
let charType = () => {
let group = [ 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2 ]
return group[parseInt(Math.random() * group.length)]
}
let charASCII = t => parseInt(Math.random() * (t === 0 ? 9 : 25))
const randomString = l => {
l = l || 32
let result = ''
for (let i = 0; i < l; i++) {
@dvgamerr
dvgamerr / bundle.sh
Created April 8, 2018 15:55
Gitlab Command
sysctl -w vm.max_map_count=262144
sudo chmod 700 /home/git/data/uploads
sudo chmod -R ug+rwX,o-rwx /home/git/data/repositories/
sudo chmod -R ug-s /home/git/data/repositories/
sudo find /home/git/data/repositories/ -type d -print0 | sudo xargs -0 chmod g+s
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production
apt-get update -y && apt-get upgrade -y && apt-get dist-upgrade -y
vi /etc/network/interfaces
auto enp0s25
iface enp0s25 inet static
address 192.168.1.2
gateway 192.168.1.1
netmask 255.255.255.0
dns-nameservers 8.8.8.8 8.8.4.4
@dvgamerr
dvgamerr / fstab.ini
Created April 8, 2018 15:52
Linux Config files
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
/dev/mapper/PGM--SERVER--vg-root / ext4 errors=remount-ro 0 1
# /boot was on /dev/sda1 during installation
UUID=ee608de4-87ae-4fd4-a483-482ff96aef17 /boot ext2 defaults 0 2