View moda_media.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
# http://docs.python.org/tutorial/datastructures.html
l = [ 1, 10, 4, 2, 4, 3, 3, 1, 1, 3]
print l
promedio = sum(l)/len(l)
View attrToJson.vim
" usage:
" :AttrToJson
fun! AttrToJson()
execute '%s:\t: :'
execute '%s:;:,:'
execute '%s: =:\::'
execute '%s:\([A-z]\+\) {:\1\: {:'
execute '%s:\([A-z]\+\)\::"\1"\::'
execute '%s:,\(\n\s*\)}:\1},:'
execute '%s:},\(\n\s*\)}:}\1}:'
View 20170511_hello_nodejs.md

class: center, middle

Hello nodejs

Algunos ejemplos de nodejs

Juan Pablo Abarzúa

2017 05 11


View test_dynamically_generating.py
import unittest
class TestData(type):
def __new__(cls, name, bases, attrs):
callables = dict([
(meth_name, meth) for (meth_name, meth) in attrs.items() if
meth_name.startswith('_test')
View hoursSameName.js
// add menu
function onOpen() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var menuEntries = [{name:"Calcular Horas", functionName: "calculateHours"}];
ss.addMenu("Hours", menuEntries);
// calcular al iniciar
calculateHours();
}
function count_hours(cal_id, event_name){
View authorized_keys
ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIBalKiXFUuypcmAG0SZlMacEN0dQ8/VO/hDJYDAO2b4I36OoNX1kCyl3dskiid/tQRvAuoWMYnLfKIgx9d2C9cXxU+IuAY/pdpw7CQa8AGVMJ5mDcvdoakm6+6XhChaRv3AjHXTTO9sc7oXqP7zeKM18bPU44NUPDtYPK6f9Jm3+w== 8f041e92ddf2e1270c374c2d4f29aec8d9f47bf0-iphone-rsa-key-20110717
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC9rVPZGOGtUPp2ZwxCl19Qpevgmzx2Qvt5RNJ4/2IjaQETEcE4DQ64FDAP2feSrJclTQ6F9V7EML7WYD8y0pGDa6AbNQ2TRPoUkxbwtxTzfC3TwV6kPtQ8PMPR6WFfA6hqgN7FoEK6G2awWNPtHCe2O3VZB0qDoItZHXvMMTV50VafLPr5ToF3vFe6QSa5kK62zp9kjM6Rzg9WoFnYywg5V4vYzS+7AsakoDkgy2sJzHroVuz2cHOES55xpNGJFjtizbPYbzl4m0u0H3EAj31WjU6FLKXjYQf29C9w/RoAej0ntLN3mkjmbeNehF08EcQ3jk1ZW0a3JbyagQ2NENxT
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDejEMf1HJLWIXw++wOFZSmLkNe1cLJAQntqQzEVjMF0F+SnyRI501BRQopz2gzJeAuY7DzuxMsmKzM3kKWI/tVdzJRfW9BuKlhih9vypxB/vcaPBIeavyEAw/KKtRCgHA1vw++Z1mmaxigOxfg3P1M44P49aNopx8Uz5Z/w1mAeGNIYZ0inawzptgOBm4uJ5bvmDsRgqNyUbae1pNfuptbam4UbnF8ui7IFXjchSFiE6CyYwvxV3TRp/VxqB2njkfG9AmS97sJE0Enu/vq3vO+rwe+h+3BMDPveb7yk90JfV5SWsy9U96i1Jdj+cvTEsYg6ttBFeIT
View change_date_git_commit.sh
tempDate=$(date -R --date='12 hours ago')
GIT_COMMITTER_DATE="$tempDate" git ci --date "$tempDate"
View wgetBlueprint.sh
#!/bin/bash
wget --no-check-certificate https://github.com/joshuaclayton/blueprint-css/tarball/master
mv master master.tar.gz
tar xfz master.tar.gz
mv joshuaclayton-blueprint-css*/blueprint .
rm -rf master.tar.gz
rm -rf joshuaclayton-*
echo "Add this :"
echo -e '
<link rel="stylesheet" href="css/blueprint/screen.css" type="text/css" media="screen, projection">
View hello.js
var hello = function() {
return 'hello world';
};
var helloDate = function() {
console.log(new Date());
return 'hello world';
};
var returnDate = function() {
View test_hello.js
var assert = require('assert');
var fs = require('fs');
var util = require('util');
var vm = require('vm');
var sinon = require('sinon');
var source = fs.readFileSync('./to_call.js').toString();
var script = new vm.Script(source);