Skip to content

Instantly share code, notes, and snippets.

View larrasket's full-sized avatar

Salih Muhammed larrasket

View GitHub Profile
@larrasket
larrasket / qucksort.java
Created May 6, 2021 18:58
Java implementation of QuickSort
// Java implementation of QuickSort
import java.io.*;
class GFG{
// A utility function to swap two elements
static void swap(int[] arr, int i, int j)
{
int temp = arr[i];
arr[i] = arr[j];
@larrasket
larrasket / .tridactylrc
Created May 7, 2021 09:39
tridactylrc file for tridactyl with arabic support. دعم اللغة العربية لاختصارات tridactyl Make sure you've `:native` in tridactyl then put this file in your home dictionary. تأكد من تفعيل native في tridactyl ثم ضع الملف في مجلدك الرئيسي.
" bovine3dom's dogfood
" WARNING: This file defines and runs a command called fixamo_quiet. If you
" also have a malicious addon that operates on `<all_urls>` installed this
" will allow it to steal your firefox account credentials!
"
" With those credentials, an attacker can read anything in your sync account,
" publish addons to the AMO, etc, etc.
"
" Without this command a malicious addon can steal credentials from any site

Setup tor proxy on Arch Linux

Copied from this article.

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

@larrasket
larrasket / Threaded-Binary-Tree.cpp
Created June 19, 2021 20:14
Threaded Binary Tree
struct dnode
{
dnode*left;
dnode *right;
int data;
bool right_theard;
bool left_theard;
};
class tbst {
@larrasket
larrasket / doom-acario-light-theme.el
Created September 10, 2022 19:51
Doom acario light theme, fixed modeline for emacs29
;;; doom-acario-light-theme.el --- Acario light theme -*- lexical-binding: t; no-byte-compile: t; -*-
(require 'doom-themes)
;;; Variables
(defgroup doom-acario-light-theme nil
"Options for the `doom-acario-light' theme."
:group 'doom-themes)
(defcustom doom-acario-light-brighter-modeline nil
"If non-nil, more vivid colors will be used to style the mode-line."
@larrasket
larrasket / emaks.sh
Last active October 9, 2022 07:45
A script to start emacs daemon if not started, if started creates a frame
#!/bin/bash
# This script starts emacs daemon if it is not running, opens whatever file
# you pass in and changes the focus to emacs. Without any arguments, it just
# opens the current buffer or *scratch* if nothing else is open. The following
# example will open ~/.bashrc
# ec ~/.bashrc
# You can also pass it multiple files, it will open them all. Unbury-buffer
@larrasket
larrasket / main.go
Created October 9, 2022 07:45
Simple twitter oath1 using browser pin, written in go
package main
import (
"fmt"
"github.com/dghubble/oauth1"
twauth "github.com/dghubble/oauth1/twitter"
"log"
)
const outOfBand = "oob"
@larrasket
larrasket / main.go
Created October 9, 2022 09:18
Post media to twitter using go-twitter
func PublishTW(file string) {
config := oauth1.NewConfig(token.TWcon, token.TWconSEC)
token := oauth1.NewToken(token.TW, token.TWsec)
httpClient := config.Client(oauth1.NoContext, token)
b := &bytes.Buffer{}
form := multipart.NewWriter(b)
fw, err := form.CreateFormFile("media", file)
if err != nil {
panic(err)
}
@larrasket
larrasket / Makefile
Created October 30, 2022 03:00 — forked from thomaspoignant/Makefile
My ultimate Makefile for Golang Projects
GOCMD=go
GOTEST=$(GOCMD) test
GOVET=$(GOCMD) vet
BINARY_NAME=example
VERSION?=0.0.0
SERVICE_PORT?=3000
DOCKER_REGISTRY?= #if set it should finished by /
EXPORT_RESULT?=false # for CI please set EXPORT_RESULT to true
GREEN := $(shell tput -Txterm setaf 2)
“I think it wise, and only honest, to warn you that my goal is immodest. It is
not my purpose to "transfer knowledge" to you that, subsequently, you can
forget again. My purpose is no less than to effectuate in each of you a
noticeable, irreversable change. I want you to see and absorb calculational
arguments so effective that you will never be able to forget that exposure.” ―
Edsger W. Dijkstra