Skip to content

Instantly share code, notes, and snippets.

adeluccar / pnpm.zsh
Created Aug 9, 2017 — forked from danielbayley/pnpm.command
A binstub to seamlessly alias @npm to @pnpm.
View pnpm.zsh
#! /bin/zsh -f
disable which # builtin
alias -g i=install
pnpm () { command pnpm $@ --config ${NPM_CONFIG_USERCONFIG:-~/.npmrc} }
if (which -s pnpm) npm () {
NODE_BIN=`brew --prefix node`/bin
adeluccar /
Created Aug 1, 2017 — forked from joyrexus/
Vanilla JS equivalents of jQuery methods

Sans jQuery


// jQuery
$(document).ready(function() {
  // code
adeluccar / .tern-project
Created Jul 17, 2017 — forked from nisaacson/.tern-project
Use tern with vim for node.js development.
View .tern-project
"libs": [
"plugins": {
"node": {}
adeluccar /
Created Jul 11, 2017 — forked from dergachev/
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF


To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

adeluccar /
Created Jul 11, 2017 — forked from jasonlewis/
Bash script that creates a new project and virtual host for that project. Can also be used to quickly create a new Laravel project.
# This script creates a new project (or site) under /var/sites and creates
# new virtual host for that site. With the options a site can also
# install the latest version of Laravel directly.
# This script was originally based on the following script by @Nek from
# Coderwall:
# Display the usage information of the command.
create-project-usage() {
adeluccar /
Created Jun 30, 2017 — forked from manasthakur/
Vim: Creating your own ack.vim/ag.vim

Creating your own ag.vim

Vim provides built-in mechanisms to search through projects in the form of the grep command. However, on large projects, grep is known to be slow; and hence people have been switching to simpler searchers like ack, and faster, parallel (metal?) searchers like ag and pt. Correspondingly, several plugins have been created that integrate these tools in vim: ack.vim, ag.vim, etc.

However, it's actually very easy to get the functionalities these plugins provide (faster search, results in quickfix-window, jumps, previews, and so on) in vanilla Vim itself; in fact, Vim already populates the grep-search results in a quickfix window. We just need to tell Vim to do the following things (use-case: ag):

  • Use ag as the default grep program
  • Open quickfix window by default
  • Create mappin
adeluccar /
Created Jun 28, 2017 — forked from manasthakur/
Using git submodules to version-control Vim plugins

Using git-submodules to version-control Vim plugins

If you work across many computers (and even otherwise!), it's a good idea to keep a copy of your setup on the cloud, preferably in a git repository, and clone it on another machine when you need. Thus, you should keep the .vim directory along with your .vimrc version-controlled.

But when you have plugins installed inside .vim/bundle (if you use pathogen), or inside .vim/pack (if you use Vim 8's packages), keeping a copy where you want to be able to update the plugins (individual git repositories), as well as your vim-configuration as a whole, requires you to use git submodules.

Creating the repository

Initialize a git repository inside your .vim directory, add everything (including the vimrc), commit and push to a GitHub/BitBucket/GitLab repository:

cd ~/.vim
adeluccar /
Created Jun 21, 2017 — forked from willurd/
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
adeluccar /
Created May 20, 2017 — forked from bgallagh3r/
Wordpress: Bash Install Script -- Downloads latest WP version, updates wp-config with user supplied DB name, username and password, creates and CHMOD's uploads dir, copies all the files into the root dir you run the script from, then deletes itself!
#!/bin/bash -e
echo "============================================"
echo "WordPress Install Script"
echo "============================================"
echo "Database Name: "
read -e dbname
echo "Database User: "
read -e dbuser
echo "Database Password: "
adeluccar /
Created Mar 24, 2017 — forked from davidwolfpaw/
A starter script for creating a WordPress site on Vagrant using VVV, VV, VASSH, and WP-CLI
#!/bin/bash -e
# Ideas, Drawbacks, and Suggestions:
# Set up some defaults