Skip to content

Instantly share code, notes, and snippets.

View 8bu's full-sized avatar
🏠
Working from home

Long Nguyen 8bu

🏠
Working from home
View GitHub Profile
@pbojinov
pbojinov / README.md
Last active November 5, 2024 03:29
Two way iframe communication- Check out working example here: http://pbojinov.github.io/iframe-communication/

Two way iframe communication

The main difference between the two pages is the method of sending messages. Recieving messages is the same in both.

Parent

Send messages to iframe using iframeEl.contentWindow.postMessage Recieve messages using window.addEventListener('message')

iframe

@mornir
mornir / nuxt-js-and-gsheet-example.vue
Last active July 26, 2021 16:25 — forked from yann-yinn/nuxt-js-and-gsheet-example.vue
#sheets Nuxt.js vue component to display datas from a google spreadsheet (with google api V4 without oAuth )
<template>
<div id="homepage">
<h1>Les dernières Articles</h1>
<div class="article" v-for="article in articles">
<h2> {{ article.title }} </h2>
<p> {{ article.content }} </p>
</div>
</div>
</template>
@Gkiokan
Gkiokan / autoloadComponents.js
Created May 9, 2019 11:02
Autoload *.vue files as Component and register them
/*
Autoload all current vue files as component and register them by their name.
---
Author: Gkiokan Sali
Date: 2019-05-09
*/
import Vue from 'vue'
const requireContext = require.context('./', false, /.*\.vue$/)
@thgiang
thgiang / gist:e222f036806f126f51a0b75a81956c20
Created March 2, 2021 16:17
Control real chrome browser without notice: "Chrome is being controlled by automated test software"
Random rd = new Random();
string remote_port = rd.Next(9000, 9999).ToString();
// Open real Chrome
Process process = new Process();
process.StartInfo.UseShellExecute = true;
process.StartInfo.FileName = "chrome";
process.StartInfo.Arguments = "https://thgiang.com --load-extension=\"C:\\Users\\Admin\\Desktop\\my_extension\" --disable-gpu --new-window --remote-debugging-port=" + remote_port + " --user-data-dir=\"C:\\Profile\" --proxy-server=\""+proxy+"\" --disable-infobars --disable-notifications --window-size=1366,768"; //--window-position=0,0 --window-size=1200,800 --disable-images
process.Start();
Thread.Sleep(1000);
@darksinge
darksinge / Custom SST Auth Adapter.md
Last active July 17, 2024 05:03
Custom SST Auth Adapter

First, the Auth construct adds an /auth route to the API.

const auth = new Auth(stack, 'auth', {
  authenticator: {
    handler: 'auth.handler',
  },
});

const api = new Api(stack, 'api', {
@rphlmr
rphlmr / helpers.ts
Last active October 28, 2024 17:08
Drizzle ORM, deep sub queries
/* -------------------------------------------------------------------------- */
/* More here; */
/* -------------------------------------------------------------------------- */
// https://gist.github.com/rphlmr/0d1722a794ed5a16da0fdf6652902b15
export function distinctOn<Column extends AnyColumn>(column: Column) {
return sql<Column["_"]["data"]>`distinct on (${column}) ${column}`;
}
export function jsonBuildObject<T extends SelectedFields>(shape: T) {