Skip to content

Instantly share code, notes, and snippets.

@jnunemaker
jnunemaker / initializer.rb
Created December 3, 2021 15:16
github-ds postgres version of GitHub::KV
module BoxOutSports
def self.kv
@kv ||= KeyValueJsonb.new(use_local_time: Rails.env.test?) {
ActiveRecord::Base.connection
}
end
end
@phantinuss
phantinuss / grep-sysmon-win-eventlog-example.ps1
Last active April 10, 2025 04:10
How to grep Windows Event Log / Sysmon
Get-WinEvent -LogName Microsoft-Windows-Sysmon/Operational | where { $_.TimeCreated -ge (Get-Date) - (New-TimeSpan -Day 1) } | where Id -EQ 1 | where Message -match "rundll32" | Format-List -Property Message | Out-String -Stream | Select-String -Pattern " CommandLine:"
@lexrus
lexrus / delete_all_imessage_conversations.applescript
Last active January 26, 2024 16:12
Delete all iMessage conversations. Compatible with macOS Monterey. Please check Reduce motion before launch this apple script.
# System Preferences -> Accessibility -> Display -> Reduce motion
tell application "Messages" to activate
tell application "Messages"
set chatCount to (count of chats)
end tell
tell application "System Events"
tell process "Messages"
@chen7897499
chen7897499 / btcd.conf
Last active December 3, 2021 08:22
communicate with btcd node
[Application Options]
datadir=./btcd/data
listen=127.0.0.1:9333
simnet=1
nobanning=1
debuglevel=debug
@dylan-albertazzi
dylan-albertazzi / useEffect-Async-TheRightWay.js
Created July 20, 2021 02:04
Stop useEffect Hook React re-render multiple times with Async Await | Dylan Albertazzi YouTube
import React, { useState, useEffect } from "react";
function App() {
const [value, setValue] = useState("");
//Waits for a period of time then resolves
function timeout(ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
}
@Areso
Areso / dockergrep.sh
Created June 21, 2021 12:41 — forked from roylee0704/dockergrep.sh
how to grep docker log
docker logs nginx 2>&1 | grep "127."
# ref: http://stackoverflow.com/questions/34724980/finding-a-string-in-docker-logs-of-container
@LeeDDHH
LeeDDHH / escape-async-await-try-catch-hell.md
Created June 10, 2021 04:11
async-awaitの中のtry-catch地獄を回避するための方法

基本的な async-await の書き方

const asynchronousCode = async () => {
  const a = await step1();
  const b = await step2(a);
  const c = await step3(b);
  
  return a + b + c;
@chadmuro
chadmuro / TableSkeleton.js
Last active March 13, 2023 03:09
Table Body Skeleton
import React, { useState, useEffect } from 'react';
import { withStyles, makeStyles } from '@material-ui/core/styles';
import Table from '@material-ui/core/Table';
import TableBody from '@material-ui/core/TableBody';
import TableCell from '@material-ui/core/TableCell';
import TableContainer from '@material-ui/core/TableContainer';
import TableHead from '@material-ui/core/TableHead';
import TableRow from '@material-ui/core/TableRow';
import Skeleton from '@material-ui/lab/Skeleton';
// server.js
// BASE SETUP
// =============================================================================
const EthereumTx = require('ethereumjs-tx').Transaction;
var BigNumber = require('bignumber.js');
var express = require('express'); // call express
var app = express(); // define our app using express
var bodyParser = require('body-parser');
@stek29
stek29 / extract_telegram_macos.ipynb
Last active October 7, 2025 22:51
Extract Telegram messages from db_sqlite PostBox – made for Telegram for macOS, but should work with Telegram for iOS
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.