Skip to content

Instantly share code, notes, and snippets.

@TWithers
TWithers / GooglePlacesAutocomplete.html
Last active April 25, 2024 07:34
AlpineJS implementation of Google Places Autocomplete
<div x-data="googlePlacesAutocomplete" class="grid grid-cols-3 gap-2">
<input type="text" x-model="address.address1" x-ref="googleAutocomplete" autocomplete="chrome-off" class="col-span-3 sm:col-span-2 order-1" placeholder="Add&#8204;ress">
<input type="text" x-model="address.address2" placeholder="Apt/Ste" class="col-span-3 sm:col-span-1 order-2">
<input type="text" x-model="address.city" placeholder="Ci&#8204;ty" class="col-span-1" x-bind:class="`order-${order.locality}`">
<select x-model="address.state" placeholder="St‌ate" class="col-span-1 order-4" x-show="isUSA">
<option value="">State</option>
<option value="AL">Alabama</option>
<option value="AK">Alaska</option>
<option value="AZ">Arizona</option>
<option value="AR">Arkansas</option>

Coredump contains stack information as well. If you can use this stack information along with the EBP and EIP register values in the coredump file, you can print the stack trace. I had written a program to do this. You can find the program in the following link.

https://gist.github.com/root42/c979b037f85dc4b2be1f3735afedeb1d

Usage: Compile the above program and give the corefile when you execute it.

   $corestrace core

If you want symbols also to be printed, you do like this: Let's assume the program that generated the core is 'test'.

@xyauhideto
xyauhideto / Weibo_Huati_Check-in.user.js
Last active April 25, 2024 07:33
Weibo Huati Check-in
// ==UserScript==
// @name Weibo Huati Check-in
// @description 超级话题集中签到
// @namespace https://greasyfork.org/users/10290
// @version 0.4.2018053114
// @author xyau
// @match http*://*.weibo.com/*
// @match http*://weibo.com/*
// @icon https://n.sinaimg.cn/photo/5b5e52aa/20160628/supertopic_top_area_big_icon_default.png
// @grant GM_getValue
@Quentin18
Quentin18 / train_test_split.py
Created March 16, 2022 17:26
Split dataset function for PyTorch
from typing import Optional, Tuple
import torch
from torch.utils.data import Dataset, random_split
def train_test_split(
dataset: Dataset,
test_ratio: float,
seed: Optional[int] = None,
@dazeb
dazeb / How to purge ceph installation on Proxmox
Created May 4, 2021 00:10
purge ceph install on proxmox
rm -rf /etc/systemd/system/ceph*
killall -9 ceph-mon ceph-mgr ceph-mds
rm -rf /var/lib/ceph/mon/ /var/lib/ceph/mgr/ /var/lib/ceph/mds/
pveceph purge
apt -y purge ceph-mon ceph-osd ceph-mgr ceph-mds
rm /etc/init.d/ceph
for i in $(apt search ceph | grep installed | awk -F/ '{print $1}'); do apt reinstall $i; done
dpkg-reconfigure ceph-base
dpkg-reconfigure ceph-mds
dpkg-reconfigure ceph-common
@brikeats
brikeats / scribble.py
Last active April 25, 2024 07:29
matplotlib GUI to allow user to scribble on an image
from collections import OrderedDict
import numpy as np
import matplotlib
matplotlib.use('TkAgg')
import warnings;
with warnings.catch_warnings():
warnings.simplefilter("ignore");
import matplotlib.pyplot as plt
from skimage.transform import rescale
@Narsil
Narsil / pure_torch.py
Created November 10, 2022 15:06
Loading a safetensors file with pure torch only
import mmap
import torch
import json
import os
from huggingface_hub import hf_hub_download
def load_file(filename, device):
with open(filename, mode="r", encoding="utf8") as file_obj:
with mmap.mmap(file_obj.fileno(), length=0, access=mmap.ACCESS_READ) as m:
@whitingx
whitingx / meta-tags.md
Created October 5, 2012 16:41 — forked from kevinSuttle/meta-tags.md
Complete List of HTML Meta Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta charset='UTF-8'>
<meta name='keywords' content='your, tags'>
<meta name='description' content='150 words'>
<meta name='subject' content='your website's subject'>
<meta name='copyright' content='company name'>
@kueblert
kueblert / OpenCVMedia.py
Last active April 25, 2024 07:28
aiortc opencv webcam stream
import asyncio
import fractions
import logging
import threading
import time
from typing import Optional, Set, Tuple
import av
from av import AudioFrame, VideoFrame
from aiortc.mediastreams import AUDIO_PTIME, MediaStreamError, MediaStreamTrack
@cmatthewbrooks
cmatthewbrooks / hello_world_plugin.py
Created April 25, 2019 12:41
The simplest possible IDA plugin with multiple actions
##############################################################################
#
# Name: hello_world_plugin.py
# Auth: @cmatthewbrooks
# Desc: A test plugin to learn how to make these work; Specifically, how to
# have multiple actions within the same plugin.
#
# In plain English, IDA will look for the PLUGIN_ENTRY function which
# should return a plugin object. This object can contain all the
# functionality itself, or it can have multiple actions.