Skip to content

Instantly share code, notes, and snippets.

View davidpeach's full-sized avatar
🖥️
I use Arch btw

David Peach davidpeach

🖥️
I use Arch btw
View GitHub Profile
@nifl
nifl / grok_vi.mdown
Created August 29, 2011 17:23
Your problem with Vim is that you don't grok vi.

Answer by Jim Dennis on Stack Overflow question http://stackoverflow.com/questions/1218390/what-is-your-most-productive-shortcut-with-vim/1220118#1220118

Your problem with Vim is that you don't grok vi.

You mention cutting with yy and complain that you almost never want to cut whole lines. In fact programmers, editing source code, very often want to work on whole lines, ranges of lines and blocks of code. However, yy is only one of many way to yank text into the anonymous copy buffer (or "register" as it's called in vi).

The "Zen" of vi is that you're speaking a language. The initial y is a verb. The statement yy is a simple statement which is, essentially, an abbreviation for 0 y$:

0 go to the beginning of this line. y yank from here (up to where?)

@coolaj86
coolaj86 / how-to-publish-to-npm.md
Last active June 9, 2024 23:19
How to publish packages to NPM

Getting Started with NPM (as a developer)

As easy as 1, 2, 3!

Updated:

  • Aug, 08, 2022 update config docs for npm 8+
  • Jul 27, 2021 add private scopes
  • Jul 22, 2021 add dist tags
  • Jun 20, 2021 update for --access=public
  • Sep 07, 2020 update docs for npm version
@logsol
logsol / README
Created March 28, 2012 21:19
Apache - automatically route all subdomains to their related directory
===========================================================================
APACHE
How to get "anysubdomain.mydomain.com" automatically routed to a directory?
===========================================================================
1.) enable mod_vhost_alias (create symlink in mods-enabled)
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active June 13, 2024 05:29
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@mko
mko / h-as-note.html
Created July 15, 2014 19:02
h-entry as photo vs h-entry as note with photo
<article class="h-entry">
<figure class="e-content p-name">
<img src="/path/to/image" alt="Description of Image" class="u-photo">
<figcaption class="p-summary">Description of Image</figcaption>
</figure>
<p>Published by <a class="p-author h-card" href="https://domain.ext">Photographer</a>
on <time class="dt-published" datetime="2014-07-14 12:00:00">July 14<sup>th</sup>, 2014</time></p>
</article>
@kkiernan
kkiernan / create.py
Last active December 27, 2022 09:25
import sublime, sublime_plugin, re
class CreateCommand(sublime_plugin.TextCommand):
# Runs the plugin
def run(self, edit, stub, offset):
self.view.insert(edit, offset, stub)
@MakersF
MakersF / cloud_config.yaml
Created December 31, 2015 06:26
#cloud-config for Python application with Postgresql database and read_only role for DigitalOcean
#cloud-config
users:
- name: demo_user
shell: /bin/bash
ssh-authorized-keys:
- ssh-rsa [your -key]
packages:
- git
@ziadoz
ziadoz / install.sh
Last active April 20, 2024 10:18
Install Chrome, ChromeDriver and Selenium on Ubuntu 16.04
#!/usr/bin/env bash
# https://developers.supportbee.com/blog/setting-up-cucumber-to-run-with-Chrome-on-Linux/
# https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c
# https://stackoverflow.com/questions/10792403/how-do-i-get-chrome-working-with-selenium-using-php-webdriver
# https://stackoverflow.com/questions/26133486/how-to-specify-binary-path-for-remote-chromedriver-in-codeception
# https://stackoverflow.com/questions/40262682/how-to-run-selenium-3-x-with-chrome-driver-through-terminal
# https://askubuntu.com/questions/760085/how-do-you-install-google-chrome-on-ubuntu-16-04
# Versions
CHROME_DRIVER_VERSION=`curl -sS https://chromedriver.storage.googleapis.com/LATEST_RELEASE`
@purpleP
purpleP / vim-tmux.md
Created January 29, 2017 00:37
How to run tests with tmux and vim

Running tests with vim and tmux

After using vim and neovim for almost a year now I've come to the point when frustration I had with running test with vim made me think about ideal workflow for running tests (at least in command line, but some rules apply to GUI).

Below you can read my thoughts about ideal workflow, a summary of problems with current workflows (at least that I know of, but I think I've tried them all) and my own new (well, at least I think it's new) solution to them.

@yetanotherchris
yetanotherchris / sjcl-example.js
Created February 5, 2017 18:27
Stanford Javascript Crypto Library basic AES example
// Basic AES example using the defaults.
// https://github.com/bitwiseshiftleft/sjcl
var password = "password";
var text = "my secret text";
var parameters = { "iter" : 1000 };
var rp = {};
var cipherTextJson = {};
sjcl.misc.cachedPbkdf2(password, parameters);