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
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
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
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.
tmp = Tempfile.new("out")
tmp << "things"
tmp.close
puts File.read(tmp.path)
@DeTeam
DeTeam / Main.hs
Created May 29, 2012 16:37
Concept Codes
import Control.Monad
import Data.List
-- !! TODO: обернуть всю эту красоту в модуль, мб отдельные типы данных добавить
{-
Супер классная штука для формирования списка списков %)
Да, ее надо запомнить
module ConceptCode (
up,
down
) where
import Control.Monad
import Data.List
{-
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
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)
// It JavaScript it's okay to do like that:
friend.gift = function(){
var deferred = $.Deferred();
somewhenInFuture(function(gift){
deferred.resolve(gift);
})
return deferred.promise();
}