View untested
#!/bin/bash
# muestra funciones no llamadas desde archivos de test
function usage()
{
echo "usage: `basename $0` script_name.py"
}
# si no recive argumentos
View nitrousio_box.sh
#!/bin/bash
export WORKON_HOME=~/Envs
mkdir $WORKON_HOME
source /usr/local/bin/virtualenvwrapper.sh
echo "hostshort=$(hostname | cut -d'-' -f3,4)" >> ~/.bashrc
echo 'export PS1="\[\033[01;32m\]$hostshort\[\033[00m\]:\[\033[01;36m\]\W\[\033[00m\]\$(parse_git_branch)\$ "' >> ~/.bashrc
echo "export WORKON_HOME=~/Envs" >> ~/.bashrc
echo "source /usr/local/bin/virtualenvwrapper.sh" >> ~/.bashrc
View gen_files.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
from string import Template
import csv
content = Template(\
'${name}:\n'+\
'properties:\n'+\
' ${value1}\n'+\
View test_output.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
# python -m unittest test_output
import sys
import unittest
from StringIO import StringIO
View Gruntfile.js
module.exports = function(grunt){
grunt.initConfig({
watch: {
js: {
files : [ 'Gruntfile.js', '*/tests/*.py'],
tasks: ['pythontest'],
}
}
});
View Gruntfile.js
module.exports = function(grunt){
grunt.initConfig({
watch: {
grunt: {
files: ['Gruntfile.js']
},
python: {
files : ['./tests/*.py','./*/*.py'],
tasks: ['pythontest','gitst'],
},
View watch.ps1
$folder = 'c:\path\to\file'
$filter = '*.*'
$fsw = New-Object IO.FileSystemWatcher $folder, $filter
$fsw.IncludeSubdirectories = $true
$fsw.NotifyFilter = [IO.NotifyFilters]'FileName, LastWrite'
$onCreated = Register-ObjectEvent $fsw Created -SourceIdentifier FileCreated -Action {
$name = $Event.SourceEventArgs.Name
$path = $Event.SourceEventArgs.FullPath
Write-Host "The file '$name' '$path'"
}
View pushbullet.ps1
$user = "pushbullet_token"
$url = "https://api.pushbullet.com/v2/pushes"
$data = "type=note&title=title&body=body"
$webclient = new-object System.Net.WebClient
$webclient.Credentials = new-object System.Net.NetworkCredential($user, "")
$result = $webclient.UploadString($url, "POST", $data)
$result
View watch_and_push.ps1
$folder = 'c:\path\to\file'
$filter = '*.*'
$fsw = New-Object IO.FileSystemWatcher $folder, $filter
$fsw.IncludeSubdirectories = $true
$fsw.NotifyFilter = [IO.NotifyFilters]'FileName, LastWrite'
$onChanged = Register-ObjectEvent $fsw Changed -SourceIdentifier FileChanged -Action {
$name = $Event.SourceEventArgs.Name
$path = $Event.SourceEventArgs.FullPath
View postactivate
#!/bin/bash
# This hook is run after every virtualenv is activated.
# http://virtualenvwrapper.readthedocs.org/en/latest/scripts.html
cur_env=$(basename $VIRTUAL_ENV)
cddir=$HOME/src/$cur_env
if [[ -e $cddir ]]; then
echo "cd "$cddir