Skip to content

Instantly share code, notes, and snippets.

// Q1. What is a variable? (Describe in your own words)
// Q2.
var a = 1;
var b = 2;
var x = 3;
function test(x,y) {
x = 10;
a = y;
@Pugio
Pugio / test.c
Last active April 4, 2017 16:35
test gist
// this is
int main() {
int i = 0;
printf("YO\n");
// an edit
return 0;
}
Falling
I started before I could walk
to be in practice for life, but forgot
early. by the time I was three
or four I was running and jumping
and no longer falling.
At twenty-nine I started learning
again. I fell short on my own
expectations and, on a date,
out of a canoe into a lake.
@Pugio
Pugio / configure.rb
Created October 26, 2015 15:03
Possible refactor of rubinius configure.
def detect_functions
[ [ "HAVE_CLOCK_GETTIME", "clock_gettime", ["time.h"], ]
[ "HAVE_NL_LANGINFO", "nl_langinfo", ["langinfo.h"]]
[ "HAVE_SETPROCTITLE", "setproctitle", ["sys/types.h", "unistd.h"]]
[ "HAVE_POSIX_FADVISE", "posix_fadvise", ["fcntl.h"]]
[ "HAVE_STRNLEN", "strnlen", ["string.h"]]
[ "HAVE_KQUEUE", "kqueue", ["sys/types.h", "sys/event.h", "sys/time.h"]]
[ "HAVE_TIMERFD", "timerfd_create", ["sys/timerfd.h"]]
[ "HAVE_INOTIFY", "inotify_init", ["sys/inotify.h"]]
[ "HAVE_GETTID", "gettid", ["unistd.d", "sys/types.h"]] ].each do |konst, func, sources|
@Pugio
Pugio / gist:16dd0a0f8ece7d506ac5
Created December 10, 2014 13:56
Text based adventure.
// set up the rooms/scenes
var Prompts = { A: "You are in room A. The doors are B, C.",
B: "You are in room B. The doors are A, D.",
C: "You are in room C. The doors are A, D.",
D: "You are in room D. The doors are B, C."
};
// start here
var response = prompt(Prompts['A']);
@Pugio
Pugio / gist:1367211
Created November 15, 2011 14:32
Python mount share
network_share_available = os.path.isdir(network_share_path)
if network_share_available:
logger.info("Share already connected.")
else:
logger.info("Connecting to share")
mount_command = "net use " + SHARE_PATH + " "
os.system(mount_command)
network_share_available = os.path.isdir(network_share_path)