Skip to content

Instantly share code, notes, and snippets.

View djleonskennedy's full-sized avatar
🌌
Loading...

Yuriy Yakovenko djleonskennedy

🌌
Loading...
View GitHub Profile
@djleonskennedy
djleonskennedy / gist:ab42a04fbe6440f18f05
Created November 4, 2014 21:59
to avoid "Errors were encountered while processing: man-db"
sudo -s
cd /var/cache/debconf
rm *.dat
apt-get update && apt-get upgrade
@djleonskennedy
djleonskennedy / gist:9954d9b8b76896c5b080
Created November 4, 2014 22:37
E: Could not get lock /var/lib/dpkg/lock - open (11 Resource temporarily unavailable)
sudo rm /var/lib/apt/lists/lock
You may also need to delete the lock file in the cache directory
sudo rm /var/cache/apt/archives/lock
@djleonskennedy
djleonskennedy / gist:8ec5c7dad95142402328
Last active August 29, 2015 14:08
ubuntu start optimizer
Enable ctrl-alt-backspace to kill xserver
sudo apt-get install gnome-tweak-tool
to launch type:
gnome-tweak-tool
Install pipelight so silverlight works
sudo apt-add-repository ppa:pipelight/stable
sudo apt-get update
sudo apt-get install pipelight-multi
@djleonskennedy
djleonskennedy / gist:bd3f4ccf891b2abfcfef
Created November 19, 2014 13:34
node: No such file or directory` ubuntu
sudo ln -s /usr/bin/nodejs /usr/local/bin/node
Write some components, let them dispatch actions.
Write some reducers to handle those actions.
Wrap some components in connect() to receive the next state.
Repeat!
function isElementInViewport(el) {
var rect = el.getBoundingClientRect();
return (
rect.top >= 0 &&
rect.left >= 0 &&
rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) &&
rect.right <= (window.innerWidth || document.documentElement.clientWidth)
);
}
module App exposing (..)
import Html exposing (Html, div, text)
import Html.App
-- MODEL
type alias Model =
String
init: ( Model, Cmd Msg )
import Html exposing (text)
main =
let
(x, y, z) =
tuple
in
text <| toString <| x + y + z
[{item = { pid = 1 }, qty = 1 }, ...]
List.sortBy (.item >> .pid) listOfItems
import Html exposing (text)
transform : List Int -> List Int
transform =
List.map ((*) 2)
<< List.filter (flip (%) 2 >> (==) 0)
main =
[1,2,3,4,5,6,7,6,2]
|> text