Skip to content

Instantly share code, notes, and snippets.

View Compro-Prasad's full-sized avatar
🔨
Building stuff. Mostly software.

Compro Prasad Compro-Prasad

🔨
Building stuff. Mostly software.
View GitHub Profile
(defvar use-layer-configuration-layers nil)
(defvar use-layer-init-hook nil)
(defvar use-layer-config-hook nil)
(defvar use-layer-excluded-packages nil)
(defsubst use-layer-error (msg)
(error "use-layer: %s" msg))
(defun copy-current-line-position-to-clipboard (p)
"Copy current line in file to clipboard as '</path/to/file>:<line-number>'"
(interactive "sAbsolute path y/n?: ")
(let ((path-with-line-number) (file-name (buffer-file-name)))
(when (and (not (string= p "y")) (projectile-project-root))
(setq file-name (file-relative-name buffer-file-name (projectile-project-root)))
)
(setq path-with-line-number (concat file-name ":" (number-to-string (line-number-at-pos))))
(x-select-text path-with-line-number)
(message (concat path-with-line-number " copied to clipboard"))))
@cyio
cyio / install-ripgrep-on-ubuntu.sh
Last active July 17, 2019 08:21
Install ripgrep on Debian / Ubuntu
#!/bin/bash
[[ $UID == 0 ]] || { echo "run as sudo to install"; exit 1; }
if ! [ -x "$(command -v jq)" ]; then
echo 'Error: jq is not installed.' >&2
apt install jq -y
fi
REPO="https://github.com/BurntSushi/ripgrep/releases/download/"
RG_LATEST=$(curl -sSL "https://api.github.com/repos/BurntSushi/ripgrep/releases/latest" | jq --raw-output .tag_name)
@swaroopch
swaroopch / init.el
Last active September 4, 2017 13:53
Ethereum price ticker for Spacemacs mode line
;; Screenshot at https://twitter.com/swaroopch/status/903442255796633600
;; Inspired by https://www.reddit.com/r/ethtrader/comments/6wxizf/single_best_feature_of_the_new_macbook/
;; Code written for Spacemacs, will need adaptation to your Emacs setup
;; Spacemacs users: You may need to enable `spacemacs-misc` layer to ensure `request` package is installed.
(defun dotspacemacs/user-config ()
"Configuration function for user code.
This function is called at the very end of Spacemacs initialization after
layers configuration.
This is the place where most of your configurations should be done. Unless it is
@Wilfred
Wilfred / regex.org
Last active January 7, 2020 17:22
Native Rust Regular Expressions in Remacs

RFC: Use Rust’s regex crate

We want to port Remacs to use a regex crate implemented in Rust. The Rust implementations are highly optimised, and this would simplify the Remacs codebase.

The two major crates are Rust’s regex crate, and the fancy-regex crate.

@joyrexus
joyrexus / README.md
Last active February 24, 2024 15:16
collapsible markdown

collapsible markdown?

CLICK ME

yes, even hidden code blocks!

print("hello world!")
@jweir
jweir / stitch.py
Created May 6, 2016 21:48
stitch images in python
"""
First make sure you have the Python Image libraries installed
sudo pip install pillow
Down below you will need to define the absolute path to the images see "dir=..."
Run this by entering
python stitch.py
@hghwng
hghwng / Booth.cc
Created November 30, 2015 11:30
Booth's Algorithm Step by Step
#include <iostream>
using namespace std;
using uint = unsigned int;
constexpr uint kLength = 6;
constexpr uint kHighBit = 1 << (kLength - 1);
constexpr uint kTrim = ((1 << (kLength)) - 1);
inline void print_binary(uint v) {
for (uint i = 1 << (kLength - 1); i != 0; i >>= 1) {
cout << ((v & i) ? 1 : 0);
@lifthrasiir
lifthrasiir / README.md
Last active March 5, 2020 12:02
GCJ 2014 QR submission

This is my submission to Google Code Jam 2014 Qualification Round, using Rust programming language. The full description of problems is available at Google.

I've solved all 4 problems over the course of 5 1/2 hours (2014-04-13T05:10+09:00 through T10:40+09:00), which were longer than I've expected (possibly because I was sleepy at that time), but I've got the full credit (90 out of 90) anyway, so I guess it was not so bad move.

I tried to write the idiomatic Rust as much as possible, but not always mostly due to the time constraints. In particular, all program shares same boilerplates for the general structure and I/O which I really don't like.

@quchen
quchen / trolling_haskell
Last active February 24, 2024 01:30
Trolling #haskell
13:15 <xQuasar> | HASKELL IS FOR FUCKIN FAGGOTS. YOU'RE ALL A BUNCH OF
| FUCKIN PUSSIES
13:15 <xQuasar> | JAVASCRIPT FOR LIFE FAGS
13:16 <luite> | hello
13:16 <ChongLi> | somebody has a mental illness!
13:16 <merijn> | Wow...I suddenly see the error of my ways and feel
| compelled to write Node.js!
13:16 <genisage> | hi
13:16 <luite> | you might be pleased to learn that you can compile
| haskell to javascript now