Skip to content

Instantly share code, notes, and snippets.

View xoxwgys56's full-sized avatar
🚶
As it was

Yoooda xoxwgys56

🚶
As it was
View GitHub Profile
@xoxwgys56
xoxwgys56 / gist:3e53958097ffbe8f153538c3ef9ca1e8
Last active October 25, 2021 02:13 — forked from anthonyray/gist:398fde676a7704c03d6624155ba0011e
Set up OhMyZsh on Amazon EC2 instance running Ubuntu Server 14.04
  1. Connect to your EC2 instance
  2. Install zsh : sudo apt-get update && sudo apt-get install zsh
  3. Edit your passwd configuration file to tell which shell to use for user ubuntu : sudo vim /etc/passwd
  4. Look for ubuntu user, and replace bin/bash by bin/zsh
  5. Install OhMyZsh : sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
  6. Disconnect from your instance and reconnect it.
@xoxwgys56
xoxwgys56 / gist:ccfdb25a410e48f208fc9c2f9f140c9b
Created July 26, 2021 04:02 — forked from asabaylus/gist:3071099
Github Markdown Heading Anchors

Anchors in Markdown

To create an anchor to a heading in github flavored markdown. Add - characters between each word in the heading and wrap the value in parens (#some-markdown-heading) so your link should look like so:

[create an anchor](#anchors-in-markdown)

@xoxwgys56
xoxwgys56 / paragraph.py
Last active August 4, 2021 05:32
get paragraph from string
"""
This gist inspired from below repository. and suppose input type is plain string.
https://github.com/nirajdpandey/passage-retrieval-chatbot
"""
from typing import List, Callable
def paragraphs(file: str, is_separator: Callable = None):
"""paragraph generator"""
@xoxwgys56
xoxwgys56 / regex-with-position.py
Created August 4, 2021 05:48
find digit group from text using re
import re
"""
find digit group from text
"""
def print_match(m):
print('\t',{
'start':m.start(),
'group': m.group(),
@xoxwgys56
xoxwgys56 / mangling_example.py
Last active August 4, 2021 06:04
python name mangling example with class
"""
Below value called `private` or `protected` is not accredited expression.
I choose those expression for easy to understand scope.
"""
class MyClass:
__private_value = 'private'
_protected_value = 'protected'
public_value = 'public'
@xoxwgys56
xoxwgys56 / myscript.sh
Created August 5, 2021 00:50 — forked from bradtraversy/myscript.sh
Basic Shell Scripting
#! /bin/bash
# ECHO COMMAND
# echo Hello World!
# VARIABLES
# Uppercase by convention
# Letters, numbers, underscores
NAME="Bob"
# echo "My name is $NAME"
@xoxwgys56
xoxwgys56 / myscript.sh
Created August 5, 2021 00:50 — forked from bradtraversy/myscript.sh
Basic Shell Scripting
#! /bin/bash
# ECHO COMMAND
# echo Hello World!
# VARIABLES
# Uppercase by convention
# Letters, numbers, underscores
NAME="Bob"
# echo "My name is $NAME"
@xoxwgys56
xoxwgys56 / reinstall.sh
Created August 5, 2021 00:51
Encounter error about "WorkerError: failed to process image"
#! /bin/bash
# copied from https://github.com/gatsbyjs/gatsby/issues/21515#issuecomment-588416624
rm -rf node_modules
rm package-lock.json
npm cache clear --force
npm install
@xoxwgys56
xoxwgys56 / UnityPostRequestSample.cs
Last active October 25, 2021 02:12
UnityPostRequestSample
using System.Collections;
using UnityEngine;
using UnityEngine.Networking;
using Newtonsoft.Json;
/// <summary>
/// This sample code work properly on Unity2020.3 <br/>
/// </summary>
public class UnityPostRequestSample : MonoBehaviour {
@xoxwgys56
xoxwgys56 / ebook-capture.applescript
Created December 2, 2021 01:14
ebook screen capture
# init for loop
set idx to 0 as number
set maxRange to 110 as number
# init environment value
set basePath to "~/local/screenshots"
set srcPath to basePath & "/temp" as string
set destPath to basePath & "/result" as string
do shell script "mkdir -p " & srcPath
do shell script "mkdir -p " & destPath
set applicationName to "AppName"