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
@mowen
mowen / org-style.css
Created March 9, 2010 12:19
A stylesheet for the Emacs Org Mode HTML export
/**
* This stylesheet will work pretty well with a regular Org Mode HTML export.
* However, you do have to turn off all of the defaults:
*
* (setq org-export-html-style-include-scripts nil
* org-export-html-style-include-default nil)
*
* and insert a call to the stylesheet:
*
* (setq org-export-html-style
@tonious
tonious / hash.c
Last active February 17, 2023 02:25
A quick hashtable implementation in c.
/* Read this comment first: https://gist.github.com/tonious/1377667#gistcomment-2277101
* 2017-12-05
*
* -- T.
*/
#define _XOPEN_SOURCE 500 /* Enable certain library functions (strdup) on linux. See feature_test_macros(7) */
#include <stdlib.h>
#include <stdio.h>
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@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
@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.

@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);
@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
@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!")
@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.

@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