Skip to content

Instantly share code, notes, and snippets.

View nowavailable's full-sized avatar

Taiga Tsutsumi nowavailable

  • Tokyo
View GitHub Profile
@LHazy
LHazy / find_shai_hulud_js.ps1
Last active September 22, 2025 01:52
Shai-Hulud Supply Chain Attack で配布された悪性ファイル (bundle.js) の検索スクリプト
# !!!注意!!!:
# このスクリプトはCドライブ配下のファイル・フォルダを探索するため「システムに負荷がかかる場合があります」
# 実行は自己責任でお願いします。
# 使い方:
# powershell -ExecutionPolicy Bypass -File .\Scan-Bundle.ps1 <start_directory>
param(
[Parameter(Mandatory = $true)]
[string]$TargetDirectory
)
@palkan
palkan / 00_Readme.md
Last active July 16, 2022 06:50
graphql-ruby fragment caching

PoC: GraphQL Ruby fragment caching

This example demonstrates how we can cache the response fragments in graphql-ruby.

Existing solutions only allow caching resolved values but not all the GraphQL machinery (validation, coercion, whatever).

Caching response parts (in case of Ruby, sub-Hashes) is much more efficient.

Benchmarks

@kawasima
kawasima / 00_architecture_corpus.md
Last active October 5, 2023 07:26
アーキテクチャ大全 (未完) のサンプル

アーキテクチャ大全のサンプル

これくらいの実例とともにソリューション選択できるようにしていきたい。

@ultrafunkamsterdam
ultrafunkamsterdam / Python 3.6 Asyncio multiple async event loops in multiple threads. Running and shutting down gracefully.py
Last active December 16, 2023 01:33
Python 3.6 Asyncio multiple async event loops in multiple threads. Running and shutting down gracefully
import asyncio
import threading
import random
import time
async def coro(n, name):
for i in range(n):
sleep_time = random.uniform(.3, .7)
print('coro({0}) [{1}/{2}] -> sleep_time {3:.2f}'.format(name, i, n, sleep_time), flush=True)
await asyncio.sleep(sleep_time)
@digitalkaoz
digitalkaoz / index.js
Created December 20, 2017 21:32
gatsby in aws lambda
const AWS = require("aws-sdk");
const {link} = require("linkfs");
const mock = require('mock-require');
const fs = require('fs');
const tmpDir = require('os').tmpdir();
exports.handler = (event, context) => {
rewriteFs();
invokeGatsby(context);
}
@maxivak
maxivak / __readme.md
Last active September 17, 2025 10:38
Building Docker image with Packer and provisioning with Ansible

Building Docker image with Packer and provisioning with Ansible

Overview

Packer

  • Packer is used to build image from a base image, perform provisions and store (commit) the final image.

  • We use provisioners and Packer templates to do the actual work to create the final image.

  • We use Ansible for provisioning.

@icoxfog417
icoxfog417 / asyncio_examples.py
Last active May 20, 2019 12:35
asyncio samples
import asyncio
import concurrent.futures
import requests
Seconds = [
("first", 5),
("second", 0),
("third", 3)
]
@jeffdonthemic
jeffdonthemic / apex-crud-fls.txt
Last active April 18, 2024 16:52
Simple Apex Controller with CRUD and FLS
This simple controller (without CRUD and FLS) ...
public with sharing class AccountController {
@AuraEnabled
public static List<Account> findAll() {
return [SELECT id, name, Location__Latitude__s, Location__Longitude__s
FROM Account
WHERE Location__Latitude__s != NULL AND Location__Longitude__s != NULL
LIMIT 50];
@Fingel
Fingel / pyinotifyasyncio.py
Created September 25, 2015 02:10
Using pyinotify with python 3 asyncio
import pyinotify
import asyncio
class EventHandler(pyinotify.ProcessEvent):
def process_IN_CREATE(self, event):
if not event.dir:
print("Got new file: ", event.pathname)
wm = pyinotify.WatchManager() # Watch Manager
@Ambroos
Ambroos / Ad.jsx
Created April 29, 2015 14:18
Loading synchronous / document.write-ing ads asynchronously against their will in a React component
import React from 'react';
import $script from 'scriptjs';
require('postscribe/htmlParser/htmlParser.js'); // This is required for postScribe, postScribe is a bit annoying.
const postscribe = require('exports?postscribe!postscribe'); // Needs webpack exports-loader! Otherwise, just require it and use window.postscribe.
// This GlobalAdCodePromise is a simple promise that uses script.js to load a javascript file and then resolve.
const GlobalAdCodePromise = new Promise((resolve) => {
setTimeout(() => {
$script('http://annoying.adprovider.com/ad.js', () => {