Skip to content

Instantly share code, notes, and snippets.

View lguenth's full-sized avatar
👨‍🎓

Luke lguenth

👨‍🎓
View GitHub Profile
@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active November 2, 2024 12:56
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@drj42
drj42 / org-mode-reference-in.org
Created February 6, 2012 23:53
This is a cheat sheet for Emacs org-mode... in org-mode format!
@JonathonReinhart
JonathonReinhart / NOTES
Created January 6, 2015 09:05
My working Samba configuration
I had to also do the following items to play nicely with SELinux:
Restore the proper SELinux labels on smb.conf and my smbusers:
# chcon system_u:object_r:samba_etc_t:s0 smb.conf
# chcon system_u:object_r:samba_etc_t:s0 smbusers
Allow Samba to access home dirs:
# setsebool -P samba_enable_home_dirs 1
@marcelosantos
marcelosantos / fix-encoding-utf8-during-maven-compilation.md
Last active November 14, 2024 21:48
Fix encoding utf8 during maven compilation

Configure the maven-compiler-plugin to use the same character encoding that your source files are encoded in (e.g):

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>2.3.2</version>
    <configuration>
        <source>1.8</source> <!-- jdk version --> 
 1.8 
@Socialdarwinist
Socialdarwinist / Instructions for letting extra layouts appear in the desktop environment’s keyboard settings.txt
Last active February 16, 2022 16:57
Pan-Cyrillic keyboard layout based on the Russian keyboard layout
To add a new layout to your system, an example is how I added the pan-Cyrillic keyboard layout – I appended /usr/share/X11/xkb/symbols/ru by it, and as I wanted to use capslock as a fifth-level-modifier, which strangely nobody had defined until then, I included the given definition for the capslock key as fifth-level modifier in the /usr/share/X11/xkb/symbols/level5 file.
For registering the pan-Cyrillic keyboard layout, I had to include the listed XML data for the files /usr/share/X11/xkb/rules/base.extras.xml and /usr/share/X11/xkb/rules/evdev.extras.xml as a variant under the “ru” layout, that is to say nested in its <variantList> element.
Currently there is no way to add keyboard layouts without manipulating package-controlled system files, so you have to repeat these steps after each reinstallation of the X keyboard configuration files (written by the package xkeyboard-config on Arch Linux and derivates).
For this specific keyboard layout presented here this is not necessary since I contributed the layou
@milanboers
milanboers / clone.bash
Last active September 12, 2024 11:52
Clone all repositories of a Github user
curl -s https://api.github.com/users/milanboers/repos | grep \"clone_url\" | awk '{print $2}' | sed -e 's/"//g' -e 's/,//g' | xargs -n1 git clone
@max-mapper
max-mapper / bibtex.png
Last active November 6, 2024 09:03
How to make a scientific looking PDF from markdown (with bibliography)
bibtex.png
@Socialdarwinist
Socialdarwinist / XML lines to be added at an appropriate place in base.xml
Last active October 18, 2024 02:20
International Phonetic Alphabet keyboard layout for XKB filled with other characters that are useful for transcribing, transliterating
<layout>
<configItem>
<name>trans</name>
<description>International Phonetic Alphabet</description>
</configItem>
<variantList/>
</layout>
\documentclass[sigconf,anonymous=$anonymous$]{acmart}
\usepackage{booktabs}
\usepackage{caption} % http://mirror.easyname.at/ctan/macros/latex/contrib/caption/caption-eng.pdf
\usepackage{balance} % balancing bibstyles as per request in accepted submission
\usepackage{graphicx}
% We will generate all images so they have a width \maxwidth. This means
% that they will get their normal width if they fit onto the page, but
% are scaled down if they would overflow the margins.
@jakebox
jakebox / calc-speaking-time.el
Last active August 31, 2021 01:36
Simple Emacs function to calculate the speaking time of a selection of text. Replace '150' with your average speaking time.
(defun jib/calc-speaking-time ()
"Calculate how long it would take me to speak aloud the selection."
(interactive)
(if (use-region-p) (let* ((wpm 150)
(word-count (float (count-words-region (region-beginning) (region-end))))
(raw-time (* 60 (/ word-count wpm))))
(message "%s minutes, %s seconds to speak at %d wpm"
(format-seconds "%m" raw-time)
(floor(mod raw-time 60)) wpm))
(error "Error: select a region.")))