Skip to content

Instantly share code, notes, and snippets.

Avatar
🌌
Loading...

Yuriy Yakovenko djleonskennedy

🌌
Loading...
View GitHub Profile
@djleonskennedy
djleonskennedy / gist:9954d9b8b76896c5b080
Created Nov 4, 2014
E: Could not get lock /var/lib/dpkg/lock - open (11 Resource temporarily unavailable)
View gist:9954d9b8b76896c5b080
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
View gist:8ec5c7dad95142402328
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:ab42a04fbe6440f18f05
Created Nov 4, 2014
to avoid "Errors were encountered while processing: man-db"
View gist:ab42a04fbe6440f18f05
sudo -s
cd /var/cache/debconf
rm *.dat
apt-get update && apt-get upgrade
@djleonskennedy
djleonskennedy / gist:bd3f4ccf891b2abfcfef
Created Nov 19, 2014
node: No such file or directory` ubuntu
View gist:bd3f4ccf891b2abfcfef
sudo ln -s /usr/bin/nodejs /usr/local/bin/node
View Dan Abramov
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!
View isElementInViewport
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)
);
}
View App.elm
module App exposing (..)
import Html exposing (Html, div, text)
import Html.App
-- MODEL
type alias Model =
String
init: ( Model, Cmd Msg )
View CoolStuffToDestruct.elm
import Html exposing (text)
main =
let
(x, y, z) =
tuple
in
text <| toString <| x + y + z
View nestedSort.elm
[{item = { pid = 1 }, qty = 1 }, ...]
List.sortBy (.item >> .pid) listOfItems
View point-free.elm
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