Skip to content

Instantly share code, notes, and snippets.

View LB--'s full-sized avatar

LB--

  • Clickteam
View GitHub Profile
@potch
potch / gist_line_numbers.css
Created September 26, 2011 18:53
CSS to add line numbers to embedded gists
.gist-highlight {
border-left: 3ex solid #eee;
position: relative;
}
.gist-highlight pre {
counter-reset: linenumbers;
}
.gist-highlight pre div:before {
@Dinnerbone
Dinnerbone / gist:3736487
Created September 17, 2012 09:49
New Minecraft target selector syntax!

Syntax

All target selectors start with @. The following character is the selector type. For example, @p means 'closest player'.

Target selectors may have additional, optional arguments. You can specify these in [ ], using the syntax a=0. For example, @p[a=0,b=5,c=-500].

There is a special short syntax for just specifying x, y, z and r arguments; simply list their values separated by a comma, without x=. For example: @p[100,64,-100,5] for 5 range, x=100, y=64 and z=-100. Each of these are optional and skippable by leaving them empty. For example, to just specify y coordinate: @p[,64].

Global Arguments:

  • x - X coordinate for search center. Default is senders coordinate, or 0.
  • y - Y coordinate for search center. Default is senders coordinate, or 0.
@jcfr
jcfr / CMakeLists.txt
Last active September 7, 2021 17:54
CMake project allowing to build OpenSSL 32 and 64-bit for Windows and upload the associated "tar.gz" archives on http://packages.kitware.com
cmake_minimum_required(VERSION 2.8.10.2)
#
# This project allows to configure, build, archive and upload an OpenSSL install tree.
#
if(DEFINED UPLOAD_PACKAGE_SCRIPT)
set(MIDAS_URL "http://packages.kitware.com")
set(FOLDER_ID 203)
@LB--
LB-- / not in base 3
Created October 3, 2013 05:11
not in base 3 - One summer's day, long ago, I joined ClickConverse and was presented with an opportunity I could not pass up. It turned out better than I expected, and even funnier than I expected for the people that witnessed it. I'm just reposting this here since I'm not too trusting of pastebin.
[23:55] LB has entered the room
[23:55] <liquixcat> yeah cause 1111 is 15
[23:55] <Looki> like, the highest bit set
[23:55] <LB> not in base 3
[23:55] <Looki> is the magnitude
[23:55] LB has left the room
[23:56] <Looki> yo LB
[23:56] <RootKernel> xD
[23:56] <Looki> oh sh
[23:56] <RootKernel> quick draw
#include <iostream>
#include <tuple>
namespace
{
template<typename T>
using identity = T;
template<typename T, typename... V>
struct RAII_Set_impl
@0xabad1dea
0xabad1dea / weird-machines-video-games.md
Last active December 28, 2021 17:38
Weird Machines in Video Games

Abadidea's Index of Weird Machines in Video Games

A "weird machine" is when user-supplied input is able to create an arbitrary new program running within an existing program due to Turing-completeness being exposed. Sometimes such functionality was deliberately included but it is often the result of exploitation of memory corruption. You can learn more at the langsec site. There is a good argument for weird machines being inherently dangerous, but this index is just for fun.

It is broken into two categories: intentional gameplay features which may be used as weird machines, and exploit-based machines which can be triggered by ordinary player input (tool-assisted for speed and precision is acceptable). Games with the sole purpose of programming (such as Core Wars) are not eligible and plugin APIs don't count. If you know of more, feel free to add a comment to this gist.

Intentional Gameplay Mechanics

@LukeLeber
LukeLeber / gist:8838995
Created February 6, 2014 05:56
The KILLGPL License
(KILLGPL: Incompatible with Libraries Linked to the GPL)
============================================================================
"Free software" should be just that - free. Extreme copy-left licenses
such as the GPL, GPL2, GPL3, etc, and their users have twisted the
term "free" to meet their own anti-business, anti-closed source agendas by
forcing licensees to relicense their software under the same "viral" terms
and by forcing licensees to distribute sources with binary distributions.
This license stands in protest of such licenses in an attempt to protect
the freedoms that extreme copy-left licenses have been taking away from
@olasd
olasd / stream_to_youtube.sh
Created March 28, 2014 19:58
Stream video to youtube via ffmpeg
#! /bin/bash
#
# Diffusion youtube avec ffmpeg
# Configurer youtube avec une résolution 720p. La vidéo n'est pas scalée.
VBR="2500k" # Bitrate de la vidéo en sortie
FPS="30" # FPS de la vidéo en sortie
QUAL="medium" # Preset de qualité FFMPEG
YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2" # URL de base RTMP youtube
@mziwisky
mziwisky / Oauth2.md
Last active February 15, 2024 23:31
Oauth2 Explanation

OAUTH2

The Problem

I’m a web app that wants to allow other web apps access to my users’ information, but I want to ensure that the user says it’s ok.

The Solution

I can’t trust the other web apps, so I must interact with my users directly. I’ll let them know that the other app is trying to get their info, and ask whether they want to grant that permission. Oauth defines a way to initiate that permission verification from the other app’s site so that the user experience is smooth. If the user grants permission, I issue an AuthToken to the other app which it can use to make requests for that user's info.

Note on encryption

Oauth2 has nothing to do with encryption -- it relies upon SSL to keep things (like the client app’s shared_secret) secure.

package net.adamqpzm.steadfast;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.plugin.java.JavaPlugin;
public class Steadfast extends JavaPlugin implements Listener {