Skip to content

Instantly share code, notes, and snippets.

punund

  • Rīga, Latvia
Block or report user

Report or block punund

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@punund
punund / data.json
Last active Jan 9, 2016
owidget: предлагаемый формат
View data.json
{
"count": 10,
"locale": "en_UK",
"product": [
{
"name": "KD55X8509C Smart 3D Ultra HD 4k 55\" LED TV",
"maker": "Sony",
"brand": "Bravia",
"price": {
"amount": 102.95,
View hi.js
(function (){ var slice = [].slice;var hasProp = {}.hasOwnProperty;var bind = function(fn, me){return function(){ return fn.apply(me, arguments); };};var extend = function(child, parent) {for (var key in parent) {if (hasProp.call(parent, key)) child[key] = parent[key];}function ctor() { this.constructor = child; }ctor.prototype = parent.prototype;child.prototype = new ctor();child.__super__ = parent.prototype;return child;};var indexOf = [].indexOf || function(item) {for (var i = 0, l = this.length; i < l; i++) {if (i in this && this[i] === item) return i;} return -1; };var modulo = function(a, b) { return (+a % (b = +b) + b) % b; }; return function () {
return alert('hi');
};})();
View trees.hs
data Tree a = Node a (Forest a)
type Forest a = [Tree a]
View ride.hs
leap Coor Int2 WithProblem Maybe Move
leap src dxy = do
let dst = src ~+ dxy
sqr squareAtM dst
kind captureM $ colorOnSquare sqr
return $ case kind of
SimpleMove -> [ Relocate src dst ]
CaptureMove -> [ Vacate dst, Relocate src dst ]
-- | linear movement by vector ij :: Int2
@punund
punund / list-monad.hs
Last active Oct 30, 2015
List monad in action
View list-monad.hs
{- монада это необязательно последовательное исполнение -}
import Control.Monad
newlist [(Int, Int)]
newlist =
do x <- [1..3]
y <- [11..12]
guard $ x + y > 13
return (x, y)
View gist:83f640c7845e149aa7b1
FROM ubuntu
RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get install postfix postfix-pcre -y --force-yes
RUN DEBIAN_FRONTEND=noninteractive apt-get install syslog-ng syslog-ng-core -y --force-yes
ADD etc /etc/
RUN cp /etc/resolv.conf /etc/services /var/spool/postfix/etc/
@punund
punund / mass-rename
Last active Aug 29, 2015
переименовать файлы
View mass-rename
for i in *; do
((c=0))
for j in $i/*; do
((c++))
mv $j $j-$c
done
done
@punund
punund / dokku.log
Created Feb 11, 2015
dokku deploy www
View dokku.log
++ id -un
+ [[ root != \d\o\k\k\u ]]
+ [[ deploy != plugins-install* ]]
+ [[ deploy != \p\l\u\g\i\n\s\-\u\p\d\a\t\e ]]
+ sudo -u dokku -E -H /usr/local/bin/dokku deploy www
++ id -un
+ [[ dokku != \d\o\k\k\u ]]
+ [[ -n '' ]]
+ case "$1" in
+ APP=www
@punund
punund / angular-inspect
Created Jan 28, 2015
How to check Angular service from console
View angular-inspect
angular.element(document.querySelector('.ng-scope')).injector().get('MyService')
You can’t perform that action at this time.