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
#!/bin/bash | |
USERNAME="YOUR_USERNAME" | |
PASSWORD="YOUR_PASSWORD" | |
IP=$(curl -s http://ip.3322.net) | |
HOSTNAME="YOURDOMAIN.3322.org" | |
DATE=$(date) |
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
// program | |
package main | |
import "os/signal" | |
import "os" | |
import "fmt" | |
import "syscall" | |
import "time" | |
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
function MONAD(modifier) { | |
var prototype = Object.create(null); | |
function unit(value) { | |
var monad = Object.create(prototype); | |
monad.bind = function (func, args) { | |
return func.apply(undefined, | |
[value].concat(Array.prototype.slice.apply(args || []))); | |
}; | |
if (typeof modifier == 'function') { | |
monad = modifier(monad, value); |
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
:set prompt "λ> " | |
:set +t |
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
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import os | |
from commands import getstatusoutput, getoutput | |
WIFI_IF = "en0" | |
class Wifi(object): |
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 mod sync; | |
// str op trait | |
use std::str::StrSlice; | |
// for tcp listen | |
use std::io::{TcpListener, TcpStream}; | |
use std::io::net::ip::SocketAddr; | |
// for trait | |
use std::io::{Listener, Writer, Acceptor, Buffer}; | |
// for spawn |
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
#![feature(asm)] | |
use std::io; | |
fn cpuid(info: u32) -> (u32, u32, u32, u32) { | |
let (mut a, mut b, mut c, mut d) = (0,0,0,0); | |
unsafe { | |
asm!("mov $4, %eax | |
cpuid |
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
// copied from rustdoc | |
/// Parses, resolves, and typechecks the given crate | |
fn get_ast_and_resolve(cpath: &Path, libs: HashSet<Path>, cfgs: Vec<~str>) -> (ast::Crate, CrateAnalysis) { | |
use syntax::codemap::dummy_spanned; | |
use rustc::driver::driver::{FileInput, build_configuration, | |
phase_1_parse_input, | |
phase_2_configure_and_expand, | |
phase_3_run_analysis_passes}; | |
let input = FileInput(cpath.clone()); |
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
import os | |
import commands | |
import time | |
def get_process(): | |
procs = set() | |
for line in commands.getoutput("ps aux").split('\n'): | |
if not line: # or '%CPU' in line: | |
continue | |
proc = ' '.join(line.split()[10:]) |
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
struct HashSet<T : Hashable> { | |
typealias Element = T | |
var _map: Dictionary<T, ()> = [:] | |
var count: Int { | |
return _map.count | |
} | |
var isEmpty: Bool { |