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 asynchttpserver | |
import asyncdispatch | |
import strutils | |
import fsnotify | |
proc main {.async.} = | |
var server = newAsyncHttpServer() | |
proc cb(req: Request) {.async.} = |
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
(defun org-babel-execute:nim (body params) | |
"Execute a block of Nim code with org-babel." | |
(message "executing Nim source code block") | |
(let* (in-file (org-babel-temp-file "nim-"))) | |
(with-temp-file in-file | |
(insert body)) | |
(org-babel-eval (format "nim r %s" (org-babel-process-file-name in-file)))) |
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
{ | |
"CallerReference": "glorious.website-cli", | |
"Aliases": { | |
"Quantity": 2, | |
"Items": [ | |
"glorious.website", | |
"www.glorious.website" | |
] | |
}, | |
"DefaultRootObject": "index.html", |
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
tee ./index.html <<EOF | |
<html> | |
<head> | |
<link rel="stylesheet" type="text/css" href="/style.css"/> | |
<title>Glorious Website</title> | |
</head> | |
<body> | |
<h1>Version 1</h1> | |
<p>Go to <a href="/blog/first-post">blog/first-post</a></p> | |
</body> |
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::collections::HashMap; | |
struct Cacher<T> | |
where | |
T: Fn(&u32) -> u32, | |
{ | |
calculation: T, | |
values: HashMap<u32, u32>, | |
} |
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 Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
var Sequelize = require('sequelize'); | |
var sequelize = new Sequelize('db', 'user', 'password'); | |
var Person = sequelize.define('Person', { | |
name: Sequelize.STRING, | |
}); | |
var ChildrenPerson = sequelize.define('ChildrenPerson', { | |
PersonId: { |
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
Bringing machine 'default' up with 'virtualbox' provider... | |
[default] Importing base box 'puppetlabs-ubuntu-server-12042-x64'... | |
[0K[default] Matching MAC address for NAT networking... | |
[default] Clearing any previously set forwarded ports... | |
[default] Creating shared folders metadata... | |
[default] Clearing any previously set network interfaces... | |
[default] Preparing network interfaces based on configuration... | |
[default] Forwarding ports... | |
[default] -- 22 => 2222 (adapter 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
Bringing machine 'default' up with 'virtualbox' provider... | |
[default] Importing base box 'puppetlabs-wheezy64'... | |
[default] | |
[default] Matching MAC address for NAT networking... | |
[default] Setting the name of the VM... | |
[default] Clearing any previously set forwarded ports... | |
[default] Creating shared folders metadata... | |
[default] Clearing any previously set network interfaces... | |
[default] Preparing network interfaces based on configuration... | |
[default] Forwarding ports... |
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
<VirtualHost *:80> | |
ServerAdmin webmaster@localhost | |
DocumentRoot /var/www | |
<Directory /> | |
Options FollowSymLinks | |
AllowOverride All | |
</Directory> | |
<Directory /var/www/> | |
Options Indexes FollowSymLinks MultiViews |
NewerOlder