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
touch ~/aspell.personal.txt | |
vi ~/aspell.personal.txt # add words per line | |
aspell --lang=en create master /tmp/en-personal.pws < ~/aspell.personal.txt | |
cp /tmp/en-personal.pws /usr/lib/aspell | |
vim /usr/lib/aspell/en_US.multi # add the line: 'add en-personal.pws' |
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
# Ref: http://wiki.mikejung.biz/Sysbench | |
# CPU | |
sysbench --test=cpu --cpu-max-prime=20000 run | |
sysbench --test=cpu --cpu-max-prime=20000 run --num-threads=4 | |
#FILE IO | |
sysbench --test=fileio --file-total-size=4G prepare | |
sysbench --test=fileio --file-total-size=4G --file-test-mode=rndrw --max-time=300 --max-requests=0 --file-extra-flags=direct run | |
sysbench --test=fileio --file-total-size=4G cleanup |
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 Fiddler Proxy*/ | |
curl_setopt($ch, CURLOPT_PROXY, '127.0.0.1:8888'); | |
/*Use Proxy*/ | |
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1); | |
curl_setopt($ch, CURLOPT_PROXY, "IP:PORT"); | |
curl_setopt($ch, CURLOPT_PROXYUSERPWD, "username:password"); |
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"); |
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
#!/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
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
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
var casper = require('casper').create({ | |
viewportSize: { | |
width: 1024, | |
height: 768 | |
}, | |
pageSettings: { | |
webSecurityEnabled: false | |
}, | |
exitOnError: false, | |
waitTimeout: 70000 |