Skip to content

Instantly share code, notes, and snippets.

View Frug's full-sized avatar

Phil Nicolcev Frug

  • Canada
View GitHub Profile
@Frug
Frug / starship.toml
Created June 17, 2025 20:49
starship config
[directory]
truncation_length = 0
truncate_to_repo = false
[docker_context]
disabled = true
[gcloud]
disabled = true
@Frug
Frug / install-cursor.sh
Last active May 7, 2025 19:51
Install Cursor (Linux)
#!/bin/bash
# Install cursor script taken from https://forum.cursor.com/t/cursor-install-ubuntu-24-04/4838/6
APPIMAGE_PATH="/opt/cursor/Cursor.AppImage"
installCursor() {
if [ -f $APPIMAGE_PATH ]; then
echo "Cursor already installed."
return
fi
@Frug
Frug / vscode-settings.json
Last active July 30, 2025 21:13
VSCode Settings
{
"workbench.colorCustomizations": {
"editorSuggestWidget.border": "#00000000",
"editorSuggestWidget.background": "#1f1e1ece",
"editorHoverWidget.border": "#00000000",
"editorHoverWidget.background": "#1f1e1ece"
},
"[python]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "charliermarsh.ruff",
@Frug
Frug / quick-nuke.sql
Last active March 2, 2021 19:39
Quick nuke all tables postgres
-- Dropping and re-adding constraints is a hack to prevent the cascade from affecting tables we don't want affected.
-- It's much faster than cascading changes, and it's safe enough if we know we're deleting all the tables.
DO $$DECLARE selectrow record;
BEGIN
SET session_replication_role = replica;
FOR selectrow IN
SELECT 'DELETE FROM myschema.' ||quote_ident(t.table_name) || ' ;' AS qry
FROM (
SELECT table_name
@Frug
Frug / linuxStuff.md
Last active May 6, 2017 23:57
Things to remember about setting up Ubuntu (and probably other distros)

Fixing mouse scroll speed

sudo apt-get install imwheel

And rtfm for how to use.

Mounting NTFS with the right permissions

via fstab

sudo blkid -c /dev/null

List Devices

lsblk -f | lsblk -l
sudo ls -l /dev/disk/by-id/
sudo ls -l /dev/disk/by-id/usb
sudo modprobe usb-storage
sudo fdisk -l
lsusb

Error Logs

tail /var/log/syslog

@Frug
Frug / bash_completion.md
Last active May 30, 2022 16:27
git branch in bashrc

You'll need to enable bash_completion, which I think ubuntu does already by default so check .bashrc for bash_completion in there

Bash completion for git branch

if [ -f /etc/bash_completion ]; then . /etc/bash_completion fi

PROMPT_DIRTRIM=2 # this doesn't need to be exported, only set for the session
export PS1="\[\033[01;32m\]\u@\h\[\033[01;34m\] \w\[\033[01;33m\]\$(__git_ps1)\[\033[01;34m\] \$\[\033[00m\]"
@Frug
Frug / gist:cea59ff7c5df850269df
Created October 9, 2014 18:11
Set up vagrant with rabbit
To setup rabbitMQ on vagrant:
=============================
first make sure the vagrant box has been destroyed
in /Vagrantfile add this below the 'config.vm.network ...':
config.vm.network :forwarded_port, guest: 15672, host: 15672
copy the rabbitmq latest .deb release from http://www.rabbitmq.com/download.html to /vagrant
vagrant up
@Frug
Frug / ajaxchat sounds
Created March 8, 2013 06:54
play sounds in ajax chat
// Sound effect for clang sound
ajaxChat.playSoundOnNewMessage = function(dateObject, userID, userName, userRole, messageID, messageText, channelID, ip) {
if(this.settings['audio'] && this.sounds && this.lastID && !this.channelSwitch) {
switch(userID) {
case this.chatBotID:
var messageParts = messageText.split(' ', 1);
switch(messageParts[0]) {
case '/login':
case '/channelEnter':
this.playSound(this.settings['soundEnter']);
Gist is awesome :doomguy: