SDL_Init(SDL_INIT_AUDIO);
SDL_AudioSpec spec, aspec;
SDL_zero(spec);
spec.freq = 48000; //declare specs
spec.format = AUDIO_S16SYS;
spec.channels = 1;
spec.samples = 4096;
spec.callback = callback;
spec.userdata = NULL;
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
****** Org-agenda Vim Keybindings :orgmode:evil: | |
#+BEGIN_SRC emacs-lisp | |
(eval-after-load 'org-agenda | |
'(progn | |
(evil-set-initial-state 'org-agenda-mode 'normal) | |
(evil-define-key 'normal org-agenda-mode-map | |
(kbd "<RET>") 'org-agenda-switch-to | |
(kbd "\t") 'org-agenda-goto | |
"q" 'org-agenda-quit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Python version | |
class SnarlingBeastEvent(EncounterEvent): | |
title = "a snarling beast" | |
text = "a snarling beast leaps out of the underbrush." | |
enemy = 'snarling_beast' | |
damage = 1 | |
health = 5 | |
attack_delay = 1 | |
hit = 0.8 |
Qlobe is a fascinating example of quine in Ruby, submitted by a member of the Ruby core team - Yusuke Endoh.
Programs that output changed executable versions of themselves while managing to spin the globe and still remaining executable are cool, right?
To experience its magic, run the following
curl -fSSl https://gist.githubusercontent.com/shime/f0ebe84ca42c33b51d42/raw/5e74315dc6b6fe572f8a457536ad7eb17ad3f1e4/qlobe.rb > qlobe.rb; while true; do ruby qlobe.rb | tee temp.rb; sleep 1; mv -f temp.rb qlobe.rb; done
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;******************************************************************************** | |
; Move Windows by 1/3 | |
;******************************************************************************** | |
MoveCycle(Add) { | |
static SizeCycle = 0 | |
SizeCycle := Mod(SizeCycle + Add, 7) | |
if (SizeCycle < 0) { | |
SizeCycle := SizeCycle + 7 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
g_LastCtrlKeyDownTime := 0 | |
g_AbortSendEsc := false | |
g_ControlRepeatDetected := false | |
*CapsLock:: | |
if (g_ControlRepeatDetected) | |
{ | |
return | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* example C code using libcurl and json-c | |
* to post and return a payload using | |
* http://jsonplaceholder.typicode.com | |
* | |
* License: | |
* | |
* This code is licensed under MIT license | |
* https://opensource.org/licenses/MIT | |
* |