Skip to content

Instantly share code, notes, and snippets.

@alexanderlerch
alexanderlerch / data-sets.md
Last active May 3, 2024 14:11
list of MIR datasets
dataset meta data contents with audio
200DrumMachines 7371 one-shots yes
AAM onsets, pitches, instruments, melody instrument, keys, chords, tempo, beats 3000 (artificial) tracks yes
ACM_MIRUM tempo 1410 excerpts (60s) yes
ACPAS aligned audio and scores 2189 performances of 497 scores downloadable
AcousticBrainz-Genre 15-31 genres with 265-745 subgenres audio features for over 2000000 songs no
@EthanArbuckle
EthanArbuckle / main.m
Created March 1, 2023 12:41
control permissions of apps installed in the ios simulator
//
// main.m
// permission-changer
//
// Created by Ethan Arbuckle on 3/1/23.
//
#import <Foundation/Foundation.h>
#include <dlfcn.h>
#include <objc/runtime.h>
@gokatz
gokatz / deploy.js
Last active May 3, 2024 14:09
script to automate chrome extension deployment
const zipFolder = require('zip-folder');
const fs = require('fs');
let folder = 'dist';
let zipName = 'extension.zip';
// credentials and IDs from gitlab-ci.yml file (your appropriate config file)
let REFRESH_TOKEN = process.env.REFRESH_TOKEN;
let EXTENSION_ID = process.env.EXTENSION_ID;
let CLIENT_SECRET = process.env.CLIENT_SECRET;
@marijn
marijn / README.markdown
Last active May 3, 2024 14:09
List of nationalities in YAML, CSV and TXT format

List of nationalities

It's time someone compiled a list of nationalities to use within a web application. This gist attempts to make a first move at that.

List of countries

I've also compiled a list of countries

@diego3g
diego3g / settings.json
Last active May 3, 2024 14:09
VSCode Settings (Updated)
{
"workbench.startupEditor": "newUntitledFile",
"editor.fontSize": 14,
"editor.lineHeight": 1.8,
"javascript.suggest.autoImports": true,
"javascript.updateImportsOnFileMove.enabled": "always",
"editor.rulers": [80, 120],
"extensions.ignoreRecommendations": true,
"typescript.tsserver.log": "off",
"files.associations": {
@Pymmdrza
Pymmdrza / R2cloudflare_V1_6.py
Last active May 3, 2024 14:07
R2 Cloudflare Upload file with boto in python
# https://gist.github.com/Pymmdrza/3e3f30b16f4009503e7572b914fd200d
# install package's from requirements.txt
# Windows : pip install -r requirements.txt
# Linux : pip3 install -r requirements.txt
import os
import boto3
from tqdm import tqdm
from colorthon import Colors as Fore
def get_user_input(prompt, example=''):
@ajib6ept
ajib6ept / client_ip.py
Last active May 3, 2024 14:07
Как получить IP адресс пользователя в Django
def get_client_ip(request):
x_forwarded_for = request.META.get('HTTP_X_FORWARDED_FOR')
if x_forwarded_for:
ip = x_forwarded_for.split(',')[0]
else:
ip = request.META.get('REMOTE_ADDR')
return ip
#(c) http://stackoverflow.com/questions/4581789/how-do-i-get-user-ip-address-in-django
@Zhuinden
Zhuinden / BasicTextFieldWithCursorAtEnd.kt
Last active May 3, 2024 14:07
A Compose TextField that initializes the cursor position at the end of the text, rather than the start, when focused without tapping the TextField manually.
/*
* Copyright 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@miyouzi
miyouzi / nginx_with_socat.md
Last active May 3, 2024 14:05
配置 Nginx 通过代理访问反代目标(B站代理解析)

简介

众所周知,有些服务存在着地区限制,我们可以通过在服务所属地区搭建代理服务来解决,其中在其服务范围内部署 Nginx 反代服务是个有效且流行的办法。

但如果区域很多,每个区域都布置一台服务器那成本会有些高昂且利用率很低,通常我们只是需要该地区的 IP 而已,如果手头上正好有这些地区的代理池的话,那我们就可以只用一台服务器部署Nginx反向代理结合服务所在地区的代理实现相同的效果。

本文着重介绍的就是如何让 Nginx 通过代理访问上游服务。(即 proxy_pass 的目标)

详细图文说明可以参见《Nginx 如何与 Socat 配合使用》

PS:本配置兼容 《哔哩漫游》《解除b站区域限制》

GitHub Search Syntax for Finding API Keys/Secrets/Tokens

As a security professional, it is important to conduct a thorough reconnaissance. With the increasing use of APIs nowadays, it has become paramount to keep access tokens and other API-related secrets secure in order to prevent leaks. However, despite technological advances, human error remains a factor, and many developers still unknowingly hardcode their API secrets into source code and commit them to public repositories. GitHub, being a widely popular platform for public code repositories, may inadvertently host such leaked secrets. To help identify these vulnerabilities, I have created a comprehensive search list using powerful search syntax that enables the search of thousands of leaked keys and secrets in a single search.

Search Syntax:

(path:*.{File_extension1} OR path:*.{File_extension-N}) AND ({Keyname1} OR {Keyname-N}) AND (({Signature/pattern1} OR {Signature/pattern-N}) AND ({PlatformTag1} OR {PlatformTag-N}))

Examples:

**1.