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
{ | |
parserClass="org.cutejs.lang.parser.CuteParser" | |
parserUtilClass="org.cutejs.lang.parser.CuteParserUtil" | |
elementTypeHolderClass="org.cutejs.lang.psi.CuteTypes" | |
elementTypeClass="org.cutejs.lang.psi.CuteCompositeElementType" | |
tokenTypeClass="org.cutejs.lang.psi.CuteTokenType" | |
psiClassPrefix="JST" | |
psiImplClassSuffix="Impl" |
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
package org.cutejs.lang.lexer; | |
import com.intellij.lexer.*; | |
import com.intellij.psi.tree.IElementType; | |
import static org.cutejs.lang.psi.CuteTypes.*; | |
import static com.intellij.psi.TokenType.BAD_CHARACTER; | |
import static com.intellij.psi.TokenType.WHITE_SPACE; | |
%% |
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
;; -*- mode: emacs-lisp -*- | |
;; This file is loaded by Spacemacs at startup. | |
;; It must be stored in your home directory. | |
(defun dotspacemacs/layers () | |
"Configuration Layers declaration. | |
You should not put any user code in this function besides modifying the variable | |
values." | |
(setq-default | |
;; Base distribution to use. This is a layer contained in the directory |
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
const exchangeMetadata = require('./lib/exchange-metadata'); | |
const peerWireSwarm = require('peer-wire-swarm'); | |
const hat = require('hat'); | |
const bncode = require('bncode'); | |
const parseTorrent = require('parse-torrent'); | |
const DHT = require('bittorrent-dht'); | |
const Bitfield = require('bitfield'); | |
const crypto = require('crypto'); | |
const http = require('http'); |
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
fn print_by_kind(v: &BencodeMut) { | |
match v.kind() { | |
BencodeRefKind::Bytes(bytes) => { | |
match std::str::from_utf8(bytes) { | |
Ok(val_str) => { | |
print!("{}", val_str); | |
} | |
Err(_) => { | |
print!("Bytes({})", bytes.len()); | |
} |
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
extern crate mio; | |
extern crate byteorder; | |
use byteorder::{ByteOrder, LittleEndian, BigEndian}; | |
use mio::*; | |
use std::io::{self, Read, Write}; | |
use mio::net::{TcpListener, TcpStream}; | |
use std::collections::HashMap; | |
use std::convert::From; | |
// Setup some tokens to allow us to identify which event is |
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
extern crate mio; | |
use mio::*; | |
use std::io::{self, Read, Write}; | |
use mio::net::{TcpListener, TcpStream}; | |
use std::collections::HashMap; | |
// Setup some tokens to allow us to identify which event is | |
// for which socket. | |
const SERVER: Token = Token(0); |
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
extern crate ggez; | |
extern crate byteorder; | |
use ggez::conf; | |
use ggez::event; | |
use ggez::event::{Keycode, Mod}; | |
use ggez::{GameResult, Context}; | |
use ggez::graphics; | |
use ggez::graphics::{DrawMode, Point, Rect, Color}; | |
use std::time::Duration; |
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
extern crate encoding; | |
use std::net::{TcpListener, TcpStream}; | |
use std::str::FromStr; | |
use std::io::{Read, Write, Result, Error, ErrorKind, BufRead, BufReader}; | |
use encoding::{Encoding, EncoderTrap, DecoderTrap}; | |
use encoding::all::{UTF_16BE, ASCII}; | |
enum STP0Command { | |
Services, |
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
#include <cstdio> | |
#include <cstdlib> | |
#include <cstring> | |
#include <cassert> | |
#include <vector> | |
#ifdef _MSC_VER | |
#define WIN32_LEAN_AND_MEAN | |
#include <windows.h> | |
#include <psapi.h> |