Skip to content

Instantly share code, notes, and snippets.

View algorev's full-sized avatar

algorev

  • None Inc.
  • Switzerland
View GitHub Profile
openfl build neko
@algorev
algorev / main.hs
Created June 19, 2017 19:50
The code for a Haskell FizzBuzz program
main :: IO ()
main = putStrLn $ unlines fizzbuzz
fizzbuzz :: [String]
fizzbuzz = [if x `dividable` 3
then if x `dividable` 5
then "Fizzbuzz"
else "Fizz"
else "Buzz"
| x <- [1..100], x `dividable` 5 || x `dividable` 3]
@algorev
algorev / main.hs
Created June 19, 2017 19:49
Prime Generator Written In Haskell
module Main where
import Data.List
main :: IO ()
main = putStrLn $ unlines $ map show $ primesTo 100
primesTo :: Int -> [Int]
primesTo upTo = primesTo' [2..upTo] []
primesTo' :: [Int] -> [Int] -> [Int]
@algorev
algorev / main.hs
Created May 23, 2017 16:27
Haskell function to convert tidal scales (Sound.Tidal.Scales) into tidal patterns
-- Supply a base note and an Int list generated by one of the scale functions of Sound.Tidal.Scales
spat :: Int -> [Int] -> [Char]
spat note scale = unwords (map ((\x y -> show (x + y)) note) scale)
@algorev
algorev / main.hs
Created May 23, 2017 14:21
A Haskell function for tidal to convert a scale to a pattern
spat :: [Int] -> [Char]
spat scale = unwords (map (\x -> show x) scale)
@algorev
algorev / experimental.rb
Created May 19, 2017 15:30
The final code of an algorave session with Sonic Pi: the result is available here: http://www.newgrounds.com/audio/listen/745306
live_loop :dubstep do
use_synth :growl
play_pattern_timed [:c4, :f53, :c3], 1, amp: 2
end
live_loop :drums do
sample :loop_industrial
sample :misc_cineboom
sleep 0.9
end
@algorev
algorev / synthwave.rb
Created May 19, 2017 14:54
The final code of a personal algorave session with sonic pi. The result is here: http://www.newgrounds.com/audio/listen/745299
live_loop :bass do
use_synth :prophet
play_pattern_timed [:cs2, :d2, :g2].reverse, 0.5, cutoff: rrand(70, 90)
play_pattern_timed [:cs2, :fs2, :e2].reverse, 0.5, cutoff: rrand(80, 100)
end
live_loop :thing do
sample :bd_haus, cutoff: 90
sleep 0.5
end
#include "varcode.h"
int main()
{
int timetick = 0;
int result = 0;
char command[3] = {'o','\0'};
printf("VarCode v1.0, by Spooikypok_Dev");
while(command[0] != 'e')
{
@algorev
algorev / stdout
Created November 11, 2016 15:20
My tls negotiations with the smtp server
$ nc smtp.gmail.com 25 && printf "\n"
S: 220 smtp.gmail.com ESMTP c133sm12701941wme.12 - gsmtp
Me: helo someone
S: 250 smtp.gmail.com at your service
Me: mail from me
S: 530 5.7.0 Must issue a STARTTLS command first. c133sm12701941wme.12 - gsmtp
Me: starttls
S: 220 2.0.0 Ready to start TLS
Me: not me
S: F