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
import time | |
import struct | |
DEBUG = True | |
class Instruction(): | |
def __init__(self, opcode, args, name): | |
self.opcode = opcode | |
self.args = args | |
self.name = name |
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
function is_capital(c) { return (c >= 'A') && (c <= 'Z') } | |
function bad_video(video) { | |
let title = video.querySelector('#video-title').textContent | |
let channel = video.querySelector('#avatar-link').title | |
// console.log('chan:',channel,'title:',title) | |
// Simple channel whitelist | |
let good_channels = ['melodysheep', 'Zeruel82Mk2'] |
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
all: build run | |
build: | |
# Pretend I have no control over how add.c is compiled | |
gcc -Wall add.c -o add | |
# I have control over how I compile ./call | |
gcc -Wall -ldl call.c -o call | |
run: | |
./call |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
--------- | |
-- Module for managing coordanites in opencomputers. | |
-- @module coords | |
-- @author Ulisse Mini | |
-- @license MIT | |
local r = require('robot') | |
--- The entire API lives in here. | |
local t = {} |
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
;; This program assumes the turtle is placed one into the leftmost block | |
;; in the middle, it also assumes the turtle is facing forward. | |
;; It will dig a three tall pathway forward until it runs out of fuel or count is reached. | |
(local args [...]) | |
(when (~= (# args) 1) | |
(error 'Usage: mine <count> [width]')) ; TODO: Implement optional [width]. | |
(local width 7) | |
(local fuelLimit (turtle.getFuelLimit)) |
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
#!/bin/bash | |
set -e | |
# https://unix.stackexchange.com/questions/70615/bash-script-echo-output-in-box | |
function print() { | |
local s="$*" | |
tput setaf 3 | |
echo " -${s//?/-}- | |
| ${s//?/ } | | |
| $(tput setaf 4)$s$(tput setaf 3) | |
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
defmodule Cli do | |
@moduledoc " Cli to check if a gitlab username is taken" | |
@doc " The entry point for the program" | |
def main([]) do | |
IO.puts "Usage: #{:escript.script_name()} <username>" | |
end | |
def main([user]) do | |
Application.ensure_all_started(:inets) |
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
use std::io::{ErrorKind, Read, Write}; | |
use std::net::TcpListener; | |
use std::thread; | |
const BIND_ADDR: &str = "127.0.0.1:1337"; | |
const MAX_MSG_SIZE: usize = 32; | |
fn sleep() { | |
thread::sleep(::std::time::Duration::from_millis(100)); | |
} |
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
fn main() { | |
let mut clients = vec![] | |
.push(stream1) | |
.push(stream2) | |
.push(stream3); | |
for client in &clients { | |
if client.can_recv() { | |
// now i want to send this message to every connectede | |
// client. and if there is an error i want to |