Skip to content

Instantly share code, notes, and snippets.

View skmp's full-sized avatar

Stefanos Kornilios Mitsis Poiitidis skmp

View GitHub Profile
//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...); };
/*
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 ...
*/
/*
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)
@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,
@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())
@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)