Skip to content

Instantly share code, notes, and snippets.

View vilmibm's full-sized avatar
📼

Nate Smith vilmibm

📼
View GitHub Profile
#!/usr/bin/env python3
"""hiragana.py, by ~vilmibm. this is a little flash card script for the
hiragana alphabet, which i've been learning. maybe i'll have a katakana and
kanji flashcard quizzer soon, too ^_^"""
from random import choice
import sys
PAIRS = (
('あ', 'a'), ('い', 'i'), ('う', 'u'), ('え', 'e'), ('お', 'o'),
('か', 'ka'), ('き', 'ki'), ('く', 'ku'), ('け', 'ke'), ('こ', 'ko'),
@vilmibm
vilmibm / gist:177e5084c857891b1a4a47c97a6d6247
Created July 16, 2016 04:36
this just doesn't work at all
FROM debian:testing
MAINTAINER nathanielksmith <[email protected]>
EXPOSE 8000
RUN apt-get update
RUN apt-get -y install python3 python3-setuptools postgresql
RUN apt-get -y install ca-certificates build-essential
RUN apt-get -y install libffi-dev postgresql-server-dev-9.5 python3-dev
RUN service postgresql start
#RUN service postgresql status
RUN sleep 11
@vilmibm
vilmibm / blark.py
Created June 29, 2016 06:38
conditional mocking of open
def foop():
print(open('book.txt', 'r+').read())
print(open('/home/vilmibm/tmp/blark.py').read())
@vilmibm
vilmibm / django_girls_chromebook.md
Last active June 3, 2017 17:39 — forked from anonymous/django_girls_chromebook.md
Django Girls + Chromebooks

Chromebook + Django Girls == <3

Chromebooks are special in that you can't run your own software outside of the Chrome browser. This is fine if you're browsing the web or editing things in Google Docs, but it makes writing and running your own code slightly more challenging. It's possible to set your Chromebook to "developer mode" and use it like a traditional computer, but this is slightly advanced and also resets the computer to factory defaults.

To still get the benefits of the Django Girls tutorial, this installation guide sets you up with a tool that runs a fully fledged computer for you that you can access through your browser.

Cloud 9

First, we'll install a tool called Cloud 9 which will let us edit code, install software, and more. For the duration of the tutorial, Cloud 9 will act as your local machine. You'll still be executing commands in a terminal interface just like your classmates on OS X or Ubuntu, but the terminal will be remotely connected to a computer somewhere else that Clou

(schema/defn match-extensions? :- schema/Bool
"Returns true if the provided SSL extension map matches the configured ACE.
All of the keys in the ACE must appear in the extensions map and, if the value
for a key in the ACE is a list, at least one of the listed values must be set
in the incoming extensions map.
Note the behavior in the following scenario: If an ACE specifies
{:deny {:extensions {:pp_env 'test'
:pp_image 'bad image'}}}
/* starfield.c
*
* prints a simple ascii starfield
*
* Usage:
*
* gcc starfield.c -o starfield
* ./starfield 10 # generate 10 rows, 80 columns, 10% density
* ./starfield 50 20 # generate 20 rows, 80 columns, 50% density
* ./starfield 60 20 100 # generate 20 rows, 80 columns, 60% density
-----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC6XLW/ydCeM/j6PXA8g5BsaZBL
1wGDgHZVX4TkGXH3oo7+x93II0vteeZ53849P80wR5aNk3WlrHs/ieuAaPKFi/WL
3QEeuHxr3Hu3MiAhdX2z2tVuYH29uQz4I82a3J+RFMK9LSsn6ZFy/cb+hq5dDvZp
JIBKAMZ+ueA29qxs+QIDAQAB
-----END PUBLIC KEY-----
#[derive(Debug)]
struct Skill {
name: &'static str,
level: i32,
}
impl Skill {
fn improve(&mut self) -> &mut Self {
self.level += 1;
self
from random import randint
def d6():
return randint(1,6)
def explode():
print("explosion!")
next_roll = d6()
final = next_roll + 6
while next_roll == 6:
package com.puppetlabs.puppetserver;
import java.util.Map;
/**
*
* This interface is a bridge between the clojure/Java code and the ruby class
* `JRubyPuppet`. (defined in `src/ruby/puppet-server-lib/jruby_puppet.rb`.)
* The ruby class uses some JRuby magic that causes it to "implement" the Java
* interface.