Skip to content

Instantly share code, notes, and snippets.

View literat's full-sized avatar
:bowtie:
bowties are cool!

Litera Tomáš literat

:bowtie:
bowties are cool!
View GitHub Profile
@literat
literat / Add space to Dock.md
Created September 20, 2022 06:15
Mac OS tweaks
@literat
literat / npm_scripts.md
Created August 31, 2022 11:59
Parse npm args in scripts
@literat
literat / lerna-regenerate-changelog.md
Last active December 19, 2021 12:35
Lerna: Regenerate changelogs
npm i -D conventional-changelog-cli

npx lerna exec --concurrency 1 --no-sort --stream -- \
  conventional-changelog \
    --preset angular \
    --infile CHANGELOG.md \
    --same-file \
    --release-count 0 \
 --lerna-package \$LERNA_PACKAGE_NAME \
@literat
literat / MyComponent.js
Last active October 26, 2021 11:30
React test
import React, {Component} from 'react';
class Counter extends Component {
constructor(props) {
super(props)
}
render() {
<p>Counting: {this.props.count}</p>
}
@literat
literat / Article.php
Created August 3, 2020 12:33
Article
<?php
class Article
{
public function __construct()
{
$this->db = new PDO('mysql:host=localhost;port=2020;dbname=LMC', 'editor', '123xyz');
}
public function save($data)
{
$sql = 'INSERT INTO articles VALUES (' . $_GET['id'] . ', ' . $data['title'] . ', ' . $data['content'] . ')';
@literat
literat / Jenkins Multibranch Pipeline Webhooks.md
Last active March 27, 2020 14:06
Jenkins Multibranch Pipeline Webhooks

How to send webhook payload or parameters to Jenkins Multibranch Pipeline from Bitbucket Server

  1. use Generic Webhook Trigger to send payload
  • but it will work only if the workspace in Jenkins is created
  • you must rescan branches first
  1. use Multibranch Scan Webhook Trigger
  • it runs rescan of branches when new branch is created

References:

@literat
literat / fizbuzz.js
Created March 11, 2020 11:04
FizzBuzz
for(i=0;i++<100;console.log((i%3?'':'Fizz')+(i%5?'':'Buzz')||i));
@literat
literat / sonar_qube_jenkins.md
Last active June 18, 2019 13:56
SonarQube + Jenkin s Pipelines
@literat
literat / React_App_Directory_Structure.md
Last active November 5, 2022 13:24
React Application Folder/Directory Structure

React App Folder/Directory Structure

move files around until it feels right

-- Dan Abramov

My directory structure

├── bin         - shell scripts for CI and other project maintenance
@literat
literat / Git_Fixup.md
Last active January 2, 2019 08:57
Git Fixup to most recent commit

Git Fixup

~/.bin/git-log-vgrep-most-recent-commit

#! /bin/bash

if (( $# < 1 )); then
  echo >&2 "Usage: $0 pattern [<since>..<until>]"
 exit 1