Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / 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 {

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 / .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
@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];