Skip to content

Instantly share code, notes, and snippets.

@bf4648
bf4648 / PROPOSITIONAL_SYMBOLS_LATEX_OBSIDIAN.md
Created November 21, 2023 15:32 — forked from zudsniper/PROPOSITIONAL_SYMBOLS_LATEX_OBSIDIAN.md
📋 Propositional Logic symbols & their LaTeX formulas specifically for Obsidian flavor Markdown

Certainly! Obsidian is a popular note-taking application that supports Markdown with LaTeX integration for mathematical notation. When using LaTeX in Obsidian's Markdown flavor, you typically enclose the LaTeX code within double dollar signs $$...$$ for block math and single dollar signs $...$ for inline math.

Here's an exhaustive list of the symbols for propositional logic and their formulas specifically formatted for Obsidian flavor Markdown:

  1. Conjunction (AND)

    • Symbol: ∧
    • Obsidian Markdown: $\land$ or $\wedge$
  2. Disjunction (OR)

  • Symbol: ∨
@bf4648
bf4648 / cryptography.md
Created January 26, 2023 17:26 — forked from gauravchl/cryptography.md
Useful commands for cryptography need

sha256 of a file

openssl sha -sha256 ws-test.js

sha256 of string

echo -n 'your string' | opsnssl sha -sha256

Random password 192 character

openssl rand 192

Random password in file

@bf4648
bf4648 / venv.fish
Created October 10, 2022 16:31 — forked from tommyip/venv.fish
Automatically activate/deactivate virtualenv in fish shell
# Based on https://gist.github.com/bastibe/c0950e463ffdfdfada7adf149ae77c6f
# Changes:
# * Instead of overriding cd, we detect directory change. This allows the script to work
# for other means of cd, such as z.
# * Update syntax to work with new versions of fish.
function __auto_source_venv --on-variable PWD --description "Activate/Deactivate virtualenv on directory change"
status --is-command-substitution; and return
# Check if we are inside a git directory
@bf4648
bf4648 / venv.fish
Created October 10, 2022 16:31 — forked from tommyip/venv.fish
Automatically activate/deactivate virtualenv in fish shell
# Based on https://gist.github.com/bastibe/c0950e463ffdfdfada7adf149ae77c6f
# Changes:
# * Instead of overriding cd, we detect directory change. This allows the script to work
# for other means of cd, such as z.
# * Update syntax to work with new versions of fish.
function __auto_source_venv --on-variable PWD --description "Activate/Deactivate virtualenv on directory change"
status --is-command-substitution; and return
# Check if we are inside a git directory
@bf4648
bf4648 / macOS_SytemPrefs.md
Created September 16, 2022 14:25 — forked from rmcdongit/macOS_SytemPrefs.md
Apple System Preferences URL Schemes

macOS 10.15 System Preference Panes

Below are a list of System Preference pane URLs and paths that can be accessed with scripting to assist users with enabling macOS security settings without having to walk them through launching System Preferences, finding panes, and scrolling to settings. Not all panes have an accessible anchor and some are OS specific.

To find the Pane ID of a specific pane, open the System Preferences app and select the desired Preference Pane. With the pane selected, open the ScriptEditor.app and run the following script to copy the current Pane ID to your clipboard and display any available anchors:

tell application "System Preferences"
	set CurrentPane to the id of the current pane
	set the clipboard to CurrentPane
@bf4648
bf4648 / gist:24f4a14cf9f0c9447d1f8e12055ef57c
Created June 3, 2022 17:47 — forked from tyru/gist:984296
s:substring() and s:substring_once() in vital.vim
" Substitute a:from => a:to by string.
" To substitute by pattern, use substitute() instead.
function! s:substring(str, from, to)
if a:str ==# '' || a:from ==# ''
return a:str
endif
let str = a:str
let idx = stridx(str, a:from)
while idx !=# -1
@bf4648
bf4648 / handbrake.sh
Created September 19, 2021 22:39 — forked from ralphcrisostomo/handbrake.sh
Batch convert videos with HandBrake CLI
#!/bin/bash
# Batch convert videos with HandBrake CLI
# By Ralph Crisostomo - 2016.04.17
#
# Usage :
# 'sudo ./handbrake.sh /source /destination'
#
# Reference :
# https://forum.handbrake.fr/viewtopic.php?f=6&t=19426
# https://gist.github.com/czj/1263872
@bf4648
bf4648 / .gdbinit
Created August 12, 2021 00:14 — forked from thobbs/.gdbinit
A version of .gdbinit that provides a pystack and pystackv command that does not hang forever. The problem appeared to be an infinite loop, so to fix it I just added a basic counter that breaks the while loop after 200 iterations.
# -*- ksh -*-
#
# If you use the GNU debugger gdb to debug the Python C runtime, you
# might find some of the following commands useful. Copy this to your
# ~/.gdbinit file and it'll get loaded into gdb automatically when you
# start it up. Then, at the gdb prompt you can do things like:
#
# (gdb) pyo apyobjectptr
# <module 'foobar' (built-in)>
# refcounts: 1
@bf4648
bf4648 / vim find
Created June 26, 2021 18:52 — forked from jinzhubaofu/vim find
vim find from hades
'Find' : 'find')<CR>
" Find file in current directory and edit it.
function! Find(name)
let l:list=system("find . -type f | grep -i '".a:name."' | perl -ne 'print \"$.\\t$_\"'")
" let l:list=system("find . -iname '".a:name."' | perl -ne 'print \"$.\\t$_\"'")
" replace above line with below one for gvim on windows
" let l:list=system("find . -name ".a:name." | perl -ne \"print qq{$.\\t$_}\"")
let l:num=strlen(substitute(l:list, "[^\n]", "", "g"))
if l:num < 1
echo "'".a:name."' not found"
@bf4648
bf4648 / helpers.py
Created June 25, 2021 15:15 — forked from kennethreitz/helpers.py
Various Python helper functions
# encoding: utf-8
""" Python General Helpers
Copyright (c) 2010 Kenneth Reitz. Creative Commons Attribution 3.0 License.
"""
import urllib, re, time, sys
import paramiko