Skip to content

Instantly share code, notes, and snippets.

View leo424y's full-sized avatar

Fly Chang leo424y

View GitHub Profile
@zetavg
zetavg / inject-graphiql.js
Last active December 9, 2020 08:33
Inject GraphQL Explorer on any webpage, good for hacking sites that uses cookies for GraphQL requests. Usage: copy the content of inject-graphiql.js, open Devtools on the target page and paste it into the JavaScript Console , modify "put_your_endpoint_here" and hit enter to execute.
function injectGraphiQL(endpoint) {
window.GRAPHQL_ENDPOINT = endpoint;
var newScript = document.createElement('script');
newScript.type = 'text/javascript';
newScript.src = 'https://zetavg.github.io/github-page-for-hosting-things/js/graphiql-for-injection.js';
document.body.innerHTML = '';
document.getElementsByTagName('head')[0].appendChild(newScript);
}
injectGraphiQL(put_your_endpoint_here);
@fernandoaleman
fernandoaleman / mysql2-mojave.md
Last active February 7, 2024 19:19
Install mysql2 on MacOS Mojave

For MacOS Catalina, visit Install mysql2 on MacOS Catalina

Problem

Installing mysql2 gem errors on MacOS Mojave.

Solution

Make sure openssl is installed on Mac via Homebrew.

@mraaroncruz
mraaroncruz / steps.md
Last active May 20, 2024 16:35
Get the Telegram channel ID

To get the channel id

  1. Create your bot with botfather
  2. Make you bot an admin of your channel

Simplest way (via @anhtuank7c)

Go to Telegram web and open a channel, get the ID from -[channel id] from hash in the path

https://web.telegram.org/k/#-9999999999999

switch event.Type {
case linebot.EventTypeBeacon:
log.Println(" Beacon event....")
if b := event.Beacon; b != nil {
ret := fmt.Sprintln("Msg:", string(b.DeviceMessage), " hwid:", b.Hwid, " type:", b.Type)
if _, err = bot.ReplyMessage(event.ReplyToken, linebot.NewTextMessage(ret)).Do(); err != nil {
log.Print(err)
}
}
}
@bogaotory
bogaotory / install_bionic_on_x1c6.md
Last active May 15, 2024 03:25
Install Ubuntu 18.04 on Thinkpad X1 Carbon 6th Generation

Install Ubuntu 18.04 on Thinkpad X1 Carbon 6th Gen/2018

X1C6 Type: 20KG*

Bionic works out of the box on the new 2018 X1 Carbon. The X1C6 is a beautiful laptop, and Bionic is the best Ubuntu yet. Users of all levels of experties/experiences are recommended to try this combination. The purpose of this documentation is to improve the user's experience.

BIOS/UEFI Changes

Following changes are required by the DSDT patch:

  1. Turn off Secure Boot
@ppmotskula
ppmotskula / piactl
Last active September 25, 2023 11:19
piactl -- install, configure and control CNIL's PIA software
#!/bin/bash
ABOUT="piactl 0.10
Copyright (c) 2018-2020 Peeter P. Mõtsküla <peeterpaul@motskula.net>
https://gist.github.com/ppmotskula/4288167460de27d22225e4959c44c6c4
License: MIT License (https://opensource.org/licenses/MIT)
piactl helps you to install, configure and control CNIL's PIA software
(https://www.cnil.fr/en/open-source-pia-software-helps-carry-out-data-protection-impact-assesment)
@hzchirs
hzchirs / circleci2.0-workflow.yml
Last active June 25, 2018 05:49
A CircleCI2.0 workflow config
version: 2.0
references:
container_config: &container_config
docker:
- image: circleci/ruby:2.3.7-node-browsers
environment:
BUNDLE_JOBS: 3
BUNDLE_RETRY: 3
BUNDLE_PATH: vendor/bundle
😀 Grinning Face
😁 Beaming Face With Smiling Eyes
😂 Face With Tears of Joy
🤣 Rolling on the Floor Laughing
😃 Grinning Face With Big Eyes
😄 Grinning Face With Smiling Eyes
😅 Grinning Face With Sweat
😆 Grinning Squinting Face
😉 Winking Face
😊 Smiling Face With Smiling Eyes
@mehdi-farsi
mehdi-farsi / destructuring_assignment.md
Last active May 15, 2018 01:32
Assigning the Rest of an Array to a Variable

When destructuring an array, you can unpack and assign the remaining part of it to a variable using the rest pattern

a = [1, 2, 3]
b, *rest = *a

b    # => 1
rest # => [2, 3]
a    # => [1, 2, 3]
@wildjcrt
wildjcrt / 無架構的暴政文摘.txt
Last active October 9, 2018 15:16
《無架構的暴政》一文重點整理
# 《無架構的暴政》文摘
Digest of "THE TYRANNY of STRUCTURELESSNESS by Jo Freeman a.k.a. Joreen"
http://blog.roodo.com/dkchen10/archives/4728841.html
## tl;dr
任何組織或團體在草創期多半都是無架構,但隨著組織團體規模變大,它們必須要制定出適合自己團體的架構,才能有所作為、確保成員共同參與,同時避免混亂。
* 團體架構的基本原則,可以參考第 6 段。
* 團體內產生一個或多個小群體是正常的,群體之間彼此競爭是健康的,可以參考第 4 段。