Skip to content

Instantly share code, notes, and snippets.

View ilyazub's full-sized avatar
🇺🇦

ilyazub

🇺🇦
View GitHub Profile
@ilyazub
ilyazub / Converter.elm
Last active October 6, 2020 09:55
Elm practice
-- https://ellie-app.com/3P9hcDhdsc5a1
module Main exposing (Model, Msg(..), init, main, update, view, viewConverter)
import Browser
import Html exposing (Attribute, Html, div, input, span, text)
import Html.Attributes exposing (..)
import Html.Events exposing (onInput)
@ilyazub
ilyazub / App.css
Last active August 12, 2020 08:58
Build badge in React without SVG and no dependencies
.App {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
align-content: center;
}
@ilyazub
ilyazub / Bing_SVG_icon.md
Last active January 20, 2020 14:02
Bing SVG icon
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 35 50" fill="#fff">
  <path d="M35 24.25l-22.177-7.761 4.338 10.82 6.923 3.225H35V24.25z" opacity=".7"/>
  <path d="M10 38.642V3.5L0 0v44.4L10 50l25-14.382V24.25z"/>
</svg>

Preview

bing icon preview

@ilyazub
ilyazub / represent_matcher.rb
Last active May 17, 2019 15:09
RSpec matcher for grape-entity
# Alternative: https://github.com/agileanimal/grape-entity-matchers
RSpec::Matchers.define :represent do |expected|
match do |actual|
exposes? && aliases? && has_presenter? && has_runtime_exposure?
end
chain :as do |as_alias|
@as_alias = as_alias
end
@ilyazub
ilyazub / memory_usage.log
Created August 16, 2017 15:03
Spritesmith memory leak
{"rss":54697984,"heapTotal":36393760,"heapUsed":21949752}
{"rss":620531712,"heapTotal":65287968,"heapUsed":29065104}
{"rss":646225920,"heapTotal":64256032,"heapUsed":28251352}
{"rss":647573504,"heapTotal":64256032,"heapUsed":28290648}
{"rss":650907648,"heapTotal":64256032,"heapUsed":28326320}
{"rss":654422016,"heapTotal":64256032,"heapUsed":28348720}
{"rss":657559552,"heapTotal":64256032,"heapUsed":28380736}
{"rss":661073920,"heapTotal":64256032,"heapUsed":28401936}
{"rss":664236032,"heapTotal":64256032,"heapUsed":28430416}
{"rss":667480064,"heapTotal":64256032,"heapUsed":28447160}
@ilyazub
ilyazub / README.md
Last active December 19, 2016 10:39
Add missing require() calls and module.exports statements

Add missing require() calls and module.exports statements

npm run codemode:addMissingRequires

Find javascript files that are changed after creation of the new branch and run script placed in requireUndefined.js. It uses ESLint programmatic API.

codemode:addModuleExports

Find all javascripts inside app/components, filter by the lack of module.exports and apply jscodeshift transform placed in addModuleExports.js.

@ilyazub
ilyazub / rake_ssh_deploy.md
Last active August 29, 2015 14:08
Rake SSH deployment

Rake SSH deployment

Usage

Set up deployment folder

bundle exec rake deploy:setup

Update code and restart server

@ilyazub
ilyazub / upgrade_jasmine_specs.rb
Created February 14, 2014 15:05
Rake task for upgrading Jasmine specs from 1.3 to 2.0.
desc "Upgrade Jasmine specs to 2.0 syntax"
namespace :jasmine do
task :upgrade_specs do
Dir.glob('spec/javascripts/units/**/*_spec.js.coffee') do |filename|
specs = File.read(filename)
specs = specs.gsub('.andReturn', '.and.returnValue')
specs = specs.gsub('.andCallFake', '.and.callFake')
specs = specs.gsub('.andCallThrough', '.and.callThrough')