All files\s*\|\s*([0-9.]+)
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
<?php | |
$file = 'myfile.php'; | |
$last_modified_time = filemtime($file); | |
$etag = md5_file($file); | |
header("Last-Modified: ".gmdate("D, d M Y H:i:s", $last_modified_time)." GMT"); | |
header("Etag: $etag"); | |
if (@strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) == $last_modified_time || | |
trim($_SERVER['HTTP_IF_NONE_MATCH']) == $etag) { |
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 schema = mongoose.Schema({ | |
email: { | |
type: String, | |
required: true, | |
lowercase: true, | |
index: { | |
unique: true | |
} | |
}, | |
expireAt: { |
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
# coding: utf-8 | |
# Copyright 2015 Álvaro Justen <https://github.com/turicas/rows/> | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, |
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
let transaction | |
try { | |
transaction = await Sequelize.transaction() | |
let employee = await Employee.create({ | |
name: req.body.name, | |
employeeId: req.body.employeeId, | |
birthday: req.body.birthdate | |
}, transaction) |
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
const { google } = require('googleapis') | |
module.exports = app => { | |
const controller = {} | |
controller.auth = async (req, res, next) => { | |
try { | |
const oauth2Client = new google.auth.OAuth2( | |
'YOUR_CLIENT_ID', |
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
#!/usr/bin/env python | |
from datetime import datetime | |
from json import loads | |
from time import gmtime, mktime, strptime | |
# LevelDict é um wrapper usando dicionário para LevelDB | |
# https://github.com/maurobaraldi/leveldict | |
from leveldict import LevelJsonDict | |
from requests import get |
When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:
const Article = require('../../../../app/models/article');
Those suck for maintenance and they're ugly.