- User goes to /posts
- User goes to /authors/1
- User goes to /posts
- User goes to /authors/1
- User goes to /authors/2
//this constructor, MyObject is supposed to only have 1 publically exposed method: .getResults() | |
;(function ( $, window, document, undefined ) { | |
window.MyObject = function(params){ | |
var error = params.error; | |
function _shouldFireRequest = function(){ | |
//some logic | |
return boolean |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>App</title> | |
<%= stylesheet_link_tag 'application', media: 'all' %> | |
<%= javascript_include_tag 'application' %> | |
<%= javascript_include_tag "templates/all" %> | |
<%= csrf_meta_tags %> | |
</head> | |
<body> |
192.30.253.112 github.com | |
192.30.253.119 gist.github.com | |
151.101.44.133 assets-cdn.github.com |
history | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n10 |
'use strict' | |
const express = require('express') | |
const app = express() | |
const http = require('http') | |
const server = http.createServer(app).listen(9000, () => { | |
console.log('debug', 'express started process:', process.pid) | |
app.get('/test-1', (req, res, next) => { |
const obj = {} | |
function doSomething () { | |
return new Promise((resolve, reject) => { | |
obj.create({ | |
name: 'Dylan', | |
username: 'dylan', | |
photo: 'avatarurl.com', | |
email: 'dylan@myemail.com' | |
}, |
var crypto = require('crypto'); | |
// larger numbers mean better security, less | |
var config = { | |
// size of the generated hash | |
hashBytes: 32, | |
// larger salt means hashed passwords are more resistant to rainbow table, but | |
// you get diminishing returns pretty fast | |
saltBytes: 16, | |
// more iterations means an attacker has to take longer to brute force an |
const execa = require('execa') | |
const Listr = require('listr') | |
const PROD_APP_NAME = '<replace with: heroku name of prod app>' | |
const STAGING_APP_NAME = '<replace with: heroku name of staging app>' | |
const tasks = new Listr([ | |
{ | |
title: 'setup git remote - staging', | |
task: () => |
// an element with class 'font_resize' with css properties: | |
// * max-height | |
// * max-width | |
// * font-size | |
// the element has children span elements, the font size inside these spans will re resized. | |
;(function($){ | |
$.fn.fontResize = function(options){ | |
var spans = $('span:visible', this); | |
var heightMax = parseInt($(this).css('max-height'), 10), |