Skip to content

Instantly share code, notes, and snippets.

@srugano
srugano / noroot_tcpdump.sh
Created October 9, 2021 12:23
Enable tcpdump for non-root users on Debian/Ubuntu.
#!/usr/bin/env bash
# NOTE: This will let anyone who belongs to the 'pcap' group
# execute 'tcpdump'
# NOTE2: User running the script MUST be a sudoer. It is
# convenient to be able to sudo without a password.
sudo groupadd pcap
sudo usermod -a -G pcap $USER
pragma solidity ^0.5.0;
pragma experimental ABIEncoderV2;
contract Money {
struct People{
uint id;
string name;
uint amount;
}
mapping (uint => People) public peoples;
event votedEvent(uint indexed _candidateId);
@Tset-Noitamotua
Tset-Noitamotua / cucumber_to_robotframework.md
Last active May 13, 2024 11:06
HOW TO translate Cucumber test case into Robot Framework (RF) test case

Cucumber test with examples table

Scenario Outline: eating cucumbers
  Given there are <start> cucumbers
  When I eat <eat> cucumbers
  Then I should have <left> cucumbers

  Examples:
    | start | eat | left |
    |  12   |  5  |  7   |
@quad
quad / 0-modular-errors-with-rusts-thiserror.md
Last active May 13, 2024 11:05
Modular Errors with Rust's thiserror

I've been writing Rust full-time with a small team for over a year now. Throughout, I've lamented the lack of clear best practices around defining error types. One day, I'd love to write up my journey and enumerate the various strategies I've both seen and tried. Today is not that day.

Today, I want to reply to a blog post that almost perfectly summarised my current practice.

Go read it; I'll wait!


@yasirkula
yasirkula / SlicedFilledImage.cs
Last active May 13, 2024 11:00
Combining UI Image's Sliced+Filled features together in Unity
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
#if UNITY_2017_4 || UNITY_2018_2_OR_NEWER
using UnityEngine.U2D;
#endif
using Sprites = UnityEngine.Sprites;
#if UNITY_EDITOR
@LuisEGR
LuisEGR / apis.txt
Last active May 13, 2024 10:58
GCP List of API Services - Updated to Feb 2023
NAME TITLE
abusiveexperiencereport.googleapis.com Abusive Experience Report API
acceleratedmobilepageurl.googleapis.com Accelerated Mobile Pages (AMP) URL API
accessapproval.googleapis.com Access Approval API
accesscontextmanager.googleapis.com Access Context Manager API
actions.googleapis.com Actions API
addressvalidation.googleapis.com Address Validation API
adexchangebuyer-json.googleapis.com Ad Exchange Buyer API
adexchangebuyer.googleapis.com Ad Exchange Buyer API II
@ryanburnette
ryanburnette / Caddyfile
Last active May 13, 2024 10:55
Caddy v2.1+ CORS whitelist
(cors) {
@cors_preflight{args.0} method OPTIONS
@cors{args.0} header Origin {args.0}
handle @cors_preflight{args.0} {
header {
Access-Control-Allow-Origin "{args.0}"
Access-Control-Allow-Methods "GET, POST, PUT, PATCH, DELETE, OPTIONS"
Access-Control-Allow-Headers *
Access-Control-Max-Age "3600"
@KalebNyquist
KalebNyquist / lookupZoteroCollections.js
Created August 8, 2021 21:44
One of my frustrations with Zotero is that there is no easy way to list all the collections in which a file is stored. This is my band-aid of a solution. The code can be run under Tools > Developer > Run Javascript using "Sync" mode.
// Instructions:
// (1) Highlight file of interest.
// (2) Run code in Zotero's JavaScript console (found under Tools > Developer > Run Javascript) in sync mode.
function collections_output() {
zp = Zotero.getActiveZoteroPane()
items = zp.getSelectedItems()
collection_ids = items[0]["_collections"]
collections_cache = Zotero.Collections._objectCache
@slimlime
slimlime / uupdump ConvertConfig.ini explained.md
Created October 8, 2022 22:45
uupdump ConvertConfig.ini explained (convert-UUP, AutoStart, AddUpdates, Cleanup, ResetBase, NetFx3, StartVirtual, wim2esd, wim2swm, SkipISO, SkipWinRE, LCUwinre, UpdtBootFiles, ForceDism, RefESD, SkipEdge, AutoExit, Store_Apps, SkipApps, AppsLevel, CustomList, create_virtual_editions, vAutoStart, vDeleteSource, vPreserve, vwim2esd, vwim2swm, vS…

note: some of the information is posted in comments,
if you'll fork this gist, you'll loose that information,
it is best to just bookmark this one..

WIM

WIM (ESD,SWM) is an image of an OS file system,
it can be mounted, and modified (to some degree) .
there are two possible ways, through DISM or through mounting it directly through an older way, using a driver named imagex (Windows Imaging Utility).
regardless,

terminology