Skip to content

Instantly share code, notes, and snippets.

View notblizzard's full-sized avatar
❄️
arctic fox

Blizzard notblizzard

❄️
arctic fox
  • Kentucky
  • 16:18 (UTC -04:00)
View GitHub Profile
@notblizzard
notblizzard / trianglefinder.py
Last active August 29, 2015 13:55
A way to find the missing side of a triangle.
from math import sin, cos, tan
#Work on Another Day.
def triangle_side_finder():
x = 0
answer = None
numbers = True
degree = input("What is the degree of the angle?")
while numbers == True:
try:
degree = int(degree)
import java.util.Calendar;
import java.util.GregorianCalendar;
public class day {
public static void main (String[] args) {
Calendar calendar = new GregorianCalendar();
int day = calendar.get(Calendar.DAY_OF_WEEK);
switch (day) {
case 1:
System.out.println("It\'s Sunday!");
package main
import "fmt"
func main() {
fmt.println("Hello, World.")
}
def authenticate
authenticate_or_request_with_http_basic do |user, pass|
Admin.find_by(user: user).try(:authenticate, pass)
end
end
def create
admin = Admin.find_by(user: params[:user])
if admin && admin.authenticate(params[:password]) != false
login admin
redirect_to root_path
else
redirect_to blog_index_path
end
end
let 2+2=5 in 2+2
--not mine, from http://www.codewars.com/kata/hamming-distance/solutions?show-solutions=1 by mtthw123
module Hamming where
hamming :: String -> String -> Int
hamming a b = length . filter id $ zipWith (/=) a b
func viewHandler(w http.ResponseWriter, r *http.Request) {
title := r.URL.Path[len("/view/"):]
p, _ := loadPage(title)
t, _ := template.ParseFiles("view.html")
t.Execute(w, p)
}
(('a'..'z').to_a - 'hello'.chars.to_a).empty?
from datetime import *
import time
import sys
while True:
date = datetime.now().strftime("%H:%M:%S")
sys.stdout.write(str(date)+'\r')
sys.stdout.flush()
time.sleep(1)