Skip to content

Instantly share code, notes, and snippets.

View archiewald's full-sized avatar
🍅

Artur Kozubek archiewald

🍅
View GitHub Profile
@archiewald
archiewald / names.md
Created January 5, 2019 11:23
[blog name] ideas for blog #blog
  • quackingabout.com
  • wequack.com
  • mequack.com
  • quackmeabout.com
  • quackbro.com
  • quackingaround.net
  • learnquack.com
  • quack.tips
  • typescript.tips
  • typescript.life
@archiewald
archiewald / notes.md
Last active January 8, 2019 06:27
[:last-of-type vs :last-child] #css

:last-of-type

/* :last-of-type selects any <p> that is the last element
   of its type among its siblings */
p:last-of-type {
  color: lime;
}
@archiewald
archiewald / howto.md
Created January 8, 2019 16:08
[merge remote branch to local] #git

Fetch the remote branch from the origin first

git fetch origin remote_branch_name

Merge the remote branch to the local branch

git merge origin/remote_branch_name
@archiewald
archiewald / note.md
Last active January 20, 2019 13:38
[Function as Children] #react #javascript

Used in react-dropzone docs

import React from 'react'
import classNames from 'classnames'
import Dropzone from 'react-dropzone'

class MyDropzone extends React.Component {
   onDrop = (acceptedFiles, rejectedFiles) => {
 // Do something with files
@archiewald
archiewald / howto.sh
Last active January 25, 2019 09:25
[rename file] #terminal
mv (option) file1.ext file2.ext
@archiewald
archiewald / snippet.sh
Created February 5, 2019 10:06
[clean copy of remote branch] #git
git reset --hard <remote>/<branch_name>
@archiewald
archiewald / snippet.sh
Created February 20, 2019 16:43
[change case in file name in git] #git #terminal
git mv src/routes/privacy/components/PrivacyPl.tsx src/routes/privacy/components/PrivacyPL.tsx
# MacOS is a case insensitive filesystem
@archiewald
archiewald / snippet.sh
Created February 21, 2019 08:31
[docx => markdown => html] convert docx to html with tools
pandoc -s document.docx -t markdown -o document.md
# Then use Markdown All in One plugin to convert to html
@archiewald
archiewald / FadeIn.tsx
Created March 20, 2019 15:11
[dynamic react element] #react #typescript
import * as React from 'react';
import * as classNames from 'classnames';
export interface FadeInProps {
when: boolean;
delay?: number;
duration?: number;
distance?: string;
order?: number;
className?: string;
@archiewald
archiewald / pre-push.sh
Last active March 26, 2019 20:20
[warn pushing to protected branches] #git
!/bin/bash
protected_branches=('master' 'develop')
current_branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,')
is_branch_protected=false;
for protected_branch in "${protected_branches[@]}"
do
if [ $protected_branch = $current_branch ]
then