Skip to content

Instantly share code, notes, and snippets.

@n-s-k
n-s-k / OOP_F2003_Part_2.md
Last active January 20, 2025 10:40
Object-Oriented Programming in Fortran 2003 Part 2: Data Polymorphism

Object-Oriented Programming in Fortran 2003 Part 2: Data Polymorphism

Original article by Mark Leair, PGI Compiler Engineer

Note: This article was revised in March 2015 and again in January 2016 to bring it up-to-date with the production software release and to correct errors in the examples.

This is Part 2 of a series of articles:

@ruda
ruda / listchars.vim
Last active September 8, 2024 15:38
Vim: listchars samples
set listchars=tab:→\ ,trail:␣,extends:…,eol:⏎
set listchars=tab:→\ ,trail:␣,precedes:«,extends:»,eol:⏎
set listchars=tab:→\ ,trail:·,precedes:«,extends:»,eol:¶
set listchars=tab:‣\ ,trail:·,precedes:«,extends:»,eol:¬
set listchars=tab:␋\ ,trail:␠,precedes:«,extends:»,eol:␤
set listchars=tab:>-,trail:.,precedes:<,extends:>,eol:$
@libinbensin
libinbensin / DrawerActivity
Last active March 13, 2021 05:30
Android Navigation Drawer with Activities
public class DrawerActivity extends ActionBarActivity {
private DrawerLayout mDrawerLayout = null;
private ListView mDrawerList = null;
private String[] mDrawerItems;
private ActionBarDrawerToggle mDrawerToggle = null;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_drawer_layout);
@domenic
domenic / event-emitter.js
Last active April 27, 2025 09:11
Revealing constructor pattern event-emitter
// This event emitter emits events, but reserves the right to publish events to
// for its creator. It uses a WeakMap for true encapsulation.
const eesToEventMaps = new WeakMap();
export default class EventEmitter {
constructor(publisher) {
const eventMap = Object.create(null);
eesToEventMaps.set(this, eventMap);
@gekowa
gekowa / node-ping-graph.js
Created March 1, 2013 04:41
Usage: node node-ping-graph.js <IP Address> Works only on Windows.
var cols = process.stdout.columns,
rows = process.stdout.rows,
spawn = require('child_process').spawn,
i, j,
red = '\u001b[31m',
blue = '\u001b[34m',
green = '\u001b[32m',
white = '\u001b[37m',
@kfox
kfox / tcpproxy.js
Created April 5, 2012 20:03
A basic TCP proxy written in node.js
var net = require("net");
process.on("uncaughtException", function(error) {
console.error(error);
});
if (process.argv.length != 5) {
console.log("usage: %s <localport> <remotehost> <remoteport>", process.argv[1]);
process.exit();
}