Skip to content

Instantly share code, notes, and snippets.

@nikore
nikore / calculate_grade.py
Created November 26, 2020 00:23
pam_assigment_2
#!/usr/bin/env python3
def convert_grade_to_letter(number_grade):
letter_grade = 'F'
if number_grade >= 90:
letter_grade = 'A'
elif number_grade >= 80:
letter_grade = 'B'
elif number_grade >= 70:
letter_grade = 'C'
@nikore
nikore / assignment.py
Last active November 21, 2020 11:35
python_main.py
#!/usr/bin/python2
class Menu:
def __init__(self, name, items, start_time, end_time):
self.name = name
self.items = items
self.start_time = start_time
self.end_time = end_time
def __repr__(self):
### Keybase proof
I hereby claim:
* I am nikore on github.
* I am nikore (https://keybase.io/nikore) on keybase.
* I have a public key whose fingerprint is 7691 6168 52BE A3C1 6DC0 2A89 CFA6 C634 64F3 97C4
To claim this, I am signing this object:
#!/bin/bash
cmd=${*}
# default to 10 seconds
SIGNAL_TIMEOUT=${SIGNAL_TIMEOUT:-10}
log() {
echo "[$(date +%s)] run.sh -- ${1}"
}
#
# Settings
#
font pango:monospace 8
set $ws1 work
set $ws2 web
set $ws3 code
set $ws4 music
@nikore
nikore / git-dmz-flow.md
Created April 26, 2017 18:58
git-dmz-flow

Git DMZ Flow

I've been asked a few times over the last few months to put together a full write-up of the Git workflow we use at RichRelevance (and at Precog before), since I have referenced it in passing quite a few times in tweets and in person. The workflow is appreciably different from GitFlow and its derivatives, and thus it brings with it a different set of tradeoffs and optimizations. To that end, it would probably be helpful to go over exactly what workflow benefits I find to be beneficial or even necessary.

  • Two developers working on independent features must never be blocked by each other
    • No code freeze! Ever! For any reason!
  • A developer must be able to base derivative work on another developer's work, without waiting for any third party
  • Two developers working on inter-dependent features (or even the same feature) must be able to do so without interference from (or interfering with) any other parties
  • Developers must be able to work on multiple features simultaneously, or at lea
#!/bin/sh
# Shell script to install your public key on a remote machine
# Takes the remote machine name as an argument.
# Obviously, the remote machine must accept password authentication,
# or one of the other keys in your ssh-agent, for this to work.
ID_FILE="${HOME}/.ssh/id_rsa.pub"
if [ "-i" = "$1" ]; then
#!/usr/bin/evn ruby
require 'rubygems'
require "yaml"
require 'open-uri'
web_contents = open('http://localhost:9292') {|f| f.read }
test = YAML::load(web_contents)
#!/usr/bin/env ruby
require 'rubygems'
require 'daemons'
require 'facter'
require 'yaml'
require 'rack'