Skip to content

Instantly share code, notes, and snippets.

@Fi3
Fi3 / zero.py
Last active October 26, 2016 18:47
"""
Basic server settings ok for development and for production
"""
from subprocess import STDOUT, check_call, PIPE, Popen, call, check_output
import os
from zeroUtility import *
linuxVersion = check_output(['uname','-r']).split('\n')[0]
programs = (['vim-nox', 'tmux', 'python-pip', 'python-virtualenv', 'python-dev',
import os
import pwd
def linePrepender(filename, line):
with open(filename, 'r+') as f:
content = f.read()
if content.split('\n')[0] == line:
return
f.seek(0, 0)
f.write(line.rstrip('\r\n') + '\n' + content)
@Fi3
Fi3 / .vimrc
Last active September 21, 2016 11:49
" plugin
execute pathogen#infect()
" enable syntax highlighting
syntax enable
" enable support for 256K colors
set t_Co=256
" set background dark
@Fi3
Fi3 / .zshrc
Created February 4, 2016 13:05
# Set up the prompt
autoload -Uz promptinit
promptinit
prompt adam1
setopt histignorealldups sharehistory
# Use emacs keybindings even if our EDITOR is set to vi
bindkey -e
# Scroll History
set -g history-limit 30000
# Set ability to capture on start and restore on exit window data when running an application
setw -g alternate-screen on
# Lower escape timing from 500ms to 50ms for quicker response to scroll-buffer access.
set -s escape-time 50
# Status bar customization
'use strict';
require('babel-polyfill');//"~6.7.4"
var c = 0;
var counter = 0;
var thisNotWork = function _callee() {
return regeneratorRuntime.async(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
#-----------------------tipo1-----------------------#
import csv
parsed = []
nomeFile = 'eur1.csv'
with open(nomeFile,'r') as csvfile:
rd = csv.reader(csvfile, delimiter=',', quotechar='|')
for row in rd:
parsed.append(row)
def findRef(string):
@Fi3
Fi3 / .tmux.conf
Last active January 3, 2024 13:31 — forked from paulodeleo/.tmux.conf
Tmux configuration to enable mouse scroll and mouse panel select, taken from: http://brainscraps.wikia.com/wiki/Extreme_Multitasking_with_tmux_and_PuTTY
# Scroll History
set -g history-limit 50000
# Set ability to capture on start and restore on exit window data when running an application
setw -g alternate-screen on
# Scroll with mouse
setw -g mouse on
# Lower escape timing from 500ms to 50ms for quicker response to scroll-buffer access.
'use strict'
/* Finds all the solutions to the N-Towers algorithm.
*
* @param number_of_towers number of towers to try to place in the chessboard
* @param number_of_lines chessboard's ones
* @param number_of_columns chessboard's ones
* @returns {nTowersSolutions} array containing all the solutions
* "Tower" = presence of a tower in this square of the chessboard
* "Nothing" = no tower in this square of the chessboard
* "Blocked" = the cell is blocked
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.