Skip to content

Instantly share code, notes, and snippets.

View Im0rtality's full-sized avatar

Laurynas Veržukauskas Im0rtality

View GitHub Profile
[
{"id": "convert", "health": "healthy", "score": 100, "details": {"remainingTasks": 10000}, "input": null},
{"id": "enrich", "health": "healthy", "score": 100, "details": {"remainingTasks": 7000}, "input": "convert"},
{"id": "validate", "health": "healthy", "score": 100, "details": {}, "input": "enrich"}
]
@Im0rtality
Im0rtality / 00-install-mac.sh
Last active October 4, 2017 15:02
phanthomjs scraping demo
#/bin/sh
brew install phantomjs
brew install nodejs
echo {} > package.json
npm install jquery --save
phantomjs crawl.js
#!/bin/sh
# pass dir name of bin files as parameter
for file in $1*.bin.txt
do
letter=`echo $file | awk -F. '{print $1}'| awk -F/ '{print $2}'`
cat $file | sed "1d;$ d" | sort -r | awk -v OFS=', ' '{$1=""; $15="'$letter'"; print $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15}'
# to limit samples per class use line below instead
@Im0rtality
Im0rtality / main.css
Last active August 29, 2015 14:20
Test
.bg-blue-l
{
background-color: #007ea2;
}
.font-blue-l
{
color: #007ea2;
}
@Im0rtality
Im0rtality / README.md
Created April 1, 2015 21:25
Chocolatey provisioning

Chocolatey

https://chocolatey.org/

@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
@Im0rtality
Im0rtality / install puppet.sh
Last active August 29, 2015 14:16
Install puppet on debian wheezy
wget https://apt.puppetlabs.com/puppetlabs-release-wheezy.deb
sudo dpkg -i puppetlabs-release-wheezy.deb
sudo apt-get update
sudo apt-get install puppet
apt-get install -y build-essential ruby-dev
gem install librarian-puppet
@Im0rtality
Im0rtality / install-hhvm.sh
Last active August 29, 2015 14:11
HHVM @ nfq/wheezy-100
#!/bin/bash
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0x5a16e7281be7a449
echo deb http://dl.hhvm.com/debian wheezy main | sudo tee /etc/apt/sources.list.d/hhvm.list
sudo apt-get update
sudo apt-get install hhvm
export LC_ALL=C
sudo echo 'hhvm.libxml.ext_entity_whitelist = file,http' >> /etc/hhvm/php.ini
sudo echo 'date.timezone="Europe/Vilnius"' >> /etc/hhvm/php.ini
@Im0rtality
Im0rtality / 10-css.md
Last active August 29, 2015 14:08
Frontend 2/2 (CSS & JS)

1. CSS

Purpose - styling webpage

Problems

  • Duplication
  • Verbosity
  • Lack of semantic value
  • Handling other used assets
@Im0rtality
Im0rtality / 00-twbs-base.html
Last active August 29, 2015 14:07
Frontend 1/2 (HTML - the modern way)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrap 101 Template</title>
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet">
</head>
@Im0rtality
Im0rtality / checklist.md
Last active July 1, 2020 12:12
The Web API Checklist

REST API Checklist

Tried to keep list concise as possible. Following points are actual specs, de facto conventions or good pratices.

  • Use nouns, avoid verbs (/getAccount/123 => /accounts/123)
  • Plural form
  • Base url: https://api.example.com (prefered over https://example.com/api/)
  • Versioning: https://api.example.com/v2/ (alternative: Accepts: application/json;application&v=2)
  • camelCase (most APIs are JSON based, JSON is JavaScript, Underscores are not JS convention)
  • Timestamps (2004-02-12T15:19:21+00:00 - ISO8061)