Skip to content

Instantly share code, notes, and snippets.

View IceDragon200's full-sized avatar

Corey Powell IceDragon200

View GitHub Profile
@fnky
fnky / ANSI.md
Last active May 7, 2024 09:24
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@chrismccord
chrismccord / phx-1.4-upgrade.md
Last active June 16, 2023 06:22
Phoenix 1.3.x to 1.4.0 Upgrade Guides

Phoenix 1.4 ships with exciting new features, most notably with HTTP2 support, improved development experience with faster compile times, new error pages, and local SSL certificate generation. Additionally, our channel layer internals receiveced an overhaul, provided better structure and extensibility. We also shipped a new and improved Presence javascript API, as well as Elixir formatter integration for our routing and test DSLs.

This release requires few user-facing changes and should be a fast upgrade for those on Phoenix 1.3.x.

Install the new phx.new project generator

The mix phx.new archive can now be installed via hex, for a simpler, versioned installation experience.

To grab the new archive, simply run:

@williewillus
williewillus / Primer.md
Last active July 16, 2023 03:18
1.8 rendering primer

1.8 Rendering Primer by williewillus (formatted to markdown by gigaherz)

Note: This primer assumes you are using MinecraftForge 1.8.9 build 1670 or above. Correctness not guaranteed otherwise. Note 2: This primer is for 1.8.x. Changes in 1.9 are on another gist: https://gist.github.com/williewillus/e37edde85dc78d2e138c

This guide is intended for those with a clear knowledge of general modding and want a quick up to speed on how new things work. If you are confused, please hop on IRC and ask for help!

Blocks and Items

  • 1.7: EVERY BLOCK SHAPE EVER was hardcoded into RenderBlocks or your ISBRH. Oh God, just look at that class. Actually don’t, if you value your sanity.
@hanabokuro
hanabokuro / string.rb
Last active September 22, 2015 19:09
String#undump
class String
def undump
self.sub(/\A"/, '').sub(/"\z/, '').gsub(/\\(x([0-9a-f]{2})) | \\(u\{([0-9a-f]{4})\}) | \\(.) /ix) {
if $1 # \xXX
[$2.hex].pack("C")
elsif $3 # \u{xxxx}
[$4.hex].pack("U")
else # \.
case $5
when 't'
@jm3
jm3 / looking for the mouse.md
Last active May 2, 2024 14:11
Gin, Television, and Social Surplus

Gin, Television, and Social Surplus, or, “Looking for the Mouse”

Clay Shirky / April 26, 2008

transcription of a speech [Clay Shirky] gave at the Web 2.0 in 2008, emphasis by @jm3

I was recently reminded of some reading I did in college, way back in the last century, by a British historian arguing that the critical technology, for the early phase of the industrial revolution, was gin.

The transformation from rural to urban life was so sudden, and so wrenching, that the only thing society could do to manage was to drink itself into a stupor for a generation. The stories from that era are amazing-- there were gin pushcarts working their way through the streets of London.

And it wasn't until society woke up from that collective bender that we actually started to get the institutional structures that we associate with the industrial revolution today. Things like public libraries and museums, increasingly broad education for children, elected leaders--a lot of th

@klange
klange / _.md
Last active December 2, 2023 20:36
It's a résumé, as a readable and compilable C source file. Since Hacker News got here, this has been updated to be most of my actual résumé. This isn't a serious document, just a concept to annoy people who talk about recruiting and the formats they accept résumés in. It's also relatively representative of my coding style.

Since this is on Hacker News and reddit...

  • No, I don't distribute my résumé like this. A friend of mine made a joke about me being the kind of person who would do this, so I did (the link on that page was added later). My actual résumé is a good bit crazier.
  • I apologize for the use of _t in my types. I spend a lot of time at a level where I can do that; "reserved for system libraries? I am the system libraries".
  • Since people kept complaining, I've fixed the assignments of string literals to non-const char *s.
  • My use of type * name, however, is entirely intentional.
  • If you're using an older compiler, you might have trouble with the anonymous unions and the designated initializers - I think gcc 4.4 requires some extra braces to get them working together. Anything reasonably recent should work fine. Clang and gcc (newer than 4.4, at le
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 7, 2024 06:03
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@scottwb
scottwb / application_controller.rb
Created February 17, 2012 06:12
Get a list of all the filters on a given Rails 3 controller.
# Add these methods to your ApplicationController. Then, any controller
# that inherits from it will have these methods and can programmatically
# determine what filters it has set.
class ApplicationController < ActionController::Base
def self.filters(kind = nil)
all_filters = _process_action_callbacks
all_filters = all_filters.select{|f| f.kind == kind} if kind
all_filters.map(&:filter)
end