Skip to content

Instantly share code, notes, and snippets.

@rontrek
rontrek / obfuscate.js
Created January 29, 2025 00:25 — forked from olastor/obfuscate.js
Simple algorithm to quickly obfuscate a string in javascript.
/**
* Obfuscate a plaintext string with a simple rotation algorithm similar to
* the rot13 cipher.
* @param {[type]} key rotation index between 0 and n
* @param {Number} n maximum char that will be affected by the algorithm
* @return {[type]} obfuscated string
*/
String.prototype.obfs = function(key, n = 126) {
// return String itself if the given parameters are invalid
if (!(typeof(key) === 'number' && key % 1 === 0)
@rontrek
rontrek / chat-frontend.js
Created January 22, 2023 01:22 — forked from martinsik/chat-frontend.js
Node.js chat frontend and server
$(function () {
"use strict";
// for better performance - to avoid searching in DOM
var content = $('#content');
var input = $('#input');
var status = $('#status');
// my color assigned by the server
var myColor = false;
@rontrek
rontrek / camera.cpp
Created August 13, 2022 23:00 — forked from krzygorz/camera.cpp
openGL FPS camera
#include <GL/glut.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include <unistd.h>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include "camera.h"
require 'hogehoge'
class Foo
def bar
puts "highlight test"
end
end
@rontrek
rontrek / source.cpp
Created July 4, 2022 12:27 — forked from wahidshafique/source.cpp
Unified OpenGL examples
static void CreateIndexBuffer()
{
unsigned int Indices[] = {
0, 3, 1,
1, 3, 2,
2, 3, 0,
0, 1, 2
};
glGenBuffers(1, &IBO);
@rontrek
rontrek / blur_float.cpp
Created September 5, 2021 06:36 — forked from bfraboni/blur_float.cpp
C++ implementation of a fast Gaussian blur algorithm by Ivan Kutskir - Integer and Floating point version
// Copyright (C) 2017 Basile Fraboni
// Copyright (C) 2014 Ivan Kutskir
// All Rights Reserved
// You may use, distribute and modify this code under the
// terms of the MIT license. For further details please refer
// to : https://mit-license.org/
//
//!
//! \file blur.cpp
@rontrek
rontrek / dialog.html
Created July 27, 2021 00:45 — forked from arthurattwell/dialog.html
Google Sheets script to allow multi-select in cells with data-validation (adapted from https://www.youtube.com/watch?v=dm4z9l26O0I)
<div style="font-family: sans-serif;">
<? var data = valid(); ?>
<form id="form" name="form">
<? if(Object.prototype.toString.call(data) === '[object Array]') { ?>
<? for (var i = 0; i < data.length; i++) { ?>
<? for (var j = 0; j < data[i].length; j++) { ?>
<input type="checkbox" id="ch<?= '' + i + j ?>" name="ch<?= '' + i + j ?>" value="<?= data[i][j] ?>"><?= data[i][j] ?><br>
<? } ?>
<? } ?>
<? } else { ?>