Skip to content

Instantly share code, notes, and snippets.

View sergeysova's full-sized avatar
👋
Open to network

Sova sergeysova

👋
Open to network
View GitHub Profile
@sergeysova
sergeysova / generate-icns-from-svg.sh
Last active July 17, 2017 13:46 — forked from adrianorsouza/generate-icns.sh
Generate icns from iconset
#!/bin/bash
mkdir icon.iconset
convert -background none -size 16x16 -gravity center -extent 16x16 icon.svg icon.iconset/icon_16x16.png
convert -background none -size 32x32 -gravity center -extent 32x32 icon.svg icon.iconset/icon_16x16@2x.png
convert -background none -size 32x32 -gravity center -extent 32x32 icon.svg icon.iconset/icon_32x32.png
convert -background none -size 64x64 -gravity center -extent 64x64 icon.svg icon.iconset/icon_32x32@2x.png
convert -background none -size 64x64 -gravity center -extent 64x64 icon.svg icon.iconset/icon_64x64.png
convert -background none -size 128x128 -gravity center -extent 128x128 icon.svg icon.iconset/icon_64x64@2x.png
convert -background none -size 128x128 -gravity center -extent 128x128 icon.svg icon.iconset/icon_128x128.png
@sergeysova
sergeysova / gh-pages-deploy.md
Created March 7, 2017 12:23 — forked from cobyism/gh-pages-deploy.md
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@sergeysova
sergeysova / hkt.rs
Created February 26, 2017 09:49 — forked from 14427/hkt.rs
Higher-kinded type trait
use std::rc::Rc;
trait HKT<U> {
type C; // Current type
type T; // Type with C swapped with U
}
macro_rules! derive_hkt {
($t:ident) => {
impl<T, U> HKT<U> for $t<T> {
//добавляем svg тег в body
var svg = d3.select("body").append("svg");
svg.attr("height", 600)
.attr("width", 600)
.style('border','1px solid')
var data = [
{x: 80, y: 100},{x: 120, y: 100},
{x: 240, y: 200},{x: 280, y: 200}
var width = 600,
height = 600;
// массив точек для создания пути
var data = [
{x: 80, y: 100},{x: 120, y: 100},
{x: 240, y: 200},{x: 280, y: 200}
];
var svg = d3.select("body").append("svg");
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/4.4.3/d3.js"></script>
<style>
svg line{
stroke: grey;
stroke-width: 2;
}
svg path{
stroke: #808080;
stroke-width: 2;

Pattern Matching

This is a strawman proposal for adding pattern matching to ECMAScript. Pattern matching is useful for matching a value to some structure in a similar way to destructuring. The primary difference between destructuring and pattern matching are the use cases involved - destructuring is useful for binding pieces out of larger structures whereas pattern matching is useful for mapping a value's structure to data or a set of behaviors. In practice this means that destructuring tends to allow many shapes of data and will do its best to bind something out of it, whereas pattern matching will tend to be more conservative.

Additionally, the power of pattern matching is increased substantially when values are allowed to participate in the pattern matching semantics as a matcher as well as a matchee. This proposal includes the notion of a pattern matching protocol - a symbol method that can be implemented by objects that enables developers to use those values in pattern matching. A common scenario w

@sergeysova
sergeysova / .gitlab-ci.yml
Created January 24, 2017 15:25 — forked from thornbill/.gitlab-ci.yml
Example Node GitLab CI Yamlfile
# Official framework image. Look for the different tagged releases at:
# https://hub.docker.com/r/library/node/tags/
image: node:6
before_script:
- npm install
# This folder is cached between builds
# http://docs.gitlab.com/ce/ci/yaml/README.html#cache
cache:

@kangax's ES6 quiz, explained

@kangax created a new interesting quiz, this time devoted to ES6 (aka ES2015). I found this quiz very interesting and quite hard (made myself 3 mistakes on first pass).

Here we go with the explanations:

Question 1:
(function(x, f = () =&gt; x) {
@sergeysova
sergeysova / Java.md
Created December 7, 2016 12:23 — forked from JeOam/Java.md
Install Java 8 on OS X

on El Capitan, after installing the brew...

$ brew update
$ brew tap caskroom/cask
$ brew install Caskroom/cask/java

And Java 8 will be installed at /Library/Java/JavaVirtualMachines/jdk1.8.xxx.jdk/

Check version: