Skip to content

Instantly share code, notes, and snippets.

View Colelyman's full-sized avatar

Cole Lyman Colelyman

View GitHub Profile
@AllenDang
AllenDang / gccemacs.md
Last active August 15, 2023 15:45
Build gccemacs on MacOS catalina with gcc 10 installed by homebrew.
@mikroskeem
mikroskeem / gccemacs_osx.md
Last active May 12, 2024 15:07
gccemacs on OSX

gccemacs on OS X

Read this first: http://akrl.sdf.org/gccemacs.html

Prerequisites

1) GCC with libgccjit enabled

For that you need to compile gcc (duh). I edited Homebrew's gcc formula:

@ZaydH
ZaydH / README_CPLEX_Max-Flow_Min-Cut.md.md
Last active April 20, 2022 14:31
Python CPLEX: Max Flow/Min Cut

Max Flow/Min Cut Using CPLEX in Python

This program uses the Python cplex library to solve a max flow/min cut problem. More information on max flow/min cut is available in the Wikipedia article.
The basic idea is to assign flow to each edge such that no edge's flow exceeds that edge's capacity.

Be aware that a linear program may not always be the most efficient technique for solving max flow/min cut. This gist is intended more as a demonstration of how to use CPLEX in Python.

The graph I used is:

@axefrog
axefrog / suffix-tree-console.js
Last active May 6, 2024 05:17
Simple suffix tree implementation in JavaScript. Install chalk to run the script below, or strip it down and remove all the debug messages and test cases.
const defaultIfZero = (a, x) => x === 0 ? a : x;
const isDefined = x => x !== void 0;
const isUndefined = x => x === void 0;
const NONE = Symbol('NONE');
const chalk = require('chalk');
const val = x => (x === NONE ? (x = 'none', chalk.bold.grey) : chalk.cyan)(String(x));
let highlightActiveNode = null;
let highlightedEdges = [];
@prathik
prathik / todo.el
Last active September 27, 2020 05:27
Manage daily todo files on Emacs
(defun todo-create-directory (directory)
"Creates the todo directory."
(if (file-exists-p directory) (message "Directory exists")
(make-directory directory)
(message "Directory created")
))
(defun create-todo-file (directory filename)
"Checks if the todo file exists if not creates it."
(todo-create-directory directory)
@SheldonWangRJT
SheldonWangRJT / Convert .mov or .MP4 to .gif.md
Last active May 22, 2024 02:05
Convert Movie(.mov) file to Gif(.gif) file in one command line in Mac Terminal

This notes is written by Sheldon. You can find me with #iOSBySheldon in Github, Youtube, Facebook, etc.

Need

Convert .mov/.MP4 to .gif

Reason

As a developer, I feel better to upload a short video when I create the pull request to show other viewers what I did in this PR. I tried .mov format directly got after finishing recording screen using Quicktime, however, gif offers preview in most web pages, and has smaller file size.

This is not limited to developer, anyone has this need can use this method to convert the files.

@max-mapper
max-mapper / bibtex.png
Last active March 10, 2024 21:53
How to make a scientific looking PDF from markdown (with bibliography)
bibtex.png
@anantkamath
anantkamath / runningInDocker.py
Created October 30, 2016 17:26
Check if you're running inside a Docker container in Python
def runningInDocker():
with open('/proc/self/cgroup', 'r') as procfile:
for line in procfile:
fields = line.strip().split('/')
if fields[1] == 'docker':
return True
return False
@mbbx6spp
mbbx6spp / README.md
Last active September 17, 2023 10:28
How to install Nix in your home directory

Nix

Prerequisites

  • wget is installed
  • tar is installed

Purpose

If you really don't want to install Nix under /nix (or you can't) then you can install Nix

@rvl
rvl / git-pushing-multiple.rst
Created February 9, 2016 11:41
How to push to multiple git remotes at once. Useful if you keep mirrors of your repo.

Pushing to Multiple Git Repos

If a project has to have multiple git repos (e.g. Bitbucket and Github) then it's better that they remain in sync.

Usually this would involve pushing each branch to each repo in turn, but actually Git allows pushing to multiple repos in one go.

If in doubt about what git is doing when you run these commands, just