Skip to content

Instantly share code, notes, and snippets.

View kirubz's full-sized avatar
🎯
Focusing

Kirubaharan Palani kirubz

🎯
Focusing
View GitHub Profile
@kirubz
kirubz / email_sendfile.lua
Created November 13, 2018 03:32 — forked from Danukeru/email_sendfile.lua
A simple LUA script to send an e-mail with an attachment.
-- requires an SMTP server to send emails
local smtp = require("socket.smtp")
local ltn12 = require("ltn12")
local mime = require("mime")
from = "<me@my.email.com>"
rcpt = {
"<somebob@testemail.com>"
@kirubz
kirubz / mysql-docker.sh
Created March 20, 2019 16:13 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@kirubz
kirubz / README.md
Created April 2, 2022 17:13 — forked from IanVaughan/README.md
Push branch from one remote into another

Push branch from one remote into another

Add remote2 as a remote

$ git remote -v
remote2 git@github.com:repo2.git (fetch)
remote2 git@github.com:repo2.git (push)
origin  git@github.com:repo.git (fetch)
origin  git@github.com:repo.git (push)
@kirubz
kirubz / TimeAgo.jsx
Created August 22, 2024 16:00 — forked from johndavedecano/TimeAgo.jsx
TimeAgo component using date-fns
import React, {Component} from 'react';
import differenceInSeconds from 'date-fns/difference_in_seconds';
import distanceInWordsToNow from 'date-fns/distance_in_words_to_now';
class TimeAgo extends Component {
componentDidMount() {
if (this.props.isLive) {
this.updateTime();
}