Skip to content

Instantly share code, notes, and snippets.

View kris7t's full-sized avatar

Kristóf Marussy kris7t

View GitHub Profile
@kris7t
kris7t / gist:1042354
Created June 23, 2011 11:03
Archlinux rc.d script to power on/off the Optimus GPU manually, or through Bumblebee. Works on my Asus N53SV with no kernel panics.
We couldn’t find that file to show.
@kris7t
kris7t / FindInArchive.cxx
Created May 31, 2012 18:46
PACK file decompilation
SLibEntryRef __thiscall SFileSystem__FindInArchive(SFileSystem *this, int index, const char *str)
{
SLibEntryRef result; // qax@3
char name_offset; // ST13_1@14
const char *name; // ST18_4@14
unsigned __int8 name_length; // ST12_1@14
SFileSystem *self; // [sp+0h] [bp-14h]@1
int cmp; // [sp+8h] [bp-Ch]@14
SLibEntryHead *lib_entry; // [sp+Ch] [bp-8h]@13
SLibEntryRef *ref; // [sp+Ch] [bp-8h]@14
@kris7t
kris7t / gist:2850110
Created June 1, 2012 08:01
Patch S.W.I.N.E. v1.9 to support 800x600, 1366x768, 1920x1080, 1920x1200 (loses support for 1024x768, 1280x1024, 1600x1200).
This difference file has been created by IDA Pro
swine.exe
0012F735: 30 33
0012F736: 32 36
0012F737: 34 36
0012F741: 32 39
0012F742: 38 32
0012F747: 32 38
0012F748: 34 30
@kris7t
kris7t / gist:3137573
Created July 18, 2012 17:22
Remote debugging over SSH with JCuda
#!/usr/bin/env bash
HOST="chainstories.szigbp.hu"
PORT="57221"
USER="kris"
REMOTE_PATH="/home/${USER}/bme/ssl"
LOCAL_PATH="/home/${USER}/bme/ssl"
BINDIR="hu.kris.bme.semi_supervised_learning/bin"
JARFILES=(
$ irb
irb(main):001:0> RUBY_VERSION
=> "1.9.3"
irb(main):002:0> Kernel.fork { Random.rand(100000) }
=> 22594
(irb):2: [BUG] Segmentation fault
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]
-- Control frame information -----------------------------------------------
c:0027 p:---- s:0093 b:0093 l:000092 d:000092 CFUNC :rand
Sub Foobar
Dim Doc as Object
Dim Sheet as Object
Dim VariableCell as Object
Dim TargetCell as Object
Const LowerBound = -1
Const UpperBound = 5
@kris7t
kris7t / control.ps
Last active December 13, 2015 20:08
[
(Hudson-Nelson_*.pdf) { dup length string copy } 1000 string filenameforall
] % create array of filenames
{ lt } .sort % sort in increasing alphabetic order
/PN 1 def
{ /FN exch def
/PN currentpagedevice /PageCount get 1 add def % get current page count done (next is one greater)
FN run [ /Page PN /Title FN /OUT pdfmark % do the file and bookmark it by filename
} forall
originalMusic = \relative c' {
\time 4/4
c4\mf <d e>~\startTrillSpan <d e> f\>\stopTrillSpan | c-. <d e>-.~ <d e>-.\! f-.
}
\new Staff \with { instrumentName = "Orig."}
\originalMusic
\new Staff \with { instrumentName = "Stacc." }
\filterByArticulation "staccato" \originalMusic
\version "2.17.20"
\include "articulate.ly"
#(define (contains-articulation? a-type articulations)
(find (lambda (a)
(equal? (ly:music-property a 'articulation-type) a-type))
articulations))
@kris7t
kris7t / gist:6038247
Last active December 19, 2015 23:59
Transposition with Enharmonic Changes and ``Late-Binding'', now with error reporting!
\version "2.17.22"
beginning = \relative c'' {
\key as \major
c1
}
middlesection = \relative gis' {
\key e \major
gis1