Skip to content

Instantly share code, notes, and snippets.

View skyend's full-sized avatar
๐Ÿข
Slow and pierce the world

Skyend skyend

๐Ÿข
Slow and pierce the world
View GitHub Profile
@skyend
skyend / node-modules-recursive-packer.go
Last active November 14, 2023 13:08
node_modules Recursive packer
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"os"
"os/exec"
"path"
"sync"
@skyend
skyend / RecordAudio.swift
Created January 9, 2023 13:52 — forked from hotpaw2/RecordAudio.swift
Swift Audio Recording class. Reads buffers of input samples from the microphone using the iOS RemoteIO Audio Unit API
//
// RecordAudio.swift
//
// This is a Swift class (updated for Swift 5)
// that uses the iOS RemoteIO Audio Unit
// to record audio input samples,
// (should be instantiated as a singleton object.)
//
// Created by Ronald Nicholson on 10/21/16.
// Copyright ยฉ 2017,2019 HotPaw Productions. All rights reserved.
@skyend
skyend / httpGzipTest.go
Created February 24, 2021 16:07
Golang decompress gzip of response came from http.request
func Request() {
client := &http.Client{
//CheckRedirect: redirect
Transport: &http.Transport{DisableCompression: false},
}
req, err := http.NewRequest("GET","https://jsonplaceholder.typicode.com/todos/1", nil)
req.Header.Add("Accept-Encoding", "gzip, deflate")
if err != nil {
fmt.Println("Failed to create new request.")
@skyend
skyend / ss
Created February 22, 2021 06:31
/per/mbo-reg/goal-hists?coId=1&buId=1&evalId=20&goalDgr=1&goalId=6
@skyend
skyend / cloudflare.sh
Created May 17, 2020 09:09 — forked from Manouchehri/cloudflare.sh
Allow CloudFlare only
# Source:
# https://www.cloudflare.com/ips
# https://support.cloudflare.com/hc/en-us/articles/200169166-How-do-I-whitelist-CloudFlare-s-IP-addresses-in-iptables-
for i in `curl https://www.cloudflare.com/ips-v4`; do iptables -I INPUT -p tcp -m multiport --dports http,https -s $i -j ACCEPT; done
for i in `curl https://www.cloudflare.com/ips-v6`; do ip6tables -I INPUT -p tcp -m multiport --dports http,https -s $i -j ACCEPT; done
# Avoid racking up billing/attacks
# WARNING: If you get attacked and CloudFlare drops you, your site(s) will be unreachable.
iptables -A INPUT -p tcp -m multiport --dports http,https -j DROP
@skyend
skyend / gist:2e61a734d2a14198bd15781bf45a61f9
Last active June 21, 2018 17:46
vmware workstation player error! at windows 10 [solved]

์Šˆ๋ฐค ์™œ์•ˆ๋˜๋Š”๊ฑฐ์•ผ

์œˆ๋„์šฐ 10์— VMWare workstation player ์„ค์น˜ํ•˜๊ณ  ์“ฐ๋‹ค๊ฐ€ vm์„ ๊ป๋‹ค๊ฐ€ ์ผฐ๋”๋‹ˆ ์•„๋ž˜์™€ ๊ฐ™์€ ์—๋Ÿฌ ๋ฉ”์‹œ์ง€์™€ ํ•จ๊ป˜ ๋‚˜๋ฅผ ํ—ฌํŒŒํ‹ฐ๋กœ ์ดˆ๋Œ€ํ–ˆ๋‹ค.

๋ฌธ์ œ์˜ ์‹œ์ž‘ ์—๋Ÿฌ

VMware Player and Device/Credential Guard are not compatible. 
VMware Player can be run after disabling Device/Credential Guard. 
Please visit http://www.vmware.com/go/turnoff_CG_DG for more details.
@skyend
skyend / chain_detect.js
Created May 24, 2018 11:10
Chained Characters
var a = "efgaaa123";
var chain = 0;
var chains = [];
var prev = -1, prev2, current;
for(let i= 0; i < a.length; i++ ){
current = a.charCodeAt(i);
if( prev + 1 == current && prev2 + 1 == prev ){
chain ++;
chains.push(String.fromCharCode.apply(null, [prev2, prev, current]))
@skyend
skyend / gist:d086b0c5b5f5c0b290a52f2a663c47f9
Created May 14, 2018 16:13
์–ด๊ถŒ์ถ”์ถœ
HTML
<table width="100%" border="1" style="background-color: #CCCCCC;" responsive="true" summary="table"><tbody id='tbody'><tr responsive="true"> <th scope="col"> <b>๊ตญ๊ฐ€</b> </th> <th scope="col"> <b>์–ธ์–ด</b> </th> <th scope="col"> <b>์ฝ”๋“œ</b> </th> <th scope="col"> <b>์–ธ์–ด ๊ฐ’</b> </th> </tr><tr> <td data-th=" ๊ตญ๊ฐ€ "> <p>์˜ค์ŠคํŠธ๋ ˆ์ผ๋ฆฌ์•„</p> </td> <td data-th=" ์–ธ์–ด "> <p>์˜์–ด</p> </td> <td data-th=" ์ฝ”๋“œ "> <p>en-au</p> </td> <td data-th=" ์–ธ์–ด ๊ฐ’ "> <p>3081</p> </td> </tr><tr> <td data-th=" ๊ตญ๊ฐ€ "> <p>์˜ค์ŠคํŠธ๋ฆฌ์•„</p> </td> <td data-th=" ์–ธ์–ด "> <p>๋…์ผ์–ด</p> </td> <td data-th=" ์ฝ”๋“œ "> <p>de-at</p> </td> <td data-th=" ์–ธ์–ด ๊ฐ’ "> <p>3079</p> </td> </tr><tr> <td data-th=" ๊ตญ๊ฐ€ "> <p>๋ฒจ๊ธฐ์—(๋„ค๋œ๋ž€๋“œ์–ด)</p> </td> <td data-th=" ์–ธ์–ด "> <p>๋„ค๋œ๋ž€๋“œ์–ด</p> </td> <td data-th=" ์ฝ”๋“œ "> <p>nl-be</p> </td> <td data-th=" ์–ธ์–ด ๊ฐ’ "> <p>2067</p> </td> </tr><tr> <td data-th=" ๊ตญ๊ฐ€ "> <p>๋ฒจ๊ธฐ์—(ํ”„๋ž‘์Šค์–ด)</p> </td> <td data-th=" ์–ธ์–ด "> <p>ํ”„๋ž‘์Šค์–ด</p> </td> <td data-th=" ์ฝ”๋“œ "> <p>fr-be </p> </td> <td data-th=" ์–ธ์–ด ๊ฐ’ "> <p>2060</p> </td> </tr><tr> <td data-th=" ๊ตญ๊ฐ€ "> <p>๋ธŒ๋ผ์งˆ</p> </td> <td data-th=" ์–ธ์–ด "> <
@skyend
skyend / Android ๊ฐœ๋ฐœ์„ ์ˆ˜์ฃผํ•ด์„œ Kotlin์„ ์ œ๋Œ€๋กœ ์จ๋ดค๋”๋‹ˆ ์ตœ๊ณ ์˜€๋‹ค.md
Created April 10, 2018 16:09
Android ๊ฐœ๋ฐœ์„ ์ˆ˜์ฃผํ•ด์„œ Kotlin์„ ์ œ๋Œ€๋กœ ์จ๋ดค๋”๋‹ˆ ์ตœ๊ณ ์˜€๋‹ค๋ผ๋Š” ๊ธ€์„ ๋ฒˆ์—ญํ–ˆ์Šต๋‹ˆ๋‹ค.

Android ๊ฐœ๋ฐœ์„ ์ˆ˜์ฃผํ•ด์„œ Kotlin์„ ์ œ๋Œ€๋กœ ์จ๋ดค๋”๋‹ˆ ์ตœ๊ณ ์˜€๋‹ค.

๊ธ€์— ์•ž์„œ

์ด ๊ธ€์€ ์ผ๋ณธ์˜ omochimetaru๋‹˜์ด Qiita์— ์˜ฌ๋ฆฐ Android ๊ฐœ๋ฐœ์„ ์ˆ˜์ฃผํ•ด์„œ Kotlin์„ ์ œ๋Œ€๋กœ ์จ๋ดค๋”๋‹ˆ ์ตœ๊ณ ์˜€๋‹ค.๋ผ๋Š” ๊ธ€์„ ๋ฒˆ์—ญํ•ด์„œ ๋งŒ๋“ค์—ˆ์Šต๋‹ˆ๋‹ค. ๋ฒˆ์—ญ์„ ํ”์พŒํžˆ ํ—ˆ๋ฝํ•ด์ฃผ์‹  omochimetaru๋‹˜๊ป˜ ๊ฐ์‚ฌํ•˜๋‹ค๋Š” ๋ง์”€ ๋“œ๋ฆฝ๋‹ˆ๋‹ค. ๋˜ํ•œ ๊ธ€์—์„œ ํ•œ๊ตญ์—์„œ๋Š” ์“ฐ์ด์ง€ ์•Š๋Š” ํ‘œํ˜„๋“ค ๋“ฑ์— ๋Œ€ํ•ด์„œ๋Š” ์˜์—ญ์ด ์„ž์—ฌ์žˆ์Šต๋‹ˆ๋‹ค. ์ด ์  ์–‘ํ•ด ๋ถ€ํƒ๋“œ๋ฆฝ๋‹ˆ๋‹ค. ๋Šฆ์€ ์‹œ๊ฐ„๊นŒ์ง€ ์˜ค์—ญ์„ ์ฐพ๊ณ  ๋ฒˆ์—ญ์˜ ์งˆ์„ ๋†’์ด๋Š”๋ฐ ๋งŽ์€ ๋„์›€์„ ์ฃผ์‹œ๊ณ  ์˜คํžˆ๋ ค ์ €๋ณด๋‹ค ๋งŽ์ด ๊ณ ์ƒํ•ด์ฃผ์‹  ์ด์ƒํ•œ๋ชจ์ž„์˜ pluulove๋‹˜, chiyodad๋‹˜, lemonade๋‹˜๊ป˜๋„ ๊ฐ์‚ฌํ•˜๋‹ค๋Š” ๋ง์”€ ๋“œ๋ฆฝ๋‹ˆ๋‹ค. ์ฝ์–ด์ฃผ์…”์„œ ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค.

Kotlin์„ ์‹ค๋ฌด ํ”„๋กœ์ ํŠธ์—์„œ ์‚ฌ์šฉํ–ˆ์Šต๋‹ˆ๋‹ค.

๋ฉฐ์น  ์ „, ์ œ๊ฐ€ ์†Œ์†๋œ Qoncept์—์„œ "๋ฆฌ์–ผ ์ˆ ๋ž˜์žก๊ธฐ"xํ›„์ง€ํ ํ•˜์ด๋žœ๋“œ ๊ฑฐ๋Œ€ ์œ ์›์ง€์—์„œ๋ถ€ํ„ฐ์˜ ๋„์ฃผ๋ฅผ ๊ฐœ๋ฐœํ–ˆ๊ณ  ์ถœ์‹œํ–ˆ์Šต๋‹ˆ๋‹ค.

@skyend
skyend / gist:cfc26761ebb3a357cbe9
Created July 11, 2014 14:49
docker service script for systemd
[Unit]
Description=Docker Mongodb image
After=mongo.service
[Service]
ExecStart=/bin/bash -c '/usr/bin/docker run -v /data/mongo:/data/mongo --name mongo -p 27017:27017 oym:mongo'
ExecStop=/bin/bash -c '/usr/bin/docker stop mongo && /usr/bin/docker rm mongo'
[Install]
WantedBy=multi-user.target