Skip to content

Instantly share code, notes, and snippets.

View skmp's full-sized avatar

Stefanos Kornilios Mitsis Poiitidis skmp

View GitHub Profile
@skmp
skmp / dom-glitch.js
Last active August 29, 2015 13:56
Lets glitch that html
//paste into console, in ex. twitter.com or http://api.jquery.com/remove/ or ...
$('<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>').appendTo('body'); (function( $) {
var r=Math.random; Math.random = function() { return r()*1.3 -0.3; };items=$('body *').map(function(k,v) {
return ($.extend($(v).offset(), {$el: $(v ), background: $(v).css('background'), width: $(v).width(), height:
$(v).height()})); }); items.each(function(v,k) { k.$el.remove(); $('body').append(k.$el); k.$el.css({position:
"absolute", top: k.top, left: k.left, width: k.width, height: k.height, overflow: "hidden", power: (Math.random() -0.2)*
10}); }); setInterval(function() { items.each(function(v,k) { if (Math.random() > 0.9) { if (Math.random() > 0.8) {
k.$el.css({background: (function() { return "#" + Math.round(Math.random() * 999999); })()}) } else {
k.$el.css({background: k.background}) } }; if (Math.random() > 0.7) { k.$el.css({top:k.top +
Math.random()*10 * k.power*tp, left: k.left + Math.random()*10*tp,
/*
Adepted from http://forum.xda-developers.com/showthread.php?t=1944675
Original code by mamaich
Modified by skmp@nillware.com
*/
#include "pch.h"
#include "JitMagic.h"
PIMAGE_NT_HEADERS WINAPI ImageNtHeader(PVOID Base)
/*
To use, go the memrize course editor, open the record form for an item, press F12 / right click -> developer tools, copy paste this into the console and press enter.
Demo: https://www.youtube.com/watch?v=DICc-CHzGdg
Have fun and use responsibly.
NB. if the load on the tts server becomes too high, I'll take it down.
Host your own, https://github.com/skmp/numbers/blob/master/tts.php ...
*/
@skmp
skmp / test.cpp
Created May 20, 2013 15:35
Testing gist
void libCore_CDDA_Sector(s16* sector)
{
//silence ! :p
if (cdda.playing)
{
libGDR_ReadSector((u8*)sector,cdda.CurrAddr.FAD,1,2352);
cdda.CurrAddr.FAD++;
if (cdda.CurrAddr.FAD==cdda.EndAddr.FAD)
{
if (cdda.repeats==0)
@skmp
skmp / Console based injection.js
Last active December 31, 2015 05:49
Summaries by using my fork of textteaser!
// Open the debug tools
// load the function using
// This requires the target site to have jquery loaded as $
$('<script src="https://rawgithub.com/skmp/textteaser/master/tease.js"></script>').appendTo('body');
//Use directly from console
//(replace with proper selectors for your page)
tease($('.title-selector').text(), $('.content-selector').text())
$.ajax("https://raw.githubusercontent.com/reicast/reicast-emulator/master/core/emitter/generated_descriptors.h").then(function(a) {
var instructions = a.replace(/\,\n/g,"").replace(/\n/g,"").replace(/\,OP/g,"OP").split("s_LIST_END");
instructions = _.map(instructions, function(a) {
return _.chain(a.split("OP"))
.filter( function(a) { return a != ""})
.map(function(a) { return a.slice(1, -1).split(/(?!\([^),]*),(?![^(]*\))/); })
.map(function(a) { return _.object(["name", "bytes", "enc_param", "enc_imm", "byte_count", "param_1", "param_2", "param_3","opsz"],a) })
.map(function(a) { a.bytes = _(a.bytes.match(/0x[0-9a-f]*/ig)).map(function(a) { return parseInt(a); }); return a; }).value();
@skmp
skmp / reicast-cla-v1.md
Last active July 27, 2017 22:45
Reicast CLA v1

Individual Contributor License Agreement

Thank you for your interest in Reicast, created by Stefanos Kornilios Mitsis Poiitidis (the "Owner"). In order to clarify the intellectual property license granted with Contributions from any person or entity, the Owner must have a Contributor License Agreement ("CLA") on file that has been signed by each Contributor, indicating agreement to the license terms below. This license is for your protection as a Contributor as well as the protection of the Owner and its users; it does not change your rights to use your own Contributions for any other purpose. Please read this document carefully before signing and keep a copy for your records.

You accept and agree to the following terms and conditions for Your present and future Contributions submitted to the Owner. Except for the license granted herein to the Owner and recipients of software distributed by the Owner, You reserve all right, title, and interest in and to Your Contributions.

  1. Definitions.

"You" (or

//Example code for http://stackoverflow.com/questions/32025355/detect-if-c-lambda-can-be-converted-to-function-pointer
//Makes use of (adapted) remove_class from http://stackoverflow.com/questions/11893141/inferring-the-call-signature-of-a-lambda-or-arbitrary-callable-for-make-functio/12283159#12283159
#include <utility>
template<typename T> struct remove_class_ref { };
template<typename C, typename R, typename... A>
struct remove_class_ref<R(C::*)(A...)> { using type = R(*&)(A...); };
template<typename C, typename R, typename... A>
struct remove_class_ref<R(C::*)(A...) const> { using type = R(*&)(A...); };
@skmp
skmp / recover-labels.rb
Last active June 14, 2019 18:35
Used to recover reicast/reicast-emulator labels after the repo loss from the issue event stream
# Used to recover reicast/reicast-emulator labels after the repo loss
# The labels were missing, however the event stream was fine for each issue
# Uses octokit
require 'set'
require 'json'
require 'net/http'
require 'octokit'
client = Octokit::Client.new(:access_token => '<a personal access token>')
@skmp
skmp / refrend_hls.cpp
Last active March 12, 2021 14:33
FPGAdc: Getting started w/ HLS
/*******************************************************************************
What if you generated a PowerVR CLX2 ISP and TSP implementation with HLS?
Would it fit to the ultra96?
*******************************************************************************/
#include <cmath>
#include <algorithm>
#include <memory.h>