Skip to content

Instantly share code, notes, and snippets.

🧀
cheese

Martin Muzatko MartinMuzatko

🧀
cheese
Block or report user

Report or block MartinMuzatko

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
View rock-paper-scissors.js
const WIN = 1
const LOSE = -1
const TIE = 0
const methods = ['rock', 'paper', 'scissor']
let score = 0
const gameMap = new Map([
['rock-paper', LOSE],
['rock-scissor', WIN],
View meow-subcommands.js
const meow = require('meow')
const prop = k => o => o[k]
const pipe = (...fns) => x => [...fns].reduce((acc, f) => f(acc), x)
const siconstore = () => ({
cli: meow(`
Usage
$ siconstore [command]
Available Commands
View boilerplate.js
const createAppsConfig = configFiles => ({
...configFiles,
config: configFiles.appInstances,
list: partial(list, [configFiles]),
get: partial(get, [configFiles]),
create: partial(create, [configFiles]),
edit: partial(edit, [configFiles]),
remove: partial(remove, [configFiles]),
update: partial(update, [configFiles]),
initApps: partial(initApps, [configFiles]),
View chunk.js
const chunk = (items, chunkSize) =>
[...Array(Math.round(items.length / chunkSize))]
.map((_, index) =>
items.slice(
index * chunkSize,
index * chunkSize + chunkSize))
// chunk([1,2,3,4,5], 2)
// [[1,2], [3,4], [5]]
View karaoke-songs
2 Chainz and Wiz Khalifa - We Own It
4 Non Blondes - What's Up .mp4
5 Seconds Of Summer - Amnesia
5 Seconds Of Summer - Beside You
5 Seconds Of Summer - Don't Stop
5 Seconds Of Summer - Good Girls
5 Seconds Of Summer - Heartbreak Girl
5 Seconds Of Summer - Hey Everybody!
5 Seconds Of Summer - Jet Black Heart
5 Seconds Of Summer - She Looks So Perfect
View echojs-scraper.js
// go to website, run script, abort when needed with `clearTimeout(interval)`
// harvest when done with console.log(scrapes)
$i('axios')
const base = `http://www.echojs.com/latest/`
const timeout = 500
async function scrape(id = 0) {
const { data } = await axios.get(base + id)
document.body.innerHTML = data
const articles = document.body.querySelectorAll('#newslist article')
View apps.js
const { ConflictError, LockedError } = require('restify-errors');
const apps = require('./apps');
const { UpdateLockedError, UpdateDisabledError } = require('./exceptions');
module.exports = server => {
server.post('/Apps/update', async function (req, res, next) {
try {
let response = await apps.updateAll();
res.send(200, response);
next()
View semantic-release.log
> # semantic-release --debug [±master ●●]
[12:02:19 PM] [semantic-release] › ℹ Running semantic-release version 15.9.12
semantic-release:config options values: { branch: 'master',
semantic-release:config repositoryUrl: 'ssh://git@appserver.de:7999/sg/sicon.git',
semantic-release:config tagFormat: 'v${version}',
semantic-release:config analyzeCommits: { preset: 'angular' },
semantic-release:config verifyConditions: [],
semantic-release:config generateNotes: { preset: 'angular', parserOpts: {} },
semantic-release:config prepare: [ { path: '@semantic-release/changelog' } ],
semantic-release:config publish: [],
View semantic-release.log
[sicon_master-2U3PIDBWVG233ME5SSYZKLF5UHTXGUK2VP7ZMOBNA6ANF3XH3KZA] Running shell script
+ semantic-release --debug
[08:46:34] [semantic-release] › ℹ Running semantic-release version 15.9.12
2018-09-05T08:46:34.858Z semantic-release:config options values: { branch: 'master',
repositoryUrl: 'ssh://git@my-bitbucket-repo.de:7999/sg/sicon.git',
View jenkins.log
Cloning the remote Git repository
Cloning with configured refspecs honoured and without tags
Cloning repository https://private-repo.com/myrepo.git
> git init /var/jenkins_home/workspace/myrepo_master-2U3PIDBWVG233ME5SSYZKLF5UHTXGUK2VP7ZMOBNA6ANF3XH3KZA # timeout=10
Fetching upstream changes from https://private-repo.com/myrepo.git
You can’t perform that action at this time.