Skip to content

Instantly share code, notes, and snippets.

View pietvanzoen's full-sized avatar

Piet van Zoen pietvanzoen

View GitHub Profile
@snewell92
snewell92 / mysql.js
Created June 2, 2017 16:01
Sequelize ES6 model syntax
var Promise = require('bluebird');
const Sequelize = require('sequelize');
const fs = Promise.promisifyAll(require('fs'));
const _ = require('lodash');
const sequelize = new Sequelize(connectionString, {
dialect: 'mysql',
logging: false,
pool: { // application-side connection pool configuration
@manasthakur
manasthakur / grepping.md
Last active September 24, 2022 13:30
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
@imathis
imathis / tweetbot-mute-regex.md
Created June 27, 2012 19:45
Tweetbot can use regular expressions to mute tweets in your timeline and mentions.

Hashtag abuse

Three or more hashtags.

#[^#]+#[^#]+#

Long hashtags (15+ characters): #hashtagpunchline