Skip to content

Instantly share code, notes, and snippets.

View amirrajan's full-sized avatar
💭
Working on DragonRuby Game Toolkit and RubyMotion

Amir Rajan amirrajan

💭
Working on DragonRuby Game Toolkit and RubyMotion
View GitHub Profile
@amirrajan
amirrajan / curltest.c
Created November 24, 2021 19:24 — forked from aaronhurt/curltest.c
example code using libcurl and json-c to post and parse a return from http://jsonplaceholder.typicode.com
/**
* 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
*
@amirrajan
amirrajan / esctrl.ahk
Created October 30, 2020 12:36 — forked from JustinJohnWilliams/esctrl.ahk
esc ctrl remaps
g_LastCtrlKeyDownTime := 0
g_AbortSendEsc := false
g_ControlRepeatDetected := false
*CapsLock::
if (g_ControlRepeatDetected)
{
return
}
@amirrajan
amirrajan / win.ahk
Created October 30, 2020 12:35 — forked from JustinJohnWilliams/win.ahk
Move windows by 1/3
;********************************************************************************
; Move Windows by 1/3
;********************************************************************************
MoveCycle(Add) {
static SizeCycle = 0
SizeCycle := Mod(SizeCycle + Add, 7)
if (SizeCycle < 0) {
SizeCycle := SizeCycle + 7
}
@amirrajan
amirrajan / README.md
Created September 29, 2019 21:46 — forked from shime/README.md
The Qlobe - by Yusuke Endoh

Qlobe

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
@amirrajan
amirrajan / explanation.md
Created August 7, 2019 18:24 — forked from AnanthVivekanand/explanation.md
Basic sound synth using SDL_audio, with some examples of frequency manipulation on a sine wave.
	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;
@amirrajan
amirrajan / 00_encounters.py
Last active March 30, 2022 15:39 — forked from eevee/encounters-meta.py
Enemy encounter definition with loot drop probabilities: Python vs JS vs Lua vs Ruby
# 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
****** 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