Skip to content

Instantly share code, notes, and snippets.

View JamesMcMahon's full-sized avatar

James F McMahon JamesMcMahon

  • VMWare
  • Chicago, IL
View GitHub Profile
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active April 10, 2024 20:23
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;
}

Where you able to produce a binary directly from the Rust build tools that you could submit to the app/play store?


Not quite, but I tried to get as close to that as was reasonably possible. Alas, things ended up a little convoluted.

For iOS, I have a nearly empty Xcode project with a build script that copies my cargo produced executable into the .app that Xcode generates (before Xcode signs it). The build script also uses lipo to merge the executables for each architecture I’m targeting (e.g. armv7 and aarch64 for non-simulator devices) into a single, universal binary.

On top of that, there are various iOS-y things that need to happen before my application’s main method is called. SDL2 provides the Objective-C code that does all of that. In a C or C++ game, SDL2 renames main to SDL_main, and then [inserts its own mai

@jasongilman
jasongilman / atom_clojure_setup.md
Last active January 11, 2024 09:13
This describes how I setup Atom for Clojure Development.

Atom Clojure Setup

This describes how I setup Atom for an ideal Clojure development workflow. This fixes indentation on newlines, handles parentheses, etc. The keybinding settings for enter (in keymap.cson) are important to get proper newlines with indentation at the right level. There are other helpers in init.coffee and keymap.cson that are useful for cutting, copying, pasting, deleting, and indenting Lisp expressions.

Install Atom

Download Atom

The Atom documentation is excellent. It's highly worth reading the flight manual.

@josefnpat
josefnpat / readme.md
Last active April 7, 2024 11:39
Going from Lua 5.2 to PICO-8's Lua

This information applies to the PICO-8 0.1.6 release.

This document is here to help folks with a proficiency in Lua understand the limitations and discrepencies between Lua and PICO-8's Lua.

You can always view the manual or yellowafterlife's extended 0.1.1 manual.

General

  • anything written in uppercase the PICO-8 editor or .p8 is made lowercase by the editor. → editing the .p8 file directly can work
  • print(function() end) outputs the string function instead of the string function: 0x0000000.
@imkevinxu
imkevinxu / vidtogif.sh
Last active June 17, 2016 17:35
Convert an animated video to gif from http://chrismessina.me/b/13913393/mov-to-gif
# Convert an animated video to gif
# Works best for videos with low color palettes like Dribbble shots
#
# @param $1 - video file name like `animation.mov`
# @param @optional $2 - resize parameter as widthxheight like `400x300`
#
# Example: vidtogif animation.mov 400x300
# Requirements: ffmpeg and gifsicle. Can be downloaded via homebrew
#
# http://chrismessina.me/b/13913393/mov-to-gif
#! /usr/local/bin/fish
if test -n "$HOME" ;
set -xg NIX_LINK "$HOME/.nix-profile"
# Set the default profile.
if not test -L "$NIX_LINK" ;
echo "creating $NIX_LINK" >&2
set -l _NIX_DEF_LINK /nix/var/nix/profiles/default
/nix/store/cdybb3hbbxf6k84c165075y7vkv24vm2-coreutils-8.23/bin/ln -s "$_NIX_DEF_LINK" "$NIX_LINK"
end
@daemon3000
daemon3000 / TagsAndLayersTool.cs
Last active August 2, 2023 03:59
A tool for Unity that generates type safe tags and layers
#region [Copyright (c) 2014-2017 Cristian Alexandru Geambasu]
// Distributed under the terms of an MIT-style license:
//
// The MIT License
//
// Copyright (c) 2014-2017 Cristian Alexandru Geambasu(daemon3000@hotmail.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software
// and associated documentation files (the "Software"), to deal in the Software without restriction,
// including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
@Jellybit
Jellybit / CameraControl.cs
Last active September 4, 2023 04:23
Super Metroid style camera for Unity3D.
using UnityEngine;
using System.Collections;
// This is basically how the Super Metroid camera worked. Whichever direction you moved, the camera would
// move in the same direction a multiple of the player's speed. Once the center of the camera moved a
// certain distance from the player, the camera would lock on the player and move the same speed. Change
// movement direction, and the camera would once again move more quickly to catch up and place itself
// ahead of the player's movement.
// Super Metroid also had area limits and locked certain axes based on where you were. For instance, if

Backing up a GPG private key to a QR code

Use at your own risk! As with any backup method, test out your backup by restoring from it before you trust it.

  1. Install qrcode to generate the QR code:

     pip install qrcode
    
  2. Export the key, piping the output to qr, and save this to a png file:

@michaelbartnett
michaelbartnett / LICENSE.txt
Last active October 17, 2022 10:29
Tuple implementation for use with Unity3d
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit