Skip to content

Instantly share code, notes, and snippets.

View larrasket's full-sized avatar

Salih Muhammed larrasket

View GitHub Profile
@larrasket
larrasket / hell.c
Created November 16, 2022 23:46
Basic C program to fuck up your CPU. Use it to test your fans
#include <stdio.h>
int main(){
int count=0,found=0;
int a=2,current=2;
while(found<100000){
while(a<current)
{
if(current%a==0){
count=1;
}
@larrasket
larrasket / script.js
Created November 16, 2022 22:58
Userscript to get card view in classical reddit view.
// ==UserScript==
// @name Reddit auto-expand
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Auto expand reddit posts
// @author marg9
// @match https://*.reddit.com/*
// @grant none
// ==/UserScript==
// crdts: https://www.reddit.com/r/Enhancement/comments/fjksmc/tutorial_how_to_auto_expand_both_text_and_image/
@larrasket
larrasket / cmus.desktop
Last active November 3, 2022 03:10
Script to open cmus and add directories remotely using cmus-remote
[Desktop Entry]
Name=cmus
Comment=open cmus in kitty
Exec=/bin/sh -c "$HOME/configs/cmus.sh"
Icon=CMakeSetup
Terminal=false
Type=Application
Categories=Music;
“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
@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)
@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 / 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 {