Skip to content

Instantly share code, notes, and snippets.

View jrdmcgr's full-sized avatar

Jared McGuire jrdmcgr

  • Qgiv
  • Central Florida, USA
  • 17:12 (UTC -04:00)
View GitHub Profile
@jrdmcgr
jrdmcgr / docker-build.sh
Created February 7, 2014 14:59
Why won't docker build?
$ tree
.
├── Dockerfile
├── index.html
├── index.js
└── package.json
$ docker build .
Uploading context 6.144 kB
Uploading context
$ ansible vagrant -a 'ls /home'
vagrant-host | success | rc=0 >>
vagrant
$ ansible vagrant -a 'cd /home'
vagrant-host | FAILED | rc=2 >>
[Errno 2] No such file or directory
@jrdmcgr
jrdmcgr / js-adventures1.md
Last active August 29, 2015 13:57
Adventures in the JS Console: What happens when you do math with Javascript arrays?
> [] * []
0

Why is this?

Because, it seems that [] gets cast to a 0 when performing arithmetic.

import string
def is_pangram(sentence):
"""
A pangram is a sentence that contains every letter of the alphabet. This
function determines whether the given sentence is a pangram.
>>> is_pangram('the quick brown fox jumps over the lazy dog')
True
"""
# Robots
This is supposed to be the future. Where are my robot servants!?
The robots below could potentially be split up into a group of specialized robots.
Those independent robots could also potentially connect with each other and transform into a more powerful robot.
## Mailbot
/**
* Firefox custom CSS for Numix GTK Theme
* To use with Firefox Numix Theme : https://addons.mozilla.org/fr/firefox/addon/numix-gtk3theme/
* Better with Omnibar FIrefox Add-On : https://addons.mozilla.org/fr/firefox/addon/omnibar/
*/
@namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);
/* Awesomebar improvements */
#urlbar {
# first import the global
from global import myspecialglobal
# now import bootstrap which changes the global
import bootstrap
# what is the value of myspecial global?
print myspecialglobal
@jrdmcgr
jrdmcgr / weakref-example.ipynb
Last active August 29, 2015 14:09
Example of a weak reference.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
:- dynamic people/1.
:- dynamic portray_message/2.
:- use_module(library(prosqlite)).
set_gender(_, []).
set_gender(Sex, [Name|Names]) :-
sex(Name, Sex),
set_gender(Sex, Names).
@jrdmcgr
jrdmcgr / mortals.pl
Created August 24, 2015 01:01
mortals.pl
declare_mortals([]).
declare_mortals([X|Xs]) :- mortal(X), declare_mortals(Xs).
mortal(socrates).
main :-
OtherMortals = [plato, aristotle, philosoraptor],
declare_mortals(OtherMortals).
% ?- main.