Skip to content

Instantly share code, notes, and snippets.

@NightFeather
NightFeather / client.c
Created September 27, 2018 04:08
第一次上機考
#include "common.h"
#include <stdio.h>
int main(){
char buffer[256] = {0};
int read_size = 0;
char host[32] = {0};
int port = -1;
scanf("%s %d", host, &port);
@NightFeather
NightFeather / Makefile
Created September 26, 2018 08:00
TCP WRAPPER IN C
CFLAGS=-Wall -g
INC=-I.
client: client.o common.o
gcc ${CFLAGS} ${INC} common.o client.o -o client
server: server.o common.o
gcc ${CFLAGS} ${INC} common.o server.o -o server
#!/usr/bin/env ruby
require "net/http"
if ARGV.size != 1
puts "Usage: #{__FILE__} <url>"
exit
end
@uri = URI(ARGV[0])
#include <stdio.h>
int main(){
int top, layers, growth, trh, trw, padding;
int i, j, k, curr_h;
printf("Tree Layers (2-5): ");
scanf("%d", &layers);
printf("Top Layer Height (3-6): ");
scanf("%d", &top);
printf("Growth Between Layer (1-5): ");
; vim: ft=asm68k
.8051
.include "tx3703.equ"
.org 0x00
start:
mov P0OE, #0xFF
mov P0, #0xFF
mov CLKCON, #0x03
sjmp main
#include "tx3703.inc"
org 000h
start:
mov P0OE, #0xFF
mov P0, #0xFF
mov P2OE, #0x0F
mov P2, #0x0F
mov CLKCON, #0x03
sjmp main
#include "tx3703.inc"
org 00h
ajmp start
; some vars
D1 equ 41h ; 1s
D2 equ 42h ; 10s
; some consts
POS1 equ 0x70
# frozen_string_literal: true
source "https://rubygems.org"
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
gem 'eventmachine'
gem 'faye', github: 'faye/faye'
# Key Transition
I am transitioning my gpg key from an old 2048-bit RSA key to a new 4096-bit RSA key.
old key will be valid for some time.
Old key:
sec rsa2048 2016-06-25 [SC]
6E51A6DB4724DC2937D78AB895A7D60C79FD35B4
uid [ultimate] Nightfeather <ss900328@gmail.com>
require 'csv'
require 'time'
class EinvoiceRecord
attr_reader :state, :barcode, :date, :shop_id, :shop, :device, :device_id, :total, :items
def self.parse lines
result = []
lines.each do |line|
case line.first