Skip to content

Instantly share code, notes, and snippets.

View andersevenrud's full-sized avatar
🤘
w^w^^w^w

Anders Evenrud andersevenrud

🤘
w^w^^w^w
View GitHub Profile
@perusio
perusio / file_exists.lua
Created February 14, 2012 05:36
Check if a file exists using nixio.
-- Playing with the nixio.fs library.
local nixiofs = require('nixio.fs')
-- Test if a file exists.
-- @param fname string
-- filename
-- @return boolean
-- true if file exists, false otherwise
--
@seiyria
seiyria / README.md
Last active January 8, 2018 04:29
Code Quality and You

update: this post has been moved to my blog

Welcome! Today I'd like to talk about another subject which can't be emphasized enough: Code Quality. This entails a lot of tools and patterns that ultimately come together to make your game more solid and programmer friendly. Even if you're working alone on a project, these tools can save you some precious debugging time by pointing out simple errors, if not more complex ones. I'll be using my current project, c as an example where possible.

A few notes before we get started:

  • Some of the following tools are specific to the JavaScript ecosystem.
  • Some of the following tools are only free for open source projects, so bear in mind that you might be missing out on the awesome!

Style Checking

Some of the easiest tools you can set up for your project are JSHint and JSCS. These tools provide basic st

@subimage
subimage / jquery-2.1.1.min.js
Last active August 20, 2018 19:44
Refined version of @nbriz's "Leave Facebook" collection
/*! jQuery v2.1.1 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */
!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l=a.document,m="2.1.1",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,
@Mailaender
Mailaender / cnc-rules.ini
Created July 7, 2014 06:57
Tiberian Dawn RULES.INI extracted from the binaries by @Nyerguds
; Command & Conquer RULES.INI
; If placed in game directory, it will not override built in values. Values to be used as
; multipliers or percentages can be specified as either a simple floating point number (embed ".")
; or as a conventional percentage number (append "%"). Values used as cell distances or time delays
; are specified as simple floating point number. Distance values are expressed in cells. Time
; values are expressed in minutes.
; This is not the real file because there is none - the C&C rules were hard-coded into the game.dat
; file (C&C95.exe in Win95 Edition). This is what the file could have been like, based on what
; editors/testing tells us, as well as what the values were in Red Alert, which is VERY similar to
@IngwiePhoenix
IngwiePhoenix / 00-readme.md
Created February 25, 2020 22:32
AEW's "cryptic" Dark Order message - decrypted. (Although...not that hard.)

AEW Cryptic Tweet translation

The following files all contain material used for conversion. I was bored so I wrote this tiny program as a way to warm up before working on some PHP and Laravel stuff.

I used NodeJS. The code is provided below.

If you want the output, scroll to the last file at the bottom.

Tested on NodeJS 13.9.0!

Thanks for reading! :)

@zhenkyle
zhenkyle / Arch Linux mkinitcpio: Possibly missing firmware for module.md
Created May 6, 2016 03:15
Arch Linux mkinitcpio: Possibly missing firmware for module

Problem

In Arch Linux mkinitcpio -p linux

shows

Possibly missing firmware for module: aic94xx
 Possibly missing firmware for module: wd719x
@djmaze
djmaze / spotify-stream.sh
Last active September 17, 2022 14:14
Serving Spotify audio through an MP3 stream via http (using Pulseaudio)
#!/usr/bin/env bash
#
# needs: Pulseaudio, VLC
# Load null sink module if not already loaded
pacmd list-sinks | grep steam 2>&1 >/dev/null
if [[ $? == 1 ]]; then
pactl load-module module-null-sink sink_name=steam;
fi
@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@oleq
oleq / _README.md
Last active January 7, 2024 10:38
A2DP audio streaming using Raspberry PI (Raspbian Jessie)

What is this all about?

This tutorial will turn your Raspberry PI into a simple Bluetooth audio receiver, which plays music through connected speakers. It's like a regular car audio system, but it can be used anywhere and it's a good value.

   Audio source (i.e. smartphone) 
                |
                v
 (((  Wireless Bluetooth Channel  )))
 |
@kyledrake
kyledrake / ferengi-plan.txt
Last active April 6, 2024 00:30
How to throttle the FCC to dial up modem speeds on your website using Nginx
# The blog post that started it all: https://neocities.org/blog/the-fcc-is-now-rate-limited
#
# Current known FCC address ranges:
# https://news.ycombinator.com/item?id=7716915
#
# Confirm/locate FCC IP ranges with this: http://whois.arin.net/rest/net/NET-165-135-0-0-1/pft
#
# In your nginx.conf:
location / {