Skip to content

Instantly share code, notes, and snippets.

View DeTeam's full-sized avatar
🍪
le cookie

Timur Amirov DeTeam

🍪
le cookie
View GitHub Profile
import Control.Concurrent
import Control.Concurrent.Async
import System.Random
delayedOutput :: String -> IO ()
delayedOutput m = do
gen <- newStdGen
let (t, _) = randomR (1, 10) ge
-- delay in microseconds
threadDelay (t * 1000000)
import Control.Concurrent
import Control.Concurrent.Chan
import System.Random
delayedOutput :: String -> Chan String -> IO ()
delayedOutput m c = do
gen <- newStdGen
let (t, _) = randomR (1, 10) gen
-- delay in microseconds
module ConceptCode (
up,
down
) where
import Control.Monad
import Data.List
{-
@DeTeam
DeTeam / Main.hs
Created May 29, 2012 16:37
Concept Codes
import Control.Monad
import Data.List
-- !! TODO: обернуть всю эту красоту в модуль, мб отдельные типы данных добавить
{-
Супер классная штука для формирования списка списков %)
Да, ее надо запомнить
tmp = Tempfile.new("out")
tmp << "things"
tmp.close
puts File.read(tmp.path)
import Data.List
import Data.List.Split
import Data.Maybe
import Data.Char
{-
http://projecteuler.net/index.php?section=problems&id=22
Using names.txt (right click and 'Save Link/Target As...'), a 46K text file containing over five-thousand first names, begin by sorting it into alphabetical order. Then working out the alphabetical value for each name, multiply this value by its alphabetical position in the list to obtain a name score.
Shoes.app(:title => 'FTP File Uploader', :width => 500, :height => 400, :resizable => false) do
require 'net/ftp'
background gradient rgb(255, 255, 255), rgb(150, 150, 150), :angle => 45
stack :margin => 20 do
caption 'FTP File Uploader'
flow :margin => 3 do
Shoes.app(:title => 'FTP File Uploader', :width => 500, :height => 400, :resizable => false) do
require 'net/ftp'
background gradient rgb(255, 255, 255), rgb(150, 150, 150), :angle => 45
stack :margin => 20 do
caption 'FTP File Uploader'
flow :margin => 3 do
Shoes.app(:title => 'FTP File Uploader', :width => 500, :height => 400, :resizable => false) do
require 'net/ftp'
background gradient rgb(255, 255, 255), rgb(150, 150, 150), :angle => 45
stack :margin => 20 do
end
end