Skip to content

Instantly share code, notes, and snippets.

jRimbault jRimbault

Block or report user

Report or block jRimbault

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View LetsDestroyC.md

Let's Destroy C

I have a pet project I work on, every now and then. CNoEvil.

The concept is simple enough.

What if, for a moment, we forgot all the rules we know. That we ignore every good idea, and accept all the terrible ones. That nothing is off limits. Can we turn C into a new language? Can we do what Lisp and Forth let the over-eager programmer do, but in C?


@KodrAus
KodrAus / Profile Rust on Linux.md
Last active Mar 26, 2020
Profiling Rust Applications
View Profile Rust on Linux.md

Profiling performance

Using perf:

$ perf record -g binary
$ perf script | stackcollapse-perf.pl | rust-unmangle | flamegraph.pl > flame.svg

NOTE: See @GabrielMajeri's comments below about the -g option.

@dragon788
dragon788 / longwindedname.md
Created Nov 25, 2016
Restore rEFInd as default boot manager from Windows after updates
View longwindedname.md

After losing access to rEFInd yet again (Windows 10 Anniversary Edition), I was able to find the proper invocation of BCDEdit thanks to a helpful person on StackOverflow. None of the Microsoft documentation mentions this, but you NEED single quotes around {bootmgr} for sure if you are in the PowerShell shell, but possibly also if you are in the Command Prompt. This allowed me to add a new entry for rEFInd and I've had to do this multiple times so I know it works on Windows 10.

bcdedit /set {bootmgr} path \EFI\refind\refind_x64.efi 

becomes

bcdedit /set '{bootmgr}' path \EFI\refind\refind_x64.efi
@whophil
whophil / jupyter.service
Last active Mar 27, 2020 — forked from doowon/jupyter_systemd
A systemd script for running a Jupyter notebook server.
View jupyter.service
# After Ubuntu 16.04, Systemd becomes the default.
# It is simpler than https://gist.github.com/Doowon/38910829898a6624ce4ed554f082c4dd
[Unit]
Description=Jupyter Notebook
[Service]
Type=simple
PIDFile=/run/jupyter.pid
ExecStart=/home/phil/Enthought/Canopy_64bit/User/bin/jupyter-notebook --config=/home/phil/.jupyter/jupyter_notebook_config.py
@DarwinAwardWinner
DarwinAwardWinner / python-bash-wrapper.py
Last active Jan 26, 2020
Put bash cluster setup code and python script in a single file
View python-bash-wrapper.py
#!/bin/bash
# -*- mode:python -*-
#PBS -l nodes=1:ppn=8,mem=30gb
''''/bin/true
# This is bash code to set up the environment
echo "Hello from bash!"
echo "Args are: $@"
# Bash setup code ends here
python - "$@" <<EOF
''' # Python starts here '''
@codeinthehole
codeinthehole / osx_bootstrap.sh
Created Mar 30, 2015
Script to install stuff I want on a new OSX machine
View osx_bootstrap.sh
#!/usr/bin/env bash
#
# Bootstrap script for setting up a new OSX machine
#
# This should be idempotent so it can be run multiple times.
#
# Some apps don't have a cask and so still need to be installed by hand. These
# include:
#
# - Twitter (app store)
@tadly
tadly / pacaur_install.sh
Last active Mar 30, 2020
A simple shell script to quickly / easily install "pacaur" on archlinux
View pacaur_install.sh
#!/bin/sh
#
# !!! IMPORTANT !!!
# As of 2017-12-14, pacaur is unmaintained (https://bbs.archlinux.org/viewtopic.php?pid=1755144#p1755144)
# For alternatives see the arch wiki: https://wiki.archlinux.org/index.php/AUR_helpers#Active
# pacaur seems to get occasional updates to fix breaking changes due to pacman updates though.
#
# If you are new to arch, I encourage you to at least read and understand what
# this script does befor blindley running it.
# That's why I didn't make a one-liner out of it so you have an easier time
You can’t perform that action at this time.