Skip to content

Instantly share code, notes, and snippets.

@trusktr
trusktr / DefaultKeyBinding.dict
Last active April 20, 2024 11:37
My DefaultKeyBinding.dict for Mac OS X
/* ~/Library/KeyBindings/DefaultKeyBinding.Dict
This file remaps the key bindings of a single user on Mac OS X 10.5 to more
closely match default behavior on Windows systems. This makes the Command key
behave like Windows Control key. To use Control instead of Command, either swap
Control and Command in Apple->System Preferences->Keyboard->Modifier Keys...
or replace @ with ^ in this file.
Here is a rough cheatsheet for syntax.
Key Modifiers
@andyjessop
andyjessop / prompt.txt
Created April 20, 2024 07:43
A prompt to categorise and analyse sentiment for GitHub issues
Please analyze the following GitHub issue data, which is provided as a JSON object:
{
"title": "🐛 BUG: WebSocket typing doesn't work in apps that also pull in DOM types",
"body": "Which Cloudflare product(s) does this pertain to?",
}
Provide a response with the following structure:
<json>
@anupambhatnagar
anupambhatnagar / profiler.py
Created December 14, 2023 01:14
Trace collection example
import torch
import torch.nn as nn
import torch.optim as optim
from torch.profiler import profile, schedule, tensorboard_trace_handler, ProfilerActivity
class Xor(nn.Module):
def __init__(self):
super(Xor, self).__init__()
self.fc1 = nn.Linear(2, 3, True)
self.fc2 = nn.Linear(3, 1, True)
  • SC1000 $ is not used specially and should therefore be escaped.
  • SC1001 This \o will be a regular 'o' in this context.
  • SC1003 Want to escape a single quote? echo 'This is how it'\''s done'.
  • SC1004 This backslash+linefeed is literal. Break outside single quotes if you just want to break the line.
  • SC1007 Remove space after = if trying to assign a value (or for empty string, use var='' ... ).
  • SC1008 This shebang was unrecognized. ShellCheck only supports sh/bash/dash/ksh. Add a 'shell' directive to specify.
  • SC1009 The mentioned parser error was in ...
  • SC1010 Use semicolo
@alexsoar
alexsoar / change-php.sh
Created April 20, 2024 11:32 — forked from mrsuh/change-php.sh
bash scripts
#!/bin/sh
# https://github.com/shivammathur/homebrew-php
RED='\033[0;31m'
GREEN='\033[0;32m'
NC='\033[0m'
# https://github.com/Homebrew/brew/issues/14451
export HOMEBREW_NO_INSTALL_FROM_API=1
@shitalmule04
shitalmule04 / MySQL_Export.py
Last active April 20, 2024 11:32
Python Script to export SQLite database tables into CSV file.
import sqlite3 as sql
import os
import csv
from sqlite3 import Error
try:
# Connect to database
conn=sql.connect('mydb.db')
@NSWG
NSWG / VMware Workstation 16 Pro and Player keys
Last active April 20, 2024 11:32
VMware Workstation 16 Pro and Player keys
VMware Workstation Pro 16.x Serials
YA7RA-F6Y46-H889Z-LZMXZ-WF8UA
ZV7HR-4YX17-M80EP-JDMQG-PF0RF
UC3XK-8DD1J-089NP-MYPXT-QGU80
GV100-84W16-M85JP-WXZ7E-ZP2R6
YF5X2-8MW91-4888Y-DNWGC-W68TF
AY1XK-0NG5P-0855Y-K6ZXG-YK0T4
VMware Workstation Player 16.x Serials
@zealot128
zealot128 / simple_form.rb
Created August 13, 2022 14:50
Rails simple_form Tailwind Daisy UI config
# frozen_string_literal: true
#
# Uncomment this and change the path if necessary to include your own
# components.
# See https://github.com/heartcombo/simple_form#custom-components to know
# more about custom components.
# Dir[Rails.root.join('lib/components/**/*.rb')].each { |f| require f }
#
# Use this setup block to configure all options available in SimpleForm.
SimpleForm.setup do |config|
@vratiu
vratiu / .bash_aliases
Last active April 20, 2024 11:24
Git shell coloring
# Customize BASH PS1 prompt to show current GIT repository and branch.
# by Mike Stewart - http://MediaDoneRight.com
# SETUP CONSTANTS
# Bunch-o-predefined colors. Makes reading code easier than escape sequences.
# I don't remember where I found this. o_O
# Reset
Color_Off="\[\033[0m\]" # Text Reset