DB::enableQueryLog();
dd(DB::getQueryLog()); #output last executed queries
DB::table('users')->toSql() #show the generated sql statement
DB::table('users')->getQuery()->wheres #show wheres conditions
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
//has to return object | |
module.exports = { | |
key: 'Hello' | |
} |
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
#!/bin/env sh | |
USER=ubuntu | |
SERVER=example.com | |
DESTINATION=/var/www/ics-feed | |
git archive -o latest.zip HEAD | |
scp latest.zip $USER@$SERVER:$DESTINATION | |
ssh $USER@$SERVER " \ | |
mkdir -vp $DESTINATION && cd $DESTINATION \ |
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
/* | |
Stream / QueryStreams | |
---------------------------- | |
Ref: http://mongoosejs.com/docs/api.html#querystream_QueryStream | |
one chunk == one document | |
*/ | |
readable = Model.where('created').gte(twoWeeksAgo).stream(); |
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 casper = require('casper').create({ | |
viewportSize: { | |
width: 1024, | |
height: 768 | |
}, | |
pageSettings: { | |
webSecurityEnabled: false | |
}, | |
exitOnError: false, | |
waitTimeout: 70000 |
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
FORMAT: 1A | |
HOST: https://api-sandbox.foxycart.com | |
# FoxyCart | |
# FoxyCart API Root [/] | |
## API starting point [GET] | |
+ Request |
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
license: gpl-3.0 | |
height: 300 | |
border: no |
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
#!/usr/bin/env node | |
/** | |
* Send a Joke to your mobile using AWS SNS service | |
* Usage: | |
* ./send.js phoneNumber [firstName] [lastName] | |
* | |
*/ | |
const http = require('http'); |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
<script src="https://cdn.jsdelivr.net/lodash/4/lodash.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/2.1.3/benchmark.min.js"></script> | |
</head> | |
<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 latest'; | |
import nodemailer from 'nodemailer@2.5.0'; | |
import request from 'request@2.81.0'; | |
module.exports = function(context, cb) { | |
const url = context.query.url; | |
const kindleAddress = context.query.address || context.secrets.KINDLE_ADDRESS; | |
if (!url) { | |
return cb(null, "missing url parameter"); |
OlderNewer