Skip to content

Instantly share code, notes, and snippets.

View jrocha's full-sized avatar

Jorge Rocha Gualtieri jrocha

View GitHub Profile
@jrocha
jrocha / spawn.js
Created August 25, 2012 00:21 — forked from nzakas/spawn.js
Devil spawn
#!/usr/bin/env node
var child = require('child_process');
var cp = child.spawn("cmd.exe", ["/c", "dir"]);
cp.stdout.on("data", function(data) {
console.log(data.toString());
});
cp.stderr.on("data", function(data) {
console.error(data.toString());
Function Log([string]$Details, [ConsoleColor]$Colour) {
if ($Colour -eq $null) {
$Colour = [ConsoleColor]::White
}
Write-Host $Details -ForegroundColor $Colour
if ( $LogFile -eq "" -or $LogFile -eq $null ) { return }
$Details | Out-File $LogFile -Append
}
@jrocha
jrocha / Program.cs
Created October 16, 2018 14:34
Flush file without closing it
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp {
class Program {
static void Main(string[] args) {
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Text;
namespace SBSTR1 {
class Program {
static int ProgramV0(string strA, string strB) {
/*
BULK - The Bulk!
ACM uses a new special technology of building its transceiver stations.
This technology is called Modular Cuboid Architecture (MCA) and is covered by a patent of Lego company.
All parts of the transceiver are shipped in unit blocks that have the form of cubes of exactly the same size.
The cubes can be then connected to each other.
The MCA is modular architecture, that means we can select preferred transceiver configuration and buy only those components we need.
The cubes must be always connected "face-to-face", i.e. the whole side of one cube is connected to the whole side of another cube.