Skip to content

Instantly share code, notes, and snippets.

Avatar
🍗
eating chicken

Vanessa Depraute vavadev92

🍗
eating chicken
View GitHub Profile
@vavadev92
vavadev92 / app.js
Created Aug 27, 2020 — forked from brnacl/app.js
Host multiple Node.js apps on single ubuntu server
View app.js
var httpProxy = require('http-proxy');
var options = {
router: {
'example.com': '127.0.0.1:3000',
'example.com/site1': '127.0.0.1:3000'
}
};
var proxyServer = httpProxy.createServer(options);
@vavadev92
vavadev92 / temp.js
Created Apr 10, 2018
input length limit
View temp.js
var $nickname = $('input.nickname');
var $message = $('textarea#sendtext');
var nicknameLimit = 2;
var messageLimit = 2;
function addHtmlLimit($s, limit) {
$s.attr('maxlength', limit.toString());
$s.bind("propertychange change click keyup input paste", function (event) {
if ($s.val().length > limit) {
View fetch_from_object.js
function fetchFromObject(obj, prop){
//property not found
if(typeof obj === 'undefined') return false;
//index of next property split
var _index = prop.indexOf('.')
//property split found; recursive call
if(_index > -1){
//get object at property (before split), pass on remainder
@vavadev92
vavadev92 / .zshrc
Last active Nov 16, 2017
.zshrc file 2017
View .zshrc
# Path to your oh-my-zsh installation.
export ZSH=/Users/ad/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="agnoster"
# Uncomment the following line to use case-sensitive completion.
@vavadev92
vavadev92 / is_touch_device.js
Last active Nov 16, 2017
Is Touch Device ?
View is_touch_device.js
function is_touch_device() {
return 'ontouchstart' in window // works on most browsers
|| 'onmsgesturechange' in window; // works on IE10 with some false positives
};
var istouch = is_touch_device();
View jquery_remove_text_node_type_3.js
$('.selector').contents().filter(function(){
return (this.nodeType == 3);
}).remove();
@vavadev92
vavadev92 / Trello custom theme for Stylish
Last active Aug 29, 2015
Trello custom theme for Stylish
View Trello custom theme for Stylish
body {
font-family: 'source sans pro', Arial !important;
}
.list {
background: rgba(255, 255, 255, 0.89) !important;
border-radius: 2px !important;
}
.list-card-details {
padding: 5px 5px 5px !important;
position: relative !important;