Skip to content

Instantly share code, notes, and snippets.

# redirect output and errors into file output.log:
nohup some_command > output.log 2>&1&
# abbreviated syntax for bash version >= ver.4:
nohup some_command &> output.log
#https://gist.github.com/umidjons/8417312
@TiagoTi
TiagoTi / ping.js
Created June 6, 2018 09:47
pinging request
var request = require('request');
setInterval(function(){
request('http://www.google.com', function (error, response, body) {
console.log('error:', error);
console.log('statusCode:', response && response.statusCode);
var gulp = require('gulp');
var pug = require('gulp-pug');
gulp.task('default1', function() {
console.log('ola mundo');
});
gulp.task('where-do-we-go-now', function(){
console.log('https://github.com/gulpjs/gulp/tree/v3.9.1/docs/recipes');
# Colors
set -g default-terminal "xterm-256color"
set-option -g status-bg black
set-option -g status-fg white
set-option -g status-attr default
set -g pane-border-fg white
set -g pane-active-border-fg white
set -g pane-active-border-bg cyan
# No delay for escape key
@TiagoTi
TiagoTi / gist:5a3232cadaa4b558ac4dbd5903f1d31a
Created March 17, 2020 07:21 — forked from romainl/gist:9970697
How to use Tim Pope's Pathogen

How to use Tim Pope’s Pathogen

I’ll assume you are on Linux or Mac OSX. For Windows, replace ~/.vim/ with $HOME\vimfiles\ and forward slashes with backward slashes.

The idea

Vim plugins can be single scripts or collections of specialized scripts that you are supposed to put in “standard” locations under your ~/.vim/ directory. Syntax scripts go into ~/.vim/syntax/, plugin scripts go into ~/.vim/plugin, documentation goes into ~/.vim/doc/ and so on. That design can lead to a messy config where it quickly becomes hard to manage your plugins.

This is not the place to explain the technicalities behind Pathogen but the basic concept is quite straightforward: each plugin lives in its own directory under ~/.vim/bundle/, where each directory simulates the standard structure of your ~/.vim/ directory.

@TiagoTi
TiagoTi / .vimrc
Last active March 17, 2020 08:03
"Load Plugin Manager Pathogen
execute pathogen#infect()
"Disable compatible with vi to enable all features of vim
set nocompatible
"enable ç to enter in command mode
:map ç :
@TiagoTi
TiagoTi / django.view.py
Created May 27, 2020 10:32
Django save InMemoryUploadedFile (a temporary uploaded file) to disk
from django.core.files.storage import default_storage
from django.core.files.base import ContentFile
file = request.FILES['your_file_fieldname']
path = default_storage.save('heart_of_the_swarm.txt', ContentFile(file.read()))
#https://twigstechtips.blogspot.com/2012/04/django-how-to-save-inmemoryuploadedfile.html