Skip to content

Instantly share code, notes, and snippets.

View nepsilon's full-sized avatar

James Pudson nepsilon

View GitHub Profile
@nepsilon
nepsilon / gist:7562120
Last active December 28, 2015 21:09
Font size px to em reference table with 16px as default font size.

Font size table

Browser default 16px

pixels relative
36px 2.25em
31px 0.5161em
24px 1.5em
21px 1.3125em

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google
@nepsilon
nepsilon / using-auto-backup-vim.md
Last active February 24, 2022 15:21
Using auto backup with Vim — First published in fullweb.io issue #3

Using auto backup with Vim

Not using versioning on your configuration files and editing them with Vim? Use Vim’s backup option to automatically keep a copy of past versions:

To put in your ~/.vimrc:

"Turn on backup option
set backup
@nepsilon
nepsilon / serve-file-network-http-server.md
Last active May 7, 2017 09:03
How to quickly serve files or directories over the network — First published in fullweb.io issue #4

Quick web server to serve files on your LAN

Need to quickly serve files over the network? Or even a full directory? Here is how to do with Python, PHP and NodeJs:

With Python 2.x:

$ python -m SimpleHTTPServer
@nepsilon
nepsilon / mix-of-bash-zsh-goodies.md
Last active July 12, 2016 07:06
A mix of bash/zsh goodies — First published in fullweb.io issue #5

A mix of bash/zsh goodies

Expansion:

# same as mv file.txt file.md:
$ mv file.{txt,md}

Back to your previous working directory:

@nepsilon
nepsilon / git-stash.md
Last active May 18, 2017 08:44
Ever started working on the wrong branch with Git? — First published in fullweb.io issue #6

Git stash

Ever started working on the wrong branch with Git? Use gist stash! Here is how to proceed in 3 steps:

1. Use stash to detach unstaged changes:

$ git stash
@nepsilon
nepsilon / 4-npm-tips.md
Last active July 12, 2016 07:00
4 npm tips — First published in fullweb.io issue #8

4 npm tips

Node npm is certainly one of the best package manager out there. Here are some awesome tips you may not know:

1. Find a module owner:

$ npm owner ls packagename

2. Open the GitHub issues page:

@nepsilon
nepsilon / search-inside-file-with-grep.md
Last active February 19, 2017 12:37
Search inside your files with grep — First published in fullweb.io issue #10

Search inside your files with grep

See how to use grep to find what you’re looking for inside files:

grep is case sensitive by default use -i to turn this off:

$ grep -i pattern file

Search recursively into a folder:

@nepsilon
nepsilon / find-stuff-with-locate-tips.md
Last active July 12, 2016 06:48
Find your stuff with locate — First published in fullweb.io issue #11

Find your stuff with locate

Following on last week grep tips, let’s see how to use locate to search for files on your Linux machine. The locate command is faster than find because it uses a database, whereas find will scan the file system every time.

locate uses a database, you first need to build it with:

$ sudo updatedb
@nepsilon
nepsilon / 5-netstat-tips.md
Last active February 19, 2017 12:37
5 netstat tips — First published in fullweb.io issue #12

5 netstat tips

netstat has some very neat features we could make use of more often! Here is 5.

Note: examples here may not apply to BSD based systems

1. The classic: list local listening TCP/UDP ports and their process:

$ sudo netstat -tulpn