Skip to content

Instantly share code, notes, and snippets.

View Heliosmaster's full-sized avatar
☀️

Davide Taviani Heliosmaster

☀️
View GitHub Profile
(ns minesweeper-dojo.core)
;; written by Davide Taviani and Mohammad Noureldin
(def input1 [3 1 1])
(defn is-full-of-mines? [rows cols mine-count]
(= (+ mine-count 1)
(* rows cols)))

Keybase proof

I hereby claim:

  • I am heliosmaster on github.
  • I am davide (https://keybase.io/davide) on keybase.
  • I have a public key whose fingerprint is F45A 8329 0B03 4310 6C5F 807F 7B03 AA14 4161 2ABB

To claim this, I am signing this object:

;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
#
# Sets Prezto options.
#
# Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
#
# General
#
@Heliosmaster
Heliosmaster / reclaimWindows10.ps1
Created January 7, 2017 19:45 — forked from alirobe/reclaimWindows10.ps1
"Reclaim Windows 10" turns off a bunch of unnecessary Windows 10 telemetery, removes bloatware, and privacy invasions. Review and tweak before running. Scripts for reversing are included and commented. Fork via https://github.com/Disassembler0 (different defaults)
##########
# Win10 Initial Setup Script
# Author: Disassembler <disassembler@dasm.cz>
# Version: 1.7, 2016-08-15
# dasm's script: https://github.com/Disassembler0/Win10-Initial-Setup-Script/
# THIS IS A PERSONALIZED VERSION
# This script leaves more MS defaults on, including MS security features.
# Tweaked based on personal preferences for @alirobe 2016-11-16 - v1.7.1

Keybase proof

I hereby claim:

  • I am heliosmaster on github.
  • I am davide (https://keybase.io/davide) on keybase.
  • I have a public key ASAO6rGvv_1jIwwfucCSJAl2ukRskLqbVLYAOoY-y9pPUAo

To claim this, I am signing this object:

find . -name "*.jpg" -exec convert -quality 75 {} /tmp/output/{} \;
@Heliosmaster
Heliosmaster / haversine.clj
Created November 24, 2017 09:25 — forked from shayanjm/haversine.clj
Haversine Formula implementation in Clojure
; Haversine formula
; a = sin²(Δφ/2) + cos φ1 ⋅ cos φ2 ⋅ sin²(Δλ/2)
; c = 2 ⋅ atan2( √a, √(1−a) )
; d = R ⋅ c
; where φ is latitude, λ is longitude, R is earth’s radius (mean radius = 6,371km);
(defn haversine
"Implementation of Haversine formula. Takes two sets of latitude/longitude pairs and returns the shortest great circle distance between them (in km)"
[{lon1 :lng lat1 :lat} {lon2 :lng lat2 :lat}]
(let [R 6378.137 ; Radius of Earth in km
(defn sha [data-bytes]
(apply str (map #(.substring (Integer/toString (+ (bit-and % 0xff) 0x100) 16) 1)
(.digest (MessageDigest/getInstance "sha1") (.getBytes data-bytes)))))
@Heliosmaster
Heliosmaster / core.clj
Last active December 12, 2018 19:34 — forked from skuro/forkme.md
Advent of Clojure solutions
(ns adventclj.core)
;; By Samuel McHugh and Davide Taviani
(defn compute-next [prev]
(-> prev
(* 252533)
(rem 33554393)))
(defn index [r c]