Skip to content

Instantly share code, notes, and snippets.

@joyrexus
joyrexus / README.md
Last active February 24, 2024 15:16
collapsible markdown

collapsible markdown?

CLICK ME

yes, even hidden code blocks!

print("hello world!")
@varenc
varenc / pet-snippet.toml
Last active April 22, 2024 20:22
description
[[snippets]]
description = "my personal snippets. Relies on many of my own functions. If you're interested in pmset/disabling assertions, see: https://gist.github.com/varenc/627f6be2a5ec9d52dab3cf0d157be62f"
command = ""
output = ""
[[snippets]]
description = "start dev file syncer. uses fswatch to know when to run rsync. does not sync .git file. Sort like a write-through cache network file system with only eventual consistency guarantees."
command = "fswatch -0 --exclude \"\\.git\" --exclude \"\\.xml\" --exclude \"___\" -o /Users/chris/Documents/workspace/lingt_chris_dev_rsync_checkout/myproject | xargs -0 -n 1 -I {} rsync --progress --exclude '*.pyc' --exclude '*.git' --recursive ~/workspace/lingt_chris_dev_rsync_checkout/myproject dev@dev.server:/home/user/webapps/dev_chris/myproject"
output = ""
@marcus-at-localhost
marcus-at-localhost / bookmarklet.js
Last active November 9, 2019 01:51
[Markdown Quote from Website - Bookmarklet] Select text, click the bookmarklet, get an overlay with the selection styled as Markdown quote with source, click "copy" to get the selection copied to your clipboard.Uses https://github.com/zenorocha/clipboard.js
/**
* Markdown Quote to Clipboard
*/
var mo = {
version: 1,
btnId: 'clipboard-btn-dceaeae8-1557-4454-883c-05ae99312192',
id:'clipboard-dceaeae8-1557-4454-883c-05ae99312192',
textareaId: 'clipboard-textarea-dceaeae8-1557-4454-883c-05ae99312192',
uniqueId: 'clipboard-script-dceaeae8-1557-4454-883c-05ae99312192',
@christianrondeau
christianrondeau / AutoKeyboardLayout.ahk
Last active May 11, 2023 19:50
Automatic keyboard layout change on window focus using AutoHotkey
; How to use:
; 1. Install AuthotKey: https://www.autohotkey.com
; 2. Save this script in `My Documents`
; 3. Create a shortcut in the Startup folder (`Win`+`R`, `shell:startup`)
; 4. Change the configurations below
; 5. Start and test the script!
; Configuration
; Cultures can be fetched from here: https://msdn.microsoft.com/en-us/library/windows/desktop/dd318693(v=vs.85).aspx
'''''''''''''''''''''''''''''
' Purpose: Allows you to easily get the RAM configuration of a computer. LAN Sweeper won't tell you the RAM type, but this utility will. This should be useful for RAM upgrades.
' Requirements: Probably admin in Active Directory
' Written by: Alex Yancey
' Date: September 15, 2016
'''''''''''''''''''''''''''''
' More info about SMBIOS can be found in the SMBIOS specification: https://www.dmtf.org/standards/smbios, and from this article: http://www.codeguru.com/cpp/misc/misc/system/article.php/c12347/SMBIOS-Demystified.htm
computer_name = InputBox("Computer name: ", "RAM Identifier")
@stefanmaric
stefanmaric / copy-to-clipboard-bookmarklet.md
Created September 7, 2016 20:54
Create Bookmarklet (browser bookmark that executes Javsacript) to copy a given text to Clipboard

Copy-to-clipboard Bookmarklet

Create Bookmarklet (browser bookmark that executes Javsacript) to copy a given text to Clipboard.

This is the base javascript:

(function (text) {
  var node = document.createElement('textarea')
  var selection = document.getSelection()
@Tynach
Tynach / telegram-gif.sh
Last active July 3, 2023 10:33
Uses FFMPEG to convert any file FFMPEG understands into a .mp4 file that Telegram will consider as a 'gif', at higher quality than Telegram converts gifs to itself.
#!/bin/bash
# Settings
outfolder="converted"
codec="libx264"
maxres="448"
#filter="crop=floor(in_w/2)*2:floor(in_h/2)*2:0:0:exact=1,colorspace=bt601-6-625:range=pc:irange=tv:iall=bt601-6-625:format=yuv444p12,zscale=rin=full:tin=601:t=linear,scale=if(gt(iw\,ih)\,min($maxres\,floor((iw+1)/2)*2)\,-2):if(gt(iw\,ih)\,-2\,min($maxres\,floor((ih+1)/2)*2)),zscale=rin=full:r=limited:tin=linear:t=601"
filter="scale=if(gt(iw\,ih)\,min($maxres\,floor((iw+1)/2)*2)\,-2):if(gt(iw\,ih)\,-2\,min($maxres\,floor((ih+1)/2)*2)):out_color_matrix=bt601:out_range=tv:flags=accurate_rnd+full_chroma_inp+full_chroma_int+bicublin"
preset="veryslow"
profile="high"
@srt4rulez
srt4rulez / AutoHotKey.ahk
Last active March 28, 2022 11:44
Autohotkey
;-------------------------------------------------------------------------------
; Jake's AutoHotKey.ahk
;
; For Reference:
;
; Hotkey Modifiers
; # - Windows key
; ! - Alt
; ^ - Control
; + - Shift
@modesto
modesto / PowerShell-CheatSheet.md
Last active March 16, 2021 17:19
PowerShell-CheatSheet

Memory allocated for each proccess:

get-process | Group-Object -Property ProcessName | Format-table Name, @{n='Mem (KB)';e={'{0:N0}' -f (($_.Group|Measure-Object WorkingSet -Sum).Sum / 1KB)};a='right'} -AutoSize

Get Temp folder:

$env:TEMP  # 8+3 format
@lalibi
lalibi / Set-WindowState.ps1
Last active August 26, 2023 04:25 — forked from Nora-Ballard/Set-WindowState.ps1
Hide, Show, Minimize, Maximize, etc window from Powershell.
function Set-WindowState {
<#
.LINK
https://gist.github.com/Nora-Ballard/11240204
#>
[CmdletBinding(DefaultParameterSetName = 'InputObject')]
param(
[Parameter(Position = 0, Mandatory = $true, ValueFromPipeline = $true)]
[Object[]] $InputObject,