Skip to content

Instantly share code, notes, and snippets.

@robertgonzales
robertgonzales / Frame.js
Created December 12, 2017 03:03
Use React portals to render inside shadow dom and iframes
class Frame extends Component {
componentDidMount() {
this.iframeHead = this.node.contentDocument.head
this.iframeRoot = this.node.contentDocument.body
this.forceUpdate()
}
render() {
const { children, head, ...rest } = this.props
return (
@tanaikech
tanaikech / submit.md
Created May 20, 2018 04:44
Create Folder Tree of Google Drive using Node.js

Create Folder Tree of Google Drive using Node.js

This is a sample script for retrieving a folder tree using Node.js. In this sample, you can set the top of folder for the folder tree. In generally, the folder tree is created by retrieving folders from the top folder in order. For example, when Google Apps Script is used, the script becomes like this. But when Drive API is used for this situation, if there are a lot of folders in the top folder, a lot of APIs are required to be called. So in this sample, I have tried to create the folder tree by a small number of API calls as possible.

In this sample, in order to be easy to understand the flow, I used Quickstart for Node.js. When you use this sample script, at first, please check the document of Quickstart. And I confirmed that this sample worked at googleapis v30.0.0.

Flow :

  1. Retrieve all folders in Google Drive.
@onsails
onsails / cancelot.sh
Created May 17, 2020 00:54 — forked from siberex/cancelot.sh
Provides automation for cancelling previous ongoing Cloud Builds for the same branch/trigger
#!/usr/bin/env bash
# https://gist.github.com/siberex/bb0540b208019382d08732cc6dd59007
# Provides automation for cancelling Cloud Builds
# Use as a first step to cancel previous builds currently in progress or queued for the same branch name and trigger id.
# Similar to: https://github.com/GoogleCloudPlatform/cloud-builders-community/tree/master/cancelot
# Usage: cancelot.sh --current_build_id $BUILD_ID --branch_name $BRANCH_NAME --same_trigger_only
# Usage within Cloud Build step:
# steps:
@nagavinodcse
nagavinodcse / alpinejs-carousel-using-swiper-tailwindcss.markdown
Created December 25, 2020 15:59
AlpineJS Carousel using Swiper + Tailwindcss
@DarrenSem
DarrenSem / chatgpt-lite.js.cs.md
Last active April 20, 2024 14:23
chatgpt-lite.js equivalent in Csharp is... not nearly as minimal (ChatGPT results, MarkDown) (1st comment = final C# version)

SYSTEM:

You are an expert at JavaScript and C#

. You must format indents using 2 spaces, and you must wrap strings using doublequotes " instead of '.

Let's think step by step.

@martijnvermaat
martijnvermaat / ssh-agent-forwarding-screen.md
Created December 21, 2013 15:06
SSH agent forwarding and screen

SSH agent forwarding and screen

When connecting to a remote server via SSH it is often convenient to use SSH agent forwarding so that you don't need a separate keypair on that server for connecting to further servers.

This is enabled by adding the

ForwardAgent yes

option to any of your Host entries in ~/.ssh/config (or alternatively with the -A option). Don't set this option in a wildcard Host * section since any user on the remote server that can bypass file permissions can now als use keys loaded in your SSH agent. So only use this with hosts you trust.

@hiteshchoudhary
hiteshchoudhary / authors.json
Created November 24, 2023 05:54
Random data to learn aggregation pipelines in MongoDB
[
{
"_id": 100,
"name": "F. Scott Fitzgerald",
"birth_year": 1896
},
{
"_id": 101,
"name": "George Orwell",
"birth_year": 1903
@gangefors
gangefors / Install FreeNAS SCALE on a partition and create a mirror.md
Last active April 20, 2024 14:19
How to install TrueNAS SCALE on a partition instead of the full disk

Install TrueNAS SCALE on a partition instead of the full disk

The TrueNAS installer doesn't have a way to use anything less than the full device. This is usually a waste of resources when installing to a modern NVMe which is usually several hundred of GB. TrueNAS SCALE will use only a few GB for its system files so installing to a 16GB partition would be helpful.

The easiest way to solve this is to modify the installer script before starting the installation process.

@throwaway96
throwaway96 / crashd.md
Last active April 20, 2024 14:16
crashd instructions

News

Important: Dev Mode app patch and alternatives (2024-04-14)

Since approximately 2024-04-02, the latest LG Dev Mode app (2.1.2 in the Content Store) copies and resets the permissions of jail_app.conf/jail_app.conf.sig on every boot. Therefore, jailpatch.sh etc. will no longer work.

If you have webOS 5+ and old enough firmware, WTA (which does not require Dev Mode) will still work.

If you have webOS 4.x, you can try CVE-2023-6319. It is unpatched on the latest (final?) firmware for webOS 4.0 (2018) models.

@CCob
CCob / patchless_amsi.h
Created April 17, 2022 16:18
In-Process Patchless AMSI Bypass
#ifndef PATCHLESS_AMSI_H
#define PATCHLESS_AMSI_H
#include <windows.h>
static const int AMSI_RESULT_CLEAN = 0;
PVOID g_amsiScanBufferPtr = nullptr;
unsigned long long setBits(unsigned long long dw, int lowBit, int bits, unsigned long long newValue) {