Skip to content

Instantly share code, notes, and snippets.

View CosineP's full-sized avatar

Luna P-C CosineP

View GitHub Profile
Gigabyte Z97 Motherboard
Intel i7 4790k CPU
Cooler - CoolerMaster RR-212E-20PK-R2 R
PSU - CORSAIR | CX750M 750W R
RAM
4 GB OEM RAM from an HP Pavilion p6-2326s
4 GB of a model I no longer have records on
8 GB - two 4 GB sticks called TEAM TPD38G1600C11DC01 R
Graphics - Gigabyte GTX970 |GV-N970WF3OC-4GD RT
SSD - 120G PNY SSD7CS1111-120-RB RTL
// Requires Math.floor if you don't have it already
import java.lang.Math.floor;
// [...]
// Loop in a diamond (that will be converted to zig-zag)
for (int y = -1; y <= 1; y++)
{
// X side of the diamond
Code:
int dx = Math.floor((x - y + (current.y&1)) / 2);
int dy = x + y;
Description:
The dx is most complex. If this is your diamond:
1 2 3
4 5 6
7 8 9
Then this is your zigzag (without the leading spaces for graphical representation) if you are on an even row
@CosineP
CosineP / url
Created November 27, 2016 20:24
https://software-download.microsoft.com/pr/Win10_1607_English_x64.iso?t=4d83f3de-57a1-447e-92f5-d4a17bd0af8b&e=1480364615&h=2b8da7467d17c78495fa4c7b345988ca
@CosineP
CosineP / instances.tab
Created January 15, 2018 18:46
all peertube instances
name registrations open?
peertube.cpy.re false
peertube2.cpy.re false
peertube3.cpy.re false
media.librenet.co.za false
video.hispagatos.org false
@CosineP
CosineP / background.js.patch
Created March 4, 2018 01:58
Make days only affect time periods, not time elapsed
diff --git a/background.js b/background.js
index 2f5db2f..22fab23 100644
--- a/background.js
+++ b/background.js
@@ -354,7 +354,7 @@ function checkTab(id, url, isRepeat) {
// Check time limit
let secsLeftBeforeLimit = Infinity;
- if (onSelectedDay && limitMins && limitPeriod) {
+ if (limitMins && limitPeriod) {
@CosineP
CosineP / update.gd
Last active April 12, 2018 13:33
Script for updating the game that demonstrates the windows-only HTTPRequest problem I'm having
extends HTTPRequest
func _ready():
connect("request_completed", self, "_request_completed")
# Check if we need an update
request("http://cosinegaming.com/static/vanagloria/version.json")
func _request_completed(result, response_code, headers, body):
if result != RESULT_SUCCESS:
print("ERROR: COULD NOT UPDATE. RESULT #" + str(result))
@CosineP
CosineP / lunaphippscostin.com-dns.txt
Created May 3, 2018 23:09
lunaphippscostin.com DNS records
FORMAT:
TYPE
HOST
VALUE
A Record
*
216.239.32.21
A Record
#!python
import os
target = ARGUMENTS.get("target", "debug")
platform = ARGUMENTS.get("platform", "windows")
bits = ARGUMENTS.get("bits", 64)
final_lib_path = 'bin/'
# This makes sure to keep the session environment variables on windows,
@CosineP
CosineP / main.cpp
Created July 14, 2018 21:45
A failing mumlib / portaudio program
#include "mumlib.hpp"
#include "portaudio.h"
#include <thread>
#define SAMPLE_RATE (8000)
#define print printf
mumlib::Mumlib *mumble;
int staticCallback(const void *inputBuffer, void *outputBuffer,
unsigned long framesPerBuffer,