Skip to content

Instantly share code, notes, and snippets.

View gokaybiz's full-sized avatar
🌪️
Focusing

gokaybiz

🌪️
Focusing
View GitHub Profile
@aungmyatmoethegreat
aungmyatmoethegreat / useFetchApi.js
Created May 28, 2022 07:11
Using custom hook/composable to fetch data in nuxt3
/**
* It takes a URL and options, and returns a response object
* @param url - The URL to fetch.
* @param [options] - The options object that will be passed to the fetch function.
* @returns The return value of the useFetch hook.
*/
import {useFetch, useRuntimeConfig} from "nuxt/app";
export default function useFetchApi(url, options = {}) {
const config = useRuntimeConfig();
@nash403
nash403 / SvgFragment.vue
Created June 30, 2021 09:13
Vue component that render raw SVG content like with `v-html` but without the need of an extra root element.
<script lang="ts">
import { VNodeData } from 'vue'
import { defineComponent } from '@vue/composition-api'
/**
* Use this component to render raw SVG content
* without the need to use the `v-html` directive
* which requires a parent node in Vue 2.x (ex: `<div v-html="..."></div>`).
* `<NSvgFragment :src="..." />` will directly render the svg tag with its content.
* */
@senderle
senderle / hand-modify-pdf.md
Created September 23, 2020 15:03
So you want to modify the text of a PDF by hand

So you want to modify the text of a PDF by hand...

If you, like me, resent every dollar spent on commercial PDF tools, you might want to know how to change the text content of a PDF without having to pay for Adobe Acrobat or another PDF tool. I didn't see an obvious open-source tool that lets you dig into PDF internals, but I did discover a few useful facts about how PDFs are structured that I think may prove useful to others (or myself) in the future. They are recorded here. They are surely not universally applicable --
the PDF standard is truly Byzantine -- but they worked for my case.

@hunsiri
hunsiri / my.cnf
Created June 26, 2020 03:58 — forked from fevangelou/my.cnf
Optimized my.cnf configuration for MySQL/MariaSQL (on Ubuntu, CentOS etc. servers)
# Optimized my.cnf configuration for MySQL/MariaSQL
#
# by Fotis Evangelou, developer of Engintron (engintron.com)
#
# ~ Updated January 2020 ~
#
#
# The settings provided below are a starting point for a 2GB - 4GB RAM server with 2-4 CPU cores.
# If you have different resources available you should adjust accordingly to save CPU, RAM & disk I/O usage.
#
@jevakallio
jevakallio / readme.md
Last active April 22, 2024 15:51
`adb pull` from app data directory without root access

TL;DR;

com.package.name is your app identifier, and the file path is relative to the app user's home directory, e.g. '/data/user/0/com.package.name.

adb shell run-as com.package.name cp relative/path/file.ext /sdcard
adb pull /sdcard/file.ext

See long explanation below.

@AssisrMatheus
AssisrMatheus / #vscode-setup.md
Last active January 7, 2024 14:06
My optimized Visual Studio Code setup
#! /usr/bin/python
# by pts@fazekas.hu at Tue Oct 11 13:12:47 CEST 2016
""":" #megapubdl: Download public files from MEGA (mega.nz).
type python2.7 >/dev/null 2>&1 && exec python2.7 -- "$0" ${1+"$@"}
type python2.6 >/dev/null 2>&1 && exec python2.6 -- "$0" ${1+"$@"}
type python2.5 >/dev/null 2>&1 && exec python2.5 -- "$0" ${1+"$@"}
type python2.4 >/dev/null 2>&1 && exec python2.4 -- "$0" ${1+"$@"}
exec python -- ${1+"$@"}; exit 1
@tegansnyder
tegansnyder / Preventing-Puppeteer-Detection.md
Created February 23, 2018 02:41
Preventing Puppeteer Detection

I’m looking for any tips or tricks for making chrome headless mode less detectable. Here is what I’ve done so far:

Set my args as follows:

const run = (async () => {

    const args = [
        '--no-sandbox',
        '--disable-setuid-sandbox',
        '--disable-infobars',
@asukakenji
asukakenji / 0-go-os-arch.md
Last active April 24, 2024 06:51
Go (Golang) GOOS and GOARCH

Go (Golang) GOOS and GOARCH

All of the following information is based on go version go1.17.1 darwin/amd64.

GOOS Values

GOOS Out of the Box
aix
android
@asukakenji
asukakenji / try_shiny_2.go
Last active February 17, 2020 01:19
Shortest GUI program written in Golang. It displays a window and exits when the "close" button of the window is clicked.
// Shortest GUI program written in Golang.
// It displays a window and exits when the "close" button of the window is clicked.
package main
import (
"golang.org/x/exp/shiny/driver"
"golang.org/x/exp/shiny/screen"
// Despite that the package names have a "mobile" prefix,
// these packages works on desktop.