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 EventEmitter = require("node:events"); | |
const emitter = new EventEmitter(); | |
const sleep = (waitTimeInMs) => | |
new Promise((resolve) => setTimeout(resolve, waitTimeInMs)); | |
async function doLoop() { | |
while (true) { | |
emitter.emit("ping", new Date().toISOString()); |
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 Error { | |
msg: &'static str | |
} | |
fn error(msg: &'static str) -> Error { | |
Error { msg: msg } | |
} | |
fn main() { | |
let err = error("successful syntax error"); |
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
use std::comm::*; | |
use std::libc::funcs::posix88::unistd; | |
// this simulates a processing-intesive task. | |
fn test(x: bool) -> bool { | |
unsafe { | |
unistd::sleep(1); | |
} |
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
# Maintainer: Mark Foxwell <fastfret79@archlinux.org.uk> | |
pkgname=imapfilter | |
pkgver=2.5.3 | |
pkgrel=1 | |
pkgdesc="A mail filtering utility for processing IMAP mailboxes" | |
arch=('i686' 'x86_64') | |
url="https://github.com/lefcha/imapfilter" | |
license=('MIT') | |
depends=('lua' 'pcre' 'openssl') |
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 lsgems() { | |
rubyversion=$(ruby -v | cut -f2 -d' ' | sed 's/p/-p/') | |
gemroot=~/.rvm/gems/ruby-"$rubyversion"/gems | |
ls "$gemroot" | |
} | |
function cdgem() { | |
rubyversion=$(ruby -v | cut -f2 -d' ' | sed 's/p/-p/') | |
gemroot=~/.rvm/gems/ruby-"$rubyversion"/gems |
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/sh | |
# | |
# action | |
# new: add new profile template (creates file if not found), then edit | |
# edit: edit file (fall back to 'new' if file not found) | |
# load: load from file | |
# once: use temporary file to edit form once | |
# (empty): if file not available, new; otherwise, load | |
# |
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
<div class="alert"> | |
<a href="#" class="button"> | |
Push Me | |
</a> | |
<div class="alert-box"> | |
<p>This is an alert pertaining to the button.</p> | |
</div> | |
</div> |
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
open("/home/bct/.mozilla/plugins", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 11 | |
access("/home/bct/.mozilla/plugins/libflashplayer.so", F_OK) = 0 | |
open("/home/bct/.netscape/plugins", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 ENOENT (No such file or directory) | |
open("/usr/lib/browser/plugins", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 ENOENT (No such file or directory) | |
open("/usr/local/lib/mozilla/plugins", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 ENOENT (No such file or directory) | |
open("/usr/lib/firefox/plugins", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 ENOENT (No such file or directory) | |
open("/usr/lib64/browser-plugins", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 ENOENT (No such file or directory) | |
open("/usr/lib/browser-plugins", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 ENOENT (No such file or directory) | |
open("/usr/lib/mozilla/plugins", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 ENOENT (No such file or directory) | |
open("/usr/local/netscape/plugins", O_RDONLY|O_NONBLO |
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
# This is a stripped-down wxPython program with a custom wxPyGridCellEditor that | |
# crashes on my machine (wxPython 2.8.10.1 with Python 2.5 on Windows XP). | |
# | |
# I can make the program crash in two ways, I'm not sure they're related. | |
# Short way: | |
# 1. Edit the first row's "Class" field. You should get a drop-down with "Local" | |
# and "Temp". | |
# 2. Select a value from the drop-down. The program crashes. | |
# | |
# Long way: |
NewerOlder