This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.
###Array ####Definition:
- Stores data elements based on an sequential, most commonly 0 based, index.
- Based on tuples from set theory.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FILE SPACING: | |
# double space a file | |
sed G | |
# double space a file which already has blank lines in it. Output file | |
# should contain no more than one blank line between lines of text. | |
sed '/^$/d;G' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
go test -v . | sed ''/PASS/s//$(printf "\033[32mPASS\033[0m")/'' | sed ''/FAIL/s//$(printf "\033[31mFAIL\033[0m")/'' | sed ''/RUN/s//$(printf "\033[36mRUN\033[0m")/'' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"os" | |
"path/filepath" | |
) | |
func main() ([]string, error) { | |
searchDir := "c:/path/to/dir" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Recordar que los módulos van en config.json y allí se crean las variables para poder usarlos. | |
var restify = require('restify'); | |
var http = require('http'); | |
var workflow = module.exports = { | |
name: 'Looking for cellphone company', | |
chain: [ | |
{ | |
name: 'Create an account in TIGO', | |
timeout: 20, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var EventSource = require('eventsource'); | |
var Wreck = require('wreck'); | |
var parse = require('parse-link-header'); | |
var qs = require('querystring'); | |
var readableStream = qs.stringify({number:'54665160 '}); | |
var options = { | |
payload: readableStream, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'Recibir un XML como un String | |
Private Function LoopXML(ByVal xml As String) As String | |
Try | |
Dim strSalida As String = "" | |
Dim nt As NameTable = New NameTable() | |
Dim nsmgr As XmlNamespaceManager = New XmlNamespaceManager(nt) | |
nsmgr.AddNamespace(String.Empty, "") | |
Dim context As XmlParserContext = New XmlParserContext(Nothing, nsmgr, Nothing, XmlSpace.None) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set ANSI_NULLS ON | |
set QUOTED_IDENTIFIER ON | |
GO | |
ALTER FUNCTION [dbo].[Segundos_Laborales_Extremos] ( @empleado int, @fecha_inicial DATETIME, @fecha_final DATETIME) | |
RETURNS INT | |
AS | |
BEGIN | |
DECLARE @hora_inicio DATETIME, @hora_fin DATETIME |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
La función obtiene el tiempo laboral en segundos de un empleado entre dos fechas. | |
Esta función trabaja sobre una tabla de horarios por empleado donde cada empleado puede tener muchos horarios por día. | |
Se asume que no hay traslapes de horarios. | |
Un ejemplo de la tabla podría ser así: | |
dia|hora_inicio|hora_fin|empleado | |
2 |08:00 |13:00 |15 |
NewerOlder