Skip to content

Instantly share code, notes, and snippets.

View ivarprudnikov's full-sized avatar
🌍
Vivamus, moriendum est.

Ivar (aɪvɑr) ivarprudnikov

🌍
Vivamus, moriendum est.
View GitHub Profile
@ivarprudnikov
ivarprudnikov / .travis.yml
Created August 6, 2019 10:52
Enabling Android instrumentaiton tests on Travis CI. This was not working at the time due to Travis not being able to boot up emulator or similar.
language: android
sudo: required
jdk: openjdk8
android:
components:
# https://github.com/travis-ci/travis-ci/issues/5036
- tools
# The BuildTools version used by your project
- build-tools-28.0.3
const scrape = require('website-scraper')
const path = require('path')
const options = {
urls: ['https://path.to.website.com'],
directory: path.resolve(__dirname, '<folder name here>'),
recursive: false
}
scrape(options)
@ivarprudnikov
ivarprudnikov / build.gradle
Last active March 19, 2019 18:26
Adding SpotBugs v1.7.1 to gradle v5 project
import com.github.spotbugs.SpotBugsTask
// ...
plugins {
// ...
id "com.github.spotbugs" version "1.7.1"
}
// ...
@ivarprudnikov
ivarprudnikov / .travis.yml
Created June 28, 2018 08:55
Travis Android emulator setup. Emulator starts but espresso test still fails. Do not twiddle with version numbers as it was quite hard to get it right
language: android
sudo: required
jdk: openjdk8
env:
global:
- ANDROID_API=27
- EMULATOR_API=24
- ANDROID_BUILD_TOOLS=27.0.3
@ivarprudnikov
ivarprudnikov / test.groovy
Last active June 27, 2018 16:02
Stringtemplate example showing how to extract individual characters from a "String"
@Grapes([
@Grab('org.antlr:ST4:4.0.8'),
@GrabConfig(systemClassLoader = true)])
import org.stringtemplate.v4.ST;
Word word = new Word("1234567890AB")
println word.getTomap()
@ivarprudnikov
ivarprudnikov / load_pddocument
Created April 11, 2016 09:43
Check if PDF loads into PDDocument without IOException
@Grab(group='org.apache.pdfbox', module='pdfbox', version='2.0.0')
import org.apache.pdfbox.pdmodel.PDDocument
["url"].each { String url ->
boolean fails = false
try{
new URL("$url").withInputStream {
@ivarprudnikov
ivarprudnikov / deploy-node-to-elastic-beanstalk.sh
Last active August 19, 2022 19:49
Script to deploy node to elastic beanstalk
#!/bin/bash
# boto is missing dependency when using AWS tools to push to eb
# http://stackoverflow.com/questions/23365374/aws-aws-push-importerror-no-module-named-boto-in-ubuntu
sudo pip install boto
rm -rf eb_deployment
mkdir -p eb_deployment
cd eb_deployment
@ivarprudnikov
ivarprudnikov / structure
Last active August 29, 2015 14:15
ESA1 interactive PD model {field key} - {field value}, {class}
|--5-1 - , type=org.apache.pdfbox.pdmodel.interactive.form.PDTextbox
|--4-5 - , type=org.apache.pdfbox.pdmodel.interactive.form.PDTextbox
|--6-1 - , type=org.apache.pdfbox.pdmodel.interactive.form.PDTextbox
|--6-2 - , type=org.apache.pdfbox.pdmodel.interactive.form.PDTextbox
|--6-3 - , type=org.apache.pdfbox.pdmodel.interactive.form.PDTextbox
|--6-5 - , type=org.apache.pdfbox.pdmodel.interactive.form.PDTextbox
|--6-9 - , type=org.apache.pdfbox.pdmodel.interactive.form.PDTextbox
|--6-10 - , type=org.apache.pdfbox.pdmodel.interactive.form.PDTextbox
|--6-11 - , type=org.apache.pdfbox.pdmodel.interactive.form.PDTextbox
|--6-12 - , type=org.apache.pdfbox.pdmodel.interactive.form.PDTextbox
@ivarprudnikov
ivarprudnikov / README.md
Last active August 29, 2015 14:15
OSX Mongodb setup

Mongodb on Mac OSX

Download/setup mongodb

  • curl -O http://downloads.mongodb.org/osx/mongodb-osx-x86_64-2.6.7.tgz
  • cd /usr/share
  • sudo mkdir mongodb
  • chown -Rv {username} mongodb
  • cd mongodb
  • tar -zxvf ~/Downloads/mongodb-osx-x86_64-2.6.7.tgz
@ivarprudnikov
ivarprudnikov / gist:76d2fbd6b1015720fba8
Created February 10, 2015 21:50
Arduino Uno + Adafruit SSD1306 - etch a sketch
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
// If using software SPI (the default case):
#define OLED_MOSI 9 // data
#define OLED_CLK 10
#define OLED_DC 11
#define OLED_CS 12