This file contains 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
using CliWrap; | |
using Spectre.Console; | |
while (true) | |
{ | |
var mainMenuResult = AnsiConsole.Prompt( | |
new SelectionPrompt<string>() | |
.Title("Main Menu") | |
.PageSize(3) | |
.AddChoices(new [] { "1. Text Editors", "2. Exit"}) |
This file contains 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
void Main() | |
{ | |
for (var i = 0; i <= 16; i++) | |
{ | |
Console.WriteLine($"{i.ToString().PadLeft(2, '0')} {Convert.ToString(i, 2).PadLeft(8, '0')}"); | |
} | |
} | |
// 00 00000000 | |
// 01 00000001 |
This file contains 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
msbuild mysolution.sln /t:Build /p:Configuration=Debug /p:Platform="Any CPU" /p:RunOctoPack=true |
This file contains 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
web3> iex -S mix phoenix.server | |
Eshell V7.3 (abort with ^G) | |
==> (compile) | |
==> gettext | |
Compiled src/gettext_po_parser.yrl | |
Compiled src/gettext_po_parser.erl | |
Compiled lib/gettext/extractor_agent.ex | |
Compiled lib/gettext/backend.ex | |
Compiled lib/gettext/interpolation.ex | |
Compiled lib/gettext/po/plural_translation.ex |
This file contains 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
defmodule PortExample do | |
def start_exe(exe_name, arguments) do | |
# start the executable process for what settings mean see http://erlang.org/doc/man/erlang.html#open_port-2 | |
port = Port.open({:spawn_executable, exe_name}, [{:args, arguments}, :stream, :binary, :exit_status, :hide, :use_stdio, :stderr_to_stdout]) | |
# spawn a listening process | |
handle_output(port) | |
# return the port | |
port | |
end | |
This file contains 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
from Tkinter import * | |
from subprocess import check_output | |
import ttk, os, sys | |
def disableConnection(): | |
global currentstatus | |
try: | |
os.popen('sudo ifdown eth0', 'r', 1) | |
print 'Connection disabled' | |
currentstatus.set('down') |
This file contains 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
<html> | |
<head> | |
<title>Web worker example</title> | |
</head> | |
<body> | |
<script> | |
var worker = new Worker("worker.js"); | |
worker.onmessage = function(e) { |
This file contains 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
private float GreatestCommonDenominator(float a, float b) | |
{ | |
// http://en.wikipedia.org/wiki/Euclidean_algorithm | |
if (b == 0) | |
{ | |
return a; | |
} | |
return GreatestCommonDenominator(b, a%b); | |
} |
This file contains 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
module("module", { | |
setup: function () { | |
$.mockjax( { | |
url: "*", | |
responseTime: 1, | |
dataType: 'text/json', | |
responseText: [{'name' : 'wally'},{ "name":"molly" }] | |
}); | |
}, | |
teardown: function () { |
This file contains 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
$(document).ready( function() { | |
$.mockjax({ | |
// This should trigger a success and use my data | |
// as oppose to the data received from server | |
url: "http://localhost:8000/", | |
responseTime: 10, | |
dataType: 'text/json', | |
responseText: { "name" : "MOCKJAX!!!!" } | |
}); |
NewerOlder