Skip to content

Instantly share code, notes, and snippets.

@scifisamurai
scifisamurai / gist:7edc8936f7ed12f80c68088d91fe456e
Last active December 30, 2016 19:36
Custom keybindings for JWM (https://joewing.net/projects/jwm/) as of version 2.3.6
<!-- add the following to the "Key bindings" section of jwmrc -->
<Key mask="A" key="s">shade</Key>
<Key mask="AS" key="fs">fullscreen</Key>
@scifisamurai
scifisamurai / simple_chmod.c
Last active August 29, 2015 13:57
Example of writing a program that will mimic chmod behavior. NOTE: This is overly simple, not robust, & hardcoded/derived. Much more would be needed for a useful program.
/*See man -s 2 chmod for more information */
#include <stdio.h>
#include <sys/stat.h>
int main(void){
/*mode_t mode = S_IXOTH */
mode_t mode = 00755; /*Replace this with the actual mode you want. Ideally you'd want to ask the user */
chmod("hi.txt", mode); /*This assumes hi.txt is present. You'd want to prompt the user for a filename in a real scenario */
@scifisamurai
scifisamurai / ruby_quick_reference.md
Created December 2, 2013 19:05
Ruby Quick Reference

Tell RVM to use a specific version of ruby and a specific gemset for a ruby/rails application.##

Files:
.ruby-version
.ruby-gemset

Example:
The following is for an app using "ruby-2.0.0" and a gemset named "example":

[~]$ cd example

@scifisamurai
scifisamurai / display.sh
Created August 28, 2011 14:14
Display files
#Prints the content of every file in your current directory
#Useful if you just wrote a few small files and want to see everything at a glance
#For each file:
#1. Display it's name preceded & succeeded by dashed lines
#2. Display the files contents
for i in * ; do echo "----"; printf "$i\n----\n" ; cat $i; done