Skip to content

Instantly share code, notes, and snippets.

View dwcoates's full-sized avatar

Dodge Coates dwcoates

  • Chess.com
  • New York, NY
View GitHub Profile
;; https://vxlabs.com/2014/05/25/emacs-24-with-prelude-org2blog-and-wordpress/
(setq blog-directory "~/github/kozikow-blog")
(setq org-list-allow-alphabetical t)
(require 'org2blog)
(require 'netrc)
(require 'org2blog-autoloads)
d
@Garrett-R
Garrett-R / gzip_str.py
Last active March 12, 2022 10:17
Demo of how to gzip and gunzip a string in Python 3
"""How to gzip a string.
This works for Python 3.2. For 3.1-, look at the original gist (under "Revisions")
"""
import gzip
def gzip_str(string_: str) -> bytes:
return gzip.compress(string_.encode())
@drorata
drorata / gist:b05bfd59c45eec0470f6
Last active May 9, 2022 14:12
Nice output of pandas.DataFrame in org-mode
import pandas as pd
import numpy as np
from tabulate import tabulate

df = pd.DataFrame(np.random.random((4,3)), columns=['A','B','C'])
print("foo")
return(tabulate(df, headers="keys", tablefmt="orgtbl"))
@Bad-ptr
Bad-ptr / company-minibuffer.el
Last active May 2, 2020 11:14
Allow company-mode in minibuffer.
(with-eval-after-load "company-autoloads"
(global-company-mode 1)
(setq company-tooltip-limit 20
company-minimum-prefix-length 1
company-echo-delay 0
company-begin-commands '(self-insert-command
c-electric-lt-gt c-electric-colon
completion-separator-self-insert-command)
company-idle-delay 0.2
@jeetsukumaran
jeetsukumaran / build-gcc.sh
Last active May 6, 2024 18:18
Build and Install GCC Suite from Scratch
#! /bin/bash
GCC_VERSION="5.2.0"
WORKDIR="$HOME/src/"
INSTALLDIR="/platform"
## NOTE: XCode must be installed (through App Store) and the following run to install command-line tools.
## THIS IS IMPORTANT! Among other things, it creates '/usr/include' and installs the system header files.
# xcode-select --install
@mads-hartmann
mads-hartmann / toggle-maximize-buffer.el
Created August 20, 2012 10:05
An Emacs function to temporarily make one buffer fullscreen. You can quickly restore the old window setup.
(defun toggle-maximize-buffer () "Maximize buffer"
(interactive)
(if (= 1 (length (window-list)))
(jump-to-register '_)
(progn
(set-register '_ (list (current-window-configuration)))
(delete-other-windows))))
;; Bind it to a key.