Skip to content

Instantly share code, notes, and snippets.

View farhaduneci's full-sized avatar
🔫
Sarbazi

Farhad Uneci farhaduneci

🔫
Sarbazi
View GitHub Profile
@farhaduneci
farhaduneci / python.json
Created July 11, 2024 10:21
VS Code Python Snippets
{
"Print to Console": {
"prefix": "print",
"body": [
"print(${1:message})"
],
"description": "Insert a print statement"
},
"If Statement": {
"prefix": "if",
@farhaduneci
farhaduneci / how-to.md
Created May 31, 2024 12:43
MacOS run sudo with Touch ID

Authenticate with Touch ID

By default running sudo commands is done via entering your password. If you would rather use your fingerprint to authenticate you must modify your sudo configuration.

MacOS Sonoma (14) and Later

  1. Copy /etc/pam.d/sudo_local.template to sudo_local
    sudo cp /etc/pam.d/sudo_local.template /etc/pam.d/sudo_local
@farhaduneci
farhaduneci / app.py
Created March 30, 2024 05:18
Command-Line DB App with Python
"""
This command-line diary application allows users to add, view, search,
and delete diary entries. Entries are stored with timestamps in an
SQLite database.
Original Author: Charles Leifer
Source: https://charlesleifer.com/blog/dear-diary-an-encrypted-command-line-diary-with-python/
"""
import datetime
@farhaduneci
farhaduneci / clock.go
Last active March 27, 2024 17:04
Simple Clock Struct Written in Go
package main
import (
"fmt"
)
type Clock struct {
hours int
minutes int
}
@farhaduneci
farhaduneci / irregular-verbs.csv
Created March 4, 2024 23:10
English Irregular Verbs Conjugation CSV
Base form Past simple Past participle
Abide Abode/Abided Abode/Abided/Abidden
Aby/Abey Abought Abought
Alight Alit/Alighted Alit/Alighted
Arise Arose Arisen
Awake Awoke Awoken
Backbite Backbit Backbitten
Backfit Backfit Backfit
Backlight Backlit Backlit
Backslide Backslid Backslid/Backslidden
@farhaduneci
farhaduneci / app.js
Last active February 21, 2024 13:17
Language Tool JS Library Test
const languagetool = require("languagetool-api");
var params = {
language: "en-US",
text: "If i was you, i wouldt do that",
};
languagetool.check(params, function (err, res) {
if (err) {
console.log(err);
@farhaduneci
farhaduneci / docs.md
Last active November 17, 2023 13:44
Mac Proxy Configuration Script

ProxyPilot

My Mac Proxy Configuration Script.

Overview

This is a friendly and simple script for macOS users to manage proxy settings. Whether you need to quickly switch on your proxies for secure browsing or disable them when not needed, this script makes it a breeze!

How to Use

  • Set Proxies: ./set_proxy.sh <port-number> [server-address]
  • Unset Proxies: ./set_proxy.sh off
@farhaduneci
farhaduneci / cleanmigrations.py
Created August 2, 2023 05:33
A custom Django management command to clean up (reset/remvoe) migration files, excluding `__init__.py` files, within the apps. This command is intended for use in development environments only and should not be used in production.
import subprocess
from django.core.management.base import BaseCommand
from django.conf import settings
class Command(BaseCommand):
help = "Deletes migration files, excluding __init__.py, from apps"
def handle(self, *args, **options):
@farhaduneci
farhaduneci / How-to-use-tor-on-arch.md
Created September 24, 2022 05:47
Tor on Arch Linux

Setup tor proxy on Arch Linux

Installation

  1. Install tor

         $ sudo pacman -S tor
         $ ## nyx provides a terminal status monitor for bandwidth usage, connection details and more.
         $ sudo pacman -S nyx
         $ ## torsocks safely torify applications
@farhaduneci
farhaduneci / Answers.sql
Created September 1, 2022 06:20
8 Week SQL Challenge, Case Study #1, Danny's Diner
-- Case Study #1 - Danny's Diner
-- https://8weeksqlchallenge.com/case-study-1/
-- Solved on SQLite 3.39 by Farhad Uneci, August 2022
-- 1. What is the total amount each customer spent at the restaurant?
SELECT
customer_id AS 'Customer',
SUM(price) AS 'Paid'
FROM
sales