Skip to content

Instantly share code, notes, and snippets.

Illia Zub ilyazub

Block or report user

Report or block ilyazub

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
@ilyazub
ilyazub / README.md
Created Aug 9, 2019
Reuse `puppeteer` cookies in `tough-cookie` and `got`
View README.md

Reuse puppeteer cookies in tough-cookie and got

This way we can send HTTP requests from the Node.js instead of UI interactions.

Set puppeteer cookies to tough-cookie's CookieJar

const cookies = await page.cookies()
cookies.forEach(
  async cookie => {
    await setCookie(
@ilyazub
ilyazub / memory_usage.log
Created Aug 16, 2017
Spritesmith memory leak
View memory_usage.log
{"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 Dec 19, 2016
Add missing require() calls and module.exports statements
View README.md

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 Aug 29, 2015
Rake SSH deployment
View rake_ssh_deploy.md

Rake SSH deployment

Usage

Set up deployment folder

bundle exec rake deploy:setup

Update code and restart server

@ilyazub
ilyazub / excel_xml_spreadsheet_example.md
Last active Aug 10, 2019
Excel 2003 XML Spreadsheet example
View excel_xml_spreadsheet_example.md

Excel 2003 XML Spreadsheet example

Solved errors

Problem During Load because of wrong ss:ExpandedRowCount.

If this value is out-of-sync with the table, the specified XML Spreadsheet document is invalid.

Check out XML Spreadsheet Reference for details.

Problem During Load because of empty rows and cells. Check out Table options.

@ilyazub
ilyazub / represent_matcher.rb
Last active May 17, 2019
RSpec matcher for grape-entity
View represent_matcher.rb
# 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 / upgrade_jasmine_specs.rb
Created Feb 14, 2014
Rake task for upgrading Jasmine specs from 1.3 to 2.0.
View upgrade_jasmine_specs.rb
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')
You can’t perform that action at this time.