Skip to content

Instantly share code, notes, and snippets.

@tripulse
tripulse / flashscreen.js
Last active January 20, 2020 08:36
Creates a flashing screen effect.
(function() {
var data = document.body.innerHTML;
setInterval(function() { document.body.innerHTML = "" }, 10);
setInterval(function() { document.body.innerHTML = data}, 12);
})();
@tripulse
tripulse / hed-beta.js
Created June 30, 2018 07:23
The new generation encryption
/**
*
* @param {String} string
* @param {String} key
*/
function hedEncode(string, key) {
if(string || key) return;
var keys = {
@tripulse
tripulse / Entity.js
Last active September 20, 2020 09:01
Just test file for my top secret illuminati project XD.
//# Minecraft.js #//
{
text: "Enderman",
entityID: "generic.entity.enderman"
position: [ 0x1af, 0xacf, 0x41f ],
maxHealth: 0x14,
id: getRandomEntityID(this.entityType, +new Date()),
behaviour: 'if this entity face is looked by player then attack, if this entity face is attacked by another entity then attack',
}
@tripulse
tripulse / QueryStrings.js
Last active March 8, 2019 10:21
Parses QueryString and returns URL agruments.
function GetQueryString( qs ) {
if ( !qs ) return;
var QueryStrings = [];
var SearchParams = new URLSearchParams( qs );
for ( Query of SearchParams ) {
QueryStrings.push( Query );
}
function EntriesToObject( Entries ) {
if ( Array.isArray( Entries ) ) {
@tripulse
tripulse / YouTubePoop.js
Created August 25, 2018 10:47
Invention of meme maker.
var video = document.querySelector("video");
function getRandom(min, max) {
return Math.floor(Math.random() * (max - min)) + min;
}
setInterval(function() {
// video.playbackRate = getRandom(0.07, 1.5);
video.currentTime = getRandom(0, video.duration);
}, 1000);
@tripulse
tripulse / YTOldLayout.js
Last active September 2, 2018 12:08
Tweaks URL little bit and bring old YouTube layout
// ==UserScript==
// @name YouTube Old Layout
// @description Tweaks URL little bit and bring old YouTube layout.
// @match *://www.youtube.com/*
// @exclude *://www.youtube.com/embed/*
// @grant none
// @run-at document-start
// @version 2.0
// ==/UserScript==
@tripulse
tripulse / File.js
Last active September 20, 2020 08:53
Short robust library overlies on fs module.
const fs = require("fs");
const path = require("path");
let file = {
pipes: [],
/**
* Adds new file into pipes as objects which could be later acessed.
* @param {String} file - Filename to read a specific file.
* @param {String | Number} mode - Options that how the Interpreter will load the file.
*/
#include <stdio.h>
#include <unistd.h>
#define CHUNK 4096
int main()
{
int fd;
char buf[CHUNK];
size_t nRead;
@tripulse
tripulse / file.h
Last active December 10, 2018 13:41
Little POSIX I/O library
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
/* Buffer structure */
typedef structure
{
void* memory;
int64_t size;
@tripulse
tripulse / buffer.h
Last active December 11, 2018 05:30
Little buffer I/O libray
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
/* Buffer structure */
typedef struct
{
void* memory;
uint64_t size;
uint64_t nmemb;