Skip to content

Instantly share code, notes, and snippets.

View fnurl's full-sized avatar

Jody Foo fnurl

  • Linköping University
  • Linköping, Sweden
View GitHub Profile
@skyzyx
skyzyx / homebrew-gnubin.md
Last active April 24, 2024 00:04
Using GNU command line tools in macOS instead of FreeBSD tools

macOS is a Unix, and not built on Linux.

I think most of us realize that macOS isn't a Linux OS, but what that also means is that instead of shipping with the GNU flavor of command line tools, it ships with the FreeBSD flavor. As such, writing shell scripts which can work across both platforms can sometimes be challenging.

Homebrew

Homebrew can be used to install the GNU versions of tools onto your Mac, but they are all prefixed with "g" by default.

All commands have been installed with the prefix "g". If you need to use these commands with their normal names, you can add a "gnubin" directory to your PATH from your bashrc.

@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active May 3, 2024 13:01
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
int[][] result;
float t, c;
float ease(float p) {
return 3*p*p - 2*p*p*p;
}
float ease(float p, float g) {
if (p < 0.5)
return 0.5 * pow(2*p, g);
// note : if you're on github gist and want to copy paste this code, you can click on the "Raw" button
// and then do Ctrl A, Ctrl C, Ctrl V
// (code below by Kurt Spencer, slightly modified code to run as Processing tab)
// maybe you should rather use this new (improved) version of the noise instead : https://github.com/KdotJPG/OpenSimplex2
/*
* OpenSimplex Noise in Java.
* by Kurt Spencer
*
* v1.1 (October 5, 2014)
@venik
venik / build_tf.sh
Last active February 22, 2024 06:12
Bash script for local building TensorFlow on Mac/Linux with all CPU optimizations (default pip package has only SSE)
#!/usr/bin/env bash
# Author: Sasha Nikiforov
# source of inspiration
# https://stackoverflow.com/questions/41293077/how-to-compile-tensorflow-with-sse4-2-and-avx-instructions
# Detect platform
if [ "$(uname)" == "Darwin" ]; then
# MacOS
@csswizardry
csswizardry / README.md
Last active April 2, 2024 20:17
Vim without NERD tree or CtrlP

Vim without NERD tree or CtrlP

I used to use NERD tree for quite a while, then switched to CtrlP for something a little more lightweight. My setup now includes zero file browser or tree view, and instead uses native Vim fuzzy search and auto-directory switching.

Fuzzy Search

There is a super sweet feature in Vim whereby you can fuzzy find your files using **/*, e.g.:

:vs **/*<partial file name><Tab>
@nicinabox
nicinabox / lets split build guide.md
Last active January 28, 2023 04:10
This guide covers building a Let's Split v2.

This guide has moved

To improve collaboration this guide is now available on GitHub.

Continue reading

@lucc
lucc / lbdb.mk
Created December 30, 2016 09:21
Small wrapper for fast address lookup in mutt/alot/... of the addresses in khard and gpg keyring,
#!/usr/bin/make -f
# A rewimplementation of the idea of lbdb in as a make file.
CACHE = ~/.cache/lbdb
SHARE = \
/usr/share \
/usr/local/share \
~/.local/share
@deepak
deepak / pyg
Created March 20, 2014 02:05
script to create RTF for code snippets to paste in keynote presentations using pygments
#!/bin/bash
# /usr/local/bin/pygmentize -f rtf -O "style=friendly,fontface=Courier Bold" "$1" | pbcopy
# /usr/local/bin/pygmentize -l ruby -f rtf -P style=presentation -P fontface="Source Code Pro" "$1" | pbcopy
/usr/local/bin/pygmentize -l ruby -f rtf -O "style=friendly,fontface=Source Code Pro" "$1" |
# Set the font size to 36pt (that's the \fs72 - RTF font sizes work in doubles)
sed "s/\\\\f0/\\\\f0\\\\fs72/g" |
# And copy. Enjoy!
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 3, 2024 19:09
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname