This file contains hidden or 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
| // Start Express | |
| const express = require("express"); | |
| const app = express(); | |
| // Set the view directory to /views | |
| app.set("views", __dirname + "/views"); | |
| // Let's use the Pug templating language | |
| app.set("view engine", "pug"); |
This file contains hidden or 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
| #page_reader[font="sans"] .reader_content { | |
| font-family: "ProximaNova", Helvetica, Arial, sans-serif; | |
| } |
This file contains hidden or 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(){var b=function(){};b.extend=function(c){c||(c={});var d=this,b=c.initialize,e=function(){b?b.apply(this,arguments):d.apply(this,arguments)},a;for(a in d)"prototype"!=a&&(e[a]=d[a]);for(a in d.prototype)e.prototype[a]=d.prototype[a];for(a in c)e.prototype[a]=c[a];return e};module.exports?module.exports=b:this.MiniClass=b})(); |
This file contains hidden or 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
| INSTRUCTIONS = { | |
| 'and' => { | |
| 0x00 => [:address, :address], | |
| 0x01 => [:address, :literal] | |
| }, | |
| 'or' => { | |
| 0x02 => [:address, :address], | |
| 0x03 => [:address, :literal] | |
| }, | |
| 'xor' => { |
This file contains hidden or 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
| connect = require 'connect' | |
| app = connect() | |
| # find-replace "connect" with "express" and req.secure will be a boolean rather than undefined. | |
| app.use (req, res) -> | |
| res.setHeader 'Content-Type', 'text/plain' | |
| res.end "Secure: #{req.secure}" | |
| app.listen(5000) |
This file contains hidden or 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 express = require('express'); | |
| var app = express(); | |
| app.all('*', function(req, res, next) { | |
| var youAreAllowed = Math.random() < 0.5; // example | |
| if (youAreAllowed) | |
| next(); | |
| else | |
| res.send(403); |
This file contains hidden or 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
| -- to start SQLite3 (worked on my Mac and on CAEN)... | |
| -- sqlite3 sailors.db | |
| -- to run this file in SQLite3... | |
| -- .read this_filename.sql | |
| drop table if exists Sailors; | |
| create table Sailors ( | |
| sid integer primary key, | |
| name varchar(100), |
This file contains hidden or 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
| first digit | |
| ,------------------------------------------------ | |
| [>++++++++++<-] | |
| second digit | |
| ,------------------------------------------------ | |
| >> | |
| third digit | |
| ,------------------------------------------------ |
This file contains hidden or 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 iframesLoaded = 0; | |
| $("form").each(function() { | |
| var $form = $(this); | |
| var $iframe = $("<iframe name='temporary-iframe'></iframe>"); | |
| var oldTarget = $form.prop("target"); | |
| $form.prop("target", "temporary-iframe"); |
This file contains hidden or 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 path = require("path"); | |
| var connect = require("connect"); | |
| var favicon = require("serve-favicon"); | |
| var helmet = require("helmet"); | |
| var app = connect(); | |
| app.use(helmet.defaults()); | |
| var faviconPath = path.resolve(__dirname, "favicon.ico"); |