Skip to content

Instantly share code, notes, and snippets.

@Rarst
Rarst / getpatch.cmd
Last active September 20, 2023 14:00
Download a patch file from a GitHub branch. Arguments: repo name, branch name (e.g. `getpatch Rarst/wp-date trac-38771`).
curl https://github.com/%1/compare/master...%2.diff > patches/%2.diff
/*
Basic Sprite Shader for aligning pixel art to the same grid, based on the Unity Sprite Shader.
Create one Material where you assign the same Pixels Per Unit value you use on your imported Sprites,
then reuse this Material on all appropriate Sprite Renderers.
(You can use Shader.SetGlobalFloat to set that Pixels Per Unit value for all your shaders:
https://docs.unity3d.com/ScriptReference/Shader.SetGlobalFloat.html)
This is not for scaled or rotated artwork. If you need those features, look at low res render textures.
Use this however you want.
@gxespino
gxespino / ProgrammingManifesto.md
Last active February 4, 2021 01:01
Glenn's Path to Becoming a Ruby/Rails Programmer (Sept 2014 - Sept 2015)

#Programming Manifesto

##Books Ruby

  • Learn to Program by Chris Pine
  • The Well-Grounded Rubyist by David Black
  • Eloquent Ruby by Russ Olsen
  • Practical Object-Oriented Design in Ruby by Sandi Metz
  • Confident Ruby by Avdi Grimm
all: rust-for-rubyists.epub site
rust-for-rubyists.epub:
pandoc --toc -S -s --epub-metadata=book/metadata.xml -o rust-for-rubyists.epub book/title.txt book/preamble.md book/chapter-*.md
site:
pandoc -S -s book/preamble.md book/chapter-*.md -o book/book.html --include-before-body=book/header.html --include-after-body=book/footer.html
pandoc -S -s book/chapter-01.md -o book/chapter-01.html --include-before-body=book/header.html --include-after-body=book/footer.html
pandoc -S -s book/chapter-02.md -o book/chapter-02.html --include-before-body=book/header.html --include-after-body=book/footer.html
pandoc -S -s book/chapter-03.md -o book/chapter-03.html --include-before-body=book/header.html --include-after-body=book/footer.html
@pixelrevision
pixelrevision / PixelPerfectCam.cs
Last active January 26, 2024 05:23
Script for unity to create a pixel locked orthogonal camera
using UnityEngine;
/**
* A camera to help with Orthagonal mode when you need it to lock to pixels. Desiged to be used on android and retina devices.
*/
public class PixelPerfectCam : MonoBehaviour {
/**
* The target size of the view port.
*/
public Vector2 targetViewportSizeInPixels = new Vector2(480.0f, 320.0f);
/**
@bsodmike
bsodmike / howto.md
Last active August 30, 2017 04:15
HOWTO: Setup mail forwarding with Sendmail in Ubuntu 10.04 LTS

Copyright (c) 2011, Michael de Silva (michael@mwdesilva.com) Blog: http://www.bsodmike.com ~ Twitter: @bsodmike

Fix: 'config error: mail loops back to me (MX problem?)'

To prevent receiving config error: mail loops back to me (MX problem?) errors, you need to add each virtualdomain.tld to the /etc/mail/local-host-names file and re-compile your sendmail config via make.

You have asked mail to a domain (e.g., domain.net) to be forwarded to a specific host (in this case, relay.domain.net) by using an MX record, but the relay machine doesn't recognise itself as domain.net. Add domain.net to /etc/mail/local-host-names [known as /etc/sendmail.cw prior to version 8.10] (if you are using FEATURE(`use_cw_file')) or add "Cw domain.net" to your configuration file.

Source: http://www.sendmail.com/sm/open_source/support/support_faq/general_issues_faq/#4.5