Skip to content

Instantly share code, notes, and snippets.

@gvost
gvost / index-typeahead.html
Last active August 29, 2015 14:27
A simple implementation of twitter-typeahead to include images (or other additional data to results) in this example there images and state codes.
<!DOCTYPE HTML>
<html>
<head>
<title>type</title>
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.min.css" rel="stylesheet" />
<style>
.thumbnail {
width: 20px;
display: inline-block;
margin-right: 10px;

Installation

1)

brew install nginx
sudo cp /usr/local/Cellar/nginx/1.8.0/homebrew.mxcl.nginx.plist /Library/LaunchAgents

2)

Replace /usr/local/etc/nginx/nginx.conf with the nginx.conf in this gist. I'm using port 5000 for my current project. Obviously, change server_name as well, and probably the name of its access log.

@gvost
gvost / README.md
Created February 26, 2017 01:35 — forked from jimothyGator/README.md
Nginx configuration for Mac OS X with Homebrew, using sites-enabled directory.
mkdir -p /usr/local/etc/nginx/sites-{enabled,available}
cd /usr/local/etc/nginx/sites-enabled
ln -s ../sites-available/default.conf
ln -s ../sites-available/default-ssl.conf

File locations:

  • nginx.conf to /usr/local/etc/nginx/
  • default.conf and default-ssl.conf to /usr/local/etc/nginx/sites-available
  • homebrew.mxcl.nginx.plist to /Library/LaunchDaemons/
@gvost
gvost / default.conf
Created March 14, 2017 23:03
NGiNX Configuration for Vue-Router in HTML5 Mode
server {
listen 80 default_server;
listen [::]:80 default_server;
root /your/root/path;
index index.html;
server_name you.server.com;
@gvost
gvost / tmux-cheatsheet.markdown
Created March 15, 2017 05:44 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@Text: #000000;
@Fill: #FFFFFF;
.webkitPrefillOverride (@textcolor, @fillcolor) {
-webkit-text-fill-color: @textcolor;
-webkit-box-shadow: inset 0 0 0px 9999px @fillcolor;
background-color: transparent!important;
background: transparent;
border-bottom-color: @fillcolor;
}
@gvost
gvost / scroll-listener.js
Created October 7, 2017 01:20
60FPS onscroll event listener
(function() {
var lastScrollY = 0;
var ticking = false;
var update = function() {
// do your stuff
ticking = false;
};
var requestTick = function() {
@gvost
gvost / uniq.js
Created October 7, 2017 01:20 — forked from telekosmos/uniq.js
Remove duplicates from js array (ES5/ES6)
var uniqueArray = function(arrArg) {
return arrArg.filter(function(elem, pos,arr) {
return arr.indexOf(elem) == pos;
});
};
var uniqEs6 = (arrArg) => {
return arrArg.filter((elem, pos, arr) => {
return arr.indexOf(elem) == pos;
});
function startWineQuiz() {
//This function will start the quiz when user clicks
//start button
console.log('`startWineQuiz` ran')
$('#start-button').on('click', function () {
fader('.quiz-body', 'fade-out', function () {
console.log('do stuff')
})
})