Skip to content

Instantly share code, notes, and snippets.

View tedb19's full-sized avatar
🎯
Focusing

Teddy Odhiambo tedb19

🎯
Focusing
View GitHub Profile
@tedb19
tedb19 / animations.css
Created June 11, 2016 09:00 — forked from DanWahlin/animations.css
Sample AngularJS animations.
.slide-animation.ng-enter, .slide-animation.ng-leave {
-webkit-transition: 0.5s linear all;
-moz-transition: 0.5s linear all;
-o-transition: 0.5s linear all;
transition: 0.5s linear all;
position:relative;
height: 1000px;
}
.slide-animation.ng-enter {
@tedb19
tedb19 / install-vbox-guest-additions.sh
Created September 29, 2016 06:44 — forked from parshap/install-vbox-guest-additions.sh
Install VirtualBox Guest Additions on a headless server
wget http://download.virtualbox.org/virtualbox/4.3.12/VBoxGuestAdditions_4.3.12.iso
sudo mkdir /media/iso
sudo mount -o loop ./VBoxGuestAdditions_4.3.12.iso /media/iso
sudo bash /media/iso/VBoxLinuxAdditions.run --nox11
sudo umount /media/iso
@tedb19
tedb19 / mirthconnect.service
Created November 1, 2016 09:27 — forked from bbhoss/mirthconnect.service
Mirth systemd descriptor for CentOS/RHEL 7. Just extract the mirthconnect tarball to /opt/mirthconnect, create a system user for mirth, chown accordingly, and install/enable this config file.
[Unit]
Description=Mirth Connect Interface Engine
After=network.target
[Service]
Type=forking
User=mirth
Group=mirth
ExecStart=/opt/mirthconnect/mcservice start
@tedb19
tedb19 / install-kafka.txt
Created October 9, 2018 09:14 — forked from jarrad/install-kafka.txt
Install Kafka on OSX via Homebrew
$> brew cask install java
$> brew install kafka
$> vim ~/bin/kafka
# ~/bin/kafka
#!/bin/bash
zkServer start
kafka-server-start.sh /usr/local/etc/kafka/server.properties
@tedb19
tedb19 / PostIndex.js
Created December 31, 2018 14:40 — forked from albertstill/PostIndex.js
Facebook Relay continuous scrolling example
class PostIndex extends React.Component {
state = { loading: false };
componentDidMount() {
window.onscroll = () => {
if (!this.state.loading
&& (window.innerHeight + window.scrollY)
>= document.body.offsetHeight) {
this.setState({loading: true}, () => {

Folder Structure

Motivations

  • Clear feature ownership
  • Module usage predictibility (refactoring, maintainence, you know what's shared, what's not, prevents accidental regressions, avoids huge directories of not-actually-reusable modules, etc)
@tedb19
tedb19 / iterm2.md
Created November 6, 2022 10:49 — forked from squarism/iterm2.md
An iTerm2 Cheatsheet

Tabs and Windows

Function Shortcut
New Tab + T
Close Tab or Window + W (same as many mac apps)
Go to Tab + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction + Option + Arrow Key
Cycle iTerm Windows + backtick (true of all mac apps and works with desktops/mission control)
@tedb19
tedb19 / setup-typescript-eslint-prettier.js
Created November 12, 2022 16:54 — forked from chill-cod3r/setup-typescript-eslint-prettier.js
Automate TypeScript ESLint Prettier + my opinionated ESLint rules
const fs = require('fs');
const cp = require('child_process');
const util = require('util');
const path = require('path');
const exec = util.promisify(cp.exec);
const writeFile = util.promisify(fs.writeFile);
const prettierConfigVscode = {
'editor.codeActionsOnSave': {

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.

Direct copy of pre-encoded file:

$ ffmpeg -i filename.mp4 -codec: copy -start_number 0 -hls_time 10 -hls_list_size 0 -f hls filename.m3u8