Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
# Author: Guillermo Cespedes <dev.dertin@gmail.com>
# pip install requests http barnum
import requests
import http.cookies
import json
from barnum import gen_data
@VassilisPallas
VassilisPallas / FileInformation.java
Created May 17, 2016 22:55
get file information from URI
import android.annotation.TargetApi;
import android.content.ContentUris;
import android.content.Context;
import android.database.Cursor;
import android.net.Uri;
import android.os.Build;
import android.os.Environment;
import android.provider.DocumentsContract;
import android.provider.MediaStore;
import android.provider.OpenableColumns;
@motebaya
motebaya / asmtool.py
Created April 17, 2024 18:02
simple script that help me to RE python bytecode
#!/usr/bin/python3.11
# it help me for RE, @github.com/motebaya
# useless tool :) tools 17.04.2024
from typing import Dict
from xdis import magics
import re, os, types, marshal, argparse
class Asmtool:
def __init__(self) -> None:
@ruanbekker
ruanbekker / tree_style_tab_firefox.md
Created November 28, 2019 06:18
Hide Native Tabs with Tree Style Tabs for Firefox
— Да?
— Алё!
— Да да?
— Ну как там с деньгами?
— А?
— Как с деньгами-то там?
— Чё с деньгами?
— Чё?
— Куда ты звонишь?
/* UTILS AND CONSTANTS*/
const SPEED_MULTIPLIER = 1.852;
const DISTANCE_MULTIPLIER = 111.045;
const SETTINGS = {
"default_object_online_timeout": 5
,"valid_by_avg_speed": false
,"min_moving_speed": 6
,"addon.device_tracker_app_login": false
@laytan
laytan / odin.py
Created April 25, 2024 17:40
LLDB script to visualise Odin slices, maps, and strings
import lldb
def is_slice_type(t, internal_dict):
return t.name.startswith("[]") or t.name.startswith("[dynamic]")
class SliceChildProvider:
def __init__(self, val, dict):
self.val = val
def num_children(self):
@WetHat
WetHat / PY-CircleFitting.ipynb
Last active May 6, 2024 13:34
Fitting a Circle to a 2d Point Cloud by Linear Least Squares
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mpneuried
mpneuried / postgres_add_json_sub_array_unique.sql
Last active May 6, 2024 13:32
Add and remove elements unique to a Postgres jsonb sub key: Short a Set implemetation
UPDATE public.mytable SET
jsonfieldname = jsonb_set( jsonfieldname, '{json_obj_key}', array_to_json(
ARRAY(
SELECT DISTINCT( UNNEST( ARRAY(
SELECT json_array_elements_text( COALESCE( jsonfieldname::json->'json_obj_key', '[]' ) )
) || ARRAY['Element to add'] ) )
)
)::jsonb )
WHERE id = 23
RETURNING *;
@BandarHL
BandarHL / fixYouTubeLogin.m
Last active May 6, 2024 13:31
Fix YouTube keychain
static NSString *accessGroupID() {
NSDictionary *query = [NSDictionary dictionaryWithObjectsAndKeys:
(__bridge NSString *)kSecClassGenericPassword, (__bridge NSString *)kSecClass,
@"bundleSeedID", kSecAttrAccount,
@"", kSecAttrService,
(id)kCFBooleanTrue, kSecReturnAttributes,
nil];
CFDictionaryRef result = nil;
OSStatus status = SecItemCopyMatching((__bridge CFDictionaryRef)query, (CFTypeRef *)&result);
if (status == errSecItemNotFound)