Skip to content

Instantly share code, notes, and snippets.

@tcoats
tcoats / Test.aspx
Last active December 16, 2015 06:28
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TestPage.aspx.cs" Inherits="TestPage" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
@tcoats
tcoats / app.coffee
Created December 18, 2013 19:48
Requirejs in nodejs
requirejs = require 'requirejs'
# requirejs
requirejs.config {
# Pass the top-level main.js/index.js require
# function to requirejs so that node modules
# are loaded relative to the top-level JS file.
nodeRequire: require
paths: {
}
@tcoats
tcoats / express.coffee
Created December 18, 2013 20:30
Standard, extensible express
define ['http', 'express', 'odo/config'], (http, express, config) ->
(plugins) ->
app = express()
# express config
for key, value of config.express
app.set key, value
# Configure express
{
"auto_complete": true,
"auto_complete_commit_on_tab": true,
"auto_complete_with_fields": true,
"binary_file_patterns":
[
"*min.js",
"*min.css"
],
"bold_folder_labels": true,
@tcoats
tcoats / dynamic-snippets.coffee
Created March 12, 2014 19:43
Three options for dynamic content
# Dynamic content
# ===============
# Using a blog as an example
# Render content on the server
# ----------------------------
#
# /admin/editpost/234
app.get '/admin/editpost/:id', (req, res) =>
id = req.query.id
lanuchy
bump
z
highlight
trash
go-every
{
"cmd": ["lessc", "$file", "${file_path}/${file_base_name}.css", "--verbose"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.less",
"osx":
{
"path": "/usr/local/bin:$PATH"
},
define [
'd3'
], (d3) ->
class Direction
constructor: (options) ->
{
@element
@data
@margin
@width
@tcoats
tcoats / zombie.c
Created April 16, 2015 23:54
Spawn Zombie Processes
#include <stdlib.h>
#include <stdio.h>
int main() {
pid_t pid;
int i;
for (i = 0; ; i++) {
pid = fork();
fs = require 'fs'
path = require 'path'
async = require 'odo-async'
isgit = require 'is-git'
tags =
open: '/Users/tcoats/Open'
odo: '/Users/tcoats/Odo'
metocean: '/Users/tcoats/MetOcean'
mayhem: '/Users/tcoats/Mayhem'