Skip to content

Instantly share code, notes, and snippets.

@puttputt
puttputt / jtv.php
Created May 26, 2011 02:37
Check if justin.tv stream is live, display if it is
<?
//Script for Saskgamers.com
//Determines if a user's justin.tv stream is online, then displays it if it is
//To add more streams add the justin.tv channel id to the $streams array
$chan = "";
$streams = array(
"puttly", "j4sh", "strainkiss", "milfhunter", "gorgenzola", "steven_bonnell_ii"
);
echo "<span class=\"smalltext\"><strong>Live User Streams:</strong> ";
foreach ($streams as &$i) {
@Uflex
Uflex / clang-format_config.md
Last active November 3, 2019 16:19
Configuration of clang-format for QtCreator

Clang-format in QtCreator

Edit: QtCreator 3.1 introduced a new plugin called Beautifier that supports clang-format. You still have to install the clang tools separately but you don't have to add them as external tools anymore. The plugin can be configured in the options dialog under the beautifier tab > Clang Format. Add a new style and copy the configuration below without the curly braces.

QtCreator doesn't allow using clang-format by default. Watch QTCREATORBUG-10111 for a better integration. As of today, you should use it as an external tool, either replacing your selection or the entire file. If you choose to replace the file, you will have to save it before launching the tool and QtCreator will reload the file, making it impossible to undo/redo afterwards. If you choose to replace your selection, you often have to select the whole function, otherwise you will lose the indentation; clang-format doesn't seem to k

@mjtorn
mjtorn / xorg_build-0.5.sh
Created January 11, 2014 15:36
How to build Xorg unintrusively. Works on Debian Sid with xdm. At the time of posting this, at least.
#!/bin/bash
## Thank you for helping us help you help us all
SRCDIR=/usr/src/tmpfs/xorg
DSTDIR=/opt/xorg
## Define what's cloned
REPOS="\
git://anongit.freedesktop.org/git/xorg/util/macros \
@joecampo
joecampo / Connecting PHP 5.6 to MSSQL.md
Last active June 4, 2022 14:20
Connecting PHP 5.6 to MSSQL - Ubuntu (Debian) w/ Apache
@pdarragh
pdarragh / Jekyll Static Highlighting Navigation Menu.md
Last active September 30, 2023 10:43
Jekyll navigation bar with automatic highlighting.

Jekyll NavBar

In building a site powered by Jekyll and hosted by GitHub, I wanted the ability to highlight the current page's tab in the bar. I also wanted the bar to support second-level items (i.e. a dropdown), which proved somewhat tricky. This is the solution I arrived at after a few hours of fiddling around.

Construction

The contents of the navigation bar are contained in a data file located at _data/navigation.yml. This makes it accessible via the site-wide Liquid element {{ site.data.navigation}}. You can see the file for the formatting I used.

How it Works

@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.
local char_to_hex = function(c)
return string.format("%%%02X", string.byte(c))
end
local function urlencode(url)
if url == nil then
return
end
url = url:gsub("\n", "\r\n")
url = url:gsub("([^%w ])", char_to_hex)
@williewillus
williewillus / primer.md
Last active June 15, 2023 03:33
Capabilities: A Primer (tm)

Capabilities

Another award-winning primer by williewillus

Capabilities...a wondrous new system. That you've probably been forced into using. But let's not talk about that and get straight into the learning!

Terms and definitions

  • Capability System - This entire system; what this primer is about. This system is named very literally for what it does.
    • Capability - the quality of being capable; capacity; ability
  • Capable - having power and ability
@amadornes
amadornes / quickguide.md
Last active June 18, 2017 00:56
Quick guide to MCMultiPart 2

Hey! So you have a 1.11 mod and want to have a go at supporting MCMultiPart 2? Great! Let's get started!

I should first of all note that the API is NOT final, though the changes to it won't be very big and most likely won't affect you. Still, I would recommend doing this in a separate branch.

Depending on MCMP2

The first thing you'll want to do is add MCMP to your dev environment. You can read about that here: https://github.com/amadornes/MCMultiPart/blob/1.11/README.md
You'll need to use experimental builds because there is no stable build yet.

Creating an addon

@LexManos
LexManos / 1-THOUGHTS
Last active September 30, 2018 13:45
1.12 Recipe enhancements
Basic loading.
To be done on ServerInit. This means things will load multiple times on the client.
Benifits:
Allows us to just nuke the custom recipes every server init
Allows us to have save leve overrides.
Primes us for syncing recipe types/contents S->C {Not gunna happen in 1.12, but I expect Mojang to work twards this in 1.13+}
Cons:
Increases single player server load time. No known stats at the moment but shouldn't be TO bad
Loading Process: