Skip to content

Instantly share code, notes, and snippets.

View noherczeg's full-sized avatar

Norbert Csaba Herczeg noherczeg

View GitHub Profile
@noherczeg
noherczeg / ps_pid_kill.txt
Created November 27, 2020 08:28
ps pid kill
ps -ef | grep "KEYWORD" | awk '{print $2}'
alias killps="kill -9 `ps -ef | grep '[k]eyword' | awk '{print $2}'`"

Modal Verbs

Dürfen — “may”

Dürfen is the modal verb we use to say “may.” You might also think of it as translating to “to be permitted to” in English.

Here are a few examples of the verb dürfen, with and without a secondary infinitive verb. (When relevant, I’ll also include a literal translation with the word-by-word sentence order, to better illustrate the differences between English and German word order.)

Er darf Fußball nicht spielen.

He may not play soccer. / He is not permitted to play soccer. (Literally: “He may soccer not play.”)

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>HighCharts demo</title>
<script src="https://code.highcharts.com/stock/highstock.js"></script>
<script src="http://code.highcharts.com/maps/modules/map.js"></script>
</head>

AWS S3 with Cloudflare setup for static sites

We will use "cheers.mysite.com" as an example for bucket names, but remember that BUCKET NAMES MUST MATCH WITH EVENTUAL Cloudflare DOMAIN NAMES which is true even for domain names with sub-domains!

Full Domain S3 Bucket name CF/Type CF/Name CF/Content
mysite.com mysite.com A mysite.com mysite.com.s3-website.REGION_OF_BUCKET.amazonaws.com
cheers.mysite.com cheers.mysite.com CNAME cheers cheers.mysite.com.s3-website.REGION_OF_BUCKET.amazonaws.com

S3

  • register domain with godaddy
  • disable lock in Domain Settings > Additional Settings (otherwise cloudflare cannot take over)
  • cloudflare: add domain
  • godaddy: DNS > Manage Zones > provide name > Nnameservers > Change > provide 2 cloudflare DNS server addresses
  • subscribe to workers unlimited plan (otherwise you cannot use workers sites)

Wrangler

@noherczeg
noherczeg / git-proper-line-endings.md
Last active September 26, 2019 22:22
How to properly set up a project so that no file-ending related issues should occur

Setting up a project to utilize proper line endings

Git Configuration

Git should always check out every text file with LF. This needs to be ensured on a project level, so that environment specific settings do not interfere.

.gitattributes

* text=auto eol=lf

Editor Configuration

@noherczeg
noherczeg / my-component.e2e.ts
Created March 9, 2019 17:03
How to test Stencil events and event handling with Puppeteer
import { newE2EPage } from '@stencil/core/testing';
describe('my-component', () => {
it('should fetch data from jsonplaceholder when it receives a todoComplete event', async () => {
let requestURLs = [];
const page = await newE2EPage();
page.on('request', async (request) => {
requestURLs.push(request.url());
});
await page.setContent('<my-component></my-component>');
@noherczeg
noherczeg / puppeteer-shadow-query.ts
Created March 8, 2019 01:24
How to operate on multiple levels of shadow DOM elements
import puppeteer from 'puppeteer';
function queryShadow(...args: any[]): string {
const prop = args.pop();
const middle = args.map(a => `.querySelector('${a}')`).join('.shadowRoot');
return `document${middle}.${prop}`;
}
describe('my-component', () => {
it('renders', async () => {
https://sonarcloud.io/projects
https://travis-ci.org
https://docs.travis-ci.com/user/encryption-keys/#usage
https://docs.travis-ci.com/user/environment-variables/#defining-variables-in-repository-settings
https://github.com/SonarSource/sq-com_example_standard-sqscanner-travis
@noherczeg
noherczeg / gfr
Created July 10, 2018 09:03
git branch reset script with optional target branch parameter
#!/bin/bash
if [ $# -eq 0 ]
then
branch=$(git rev-parse --abbrev-ref HEAD)
else
branch=$1
fi
echo "--------------------------------"