Skip to content

Instantly share code, notes, and snippets.

Avatar

Alexander "Ananace" Olofsson ananace

View GitHub Profile
View gist:9649624

Examples:

Ruby:

variable = 5

if variable > 4 then
    puts variable.to_s + " is over 4"
    puts "It's exactly five" if variable == 5
elsif variable == 4 then
View Sample Problem 2.rb
gets.to_i # I don't care about the number :D
gets # Friendships:
direct_friends = {}
indirect_friends = {}
until /Queries/ =~ (data = gets) do # Until it reads the line Queries:
names = data.split # Split on space
# Create entries in the friend dictionaries if they don't exist
View DynamicLinkedList.cpp
#include <iostream>
using namespace std;
int main(int argc, char* argv[]) {
// Node struct
struct Node {
int data;
Node *next;
};
@ananace
ananace / Script Interface.md
Last active Aug 29, 2015
LD31 Script Interface
View Script Interface.md

LD31 Script interface documentation

Global properties

Colors:

Color Colors::Black const
Color Colors::Blue const
@ananace
ananace / FindMyGUI.cmake
Created Mar 27, 2012
Findmygui changes
View FindMyGUI.cmake
# - Find MyGUI includes and library
#
# This module defines
# MYGUI_INCLUDE_DIRS
# MYGUI_LIBRARIES, the libraries to link against to use MYGUI.
# MYGUI_LIB_DIR, the location of the libraries
# MYGUI_FOUND, If false, do not try to use MYGUI
#
# Copyright © 2007, Matt Williams
#
@ananace
ananace / gist:6410128
Created Sep 2, 2013
Sublime Update script
View gist:6410128
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import re
import sys
import urllib2
from subprocess import call
from platform import machine
View gist:7023952
Current Server:
IP: 88.206.179.92
Port: 4567
Message:
Header - 5 bytes, network order:
Flags - 1 byte:
SYN - 1
ACK - 2
@ananace
ananace / Event.hpp
Created Apr 26, 2016
Simple C#-like event handling in C++11
View Event.hpp
#pragma once
#include <functional>
#include <vector>
template<typename... Args>
class Event
{
public:
typedef std::function<void(Args...)> EventHook;
@ananace
ananace / README.md
Last active Jan 28, 2018
Puppet SSL certs example for Kubernetes
View README.md

Kubernetes API cert with Puppet CA

Usage

  • Create the folder /etc/puppetlabs/puppet/ssl/manual_ca
  • Add the contents of the gist into there
  • Run kubernetes-cert.sh
  • Deploy the generated cert and private key onto your K8s master.
@ananace
ananace / 99-better-pa.patch
Created Mar 22, 2018
PA patch for qemu 2.11
View 99-better-pa.patch
diff --git a/audio/audio.c b/audio/audio.c
index beafed209b..6f42a019b0 100644
--- a/audio/audio.c
+++ b/audio/audio.c
@@ -2066,3 +2066,8 @@ void AUD_set_volume_in (SWVoiceIn *sw, int mute, uint8_t lvol, uint8_t rvol)
}
}
}
+
+int64_t audio_get_timer_ticks(void)