Skip to content

Instantly share code, notes, and snippets.

5.38 s 100.0% 0 s start
5.38 s 100.0% 0 s main
5.38 s 100.0% 0 s alacritty::main
1.00 ms 0.0% 1.00 ms alacritty::term::{{impl}}::compute_fg_rgb
5.38 s 99.9% 8.00 ms alacritty::run
1.00 ms 0.0% 0 s objc::message::send_message<objc::runtime::Object,(),()>
1.00 ms 0.0% 0 s objc::message::send_unverified<objc::runtime::Object,(),()>
1.00 ms 0.0% 0 s objc::message::{{impl}}::invoke<()>
1.00 ms 0.0% 1.00 ms -[NSAutoreleasePool release]
4.00 ms 0.0% 0 s glutin::api::cocoa::NSEventToEvent
@wayneashleyberry
wayneashleyberry / example.js
Last active April 11, 2017 14:32
Datastore example
const datastore = require('@google-cloud/datastore')();
const key1 = datastore.key(['Users', 1, 'Comments']);
const comment1 = {
userId: 1,
commentBody: '...',
ts: new Date(),
};
package main
import (
"fmt"
"net/http"
"os"
"github.com/gorilla/handlers"
"github.com/gorilla/mux"
)
@wayneashleyberry
wayneashleyberry / Random.php
Last active May 27, 2016 07:53
Random ordering query scope
<?php
namespace App\Scopes;
use Illuminate\Database\MySqlConnection;
use Illuminate\Database\Eloquent\Builder;
trait Random
{
/**
@wayneashleyberry
wayneashleyberry / overcast.opml
Last active May 6, 2016 12:55
Overcast Podcast Subscriptions
<?xml version="1.0"?>
<opml version="1.0">
<head>
<title>Overcast Podcast Subscriptions</title>
</head>
<body>
<outline type="rss" text="Freakonomics Radio" title="Freakonomics Radio" xmlUrl="http://feeds.feedburner.com/freakonomicsradio" htmlUrl="http://www.wnyc.org/articles/freakonomics-podcast"/>
<outline type="rss" text="Software Engineering Radio - The Podcast for Professional Software Developers" title="Software Engineering Radio - The Podcast for Professional Software Developers" xmlUrl="http://feeds.feedburner.com/se-radio" htmlUrl="http://www.se-radio.net/"/>
<outline type="rss" text="FLOSS Weekly (MP3)" title="FLOSS Weekly (MP3)" xmlUrl="http://feeds.twit.tv/floss.xml" htmlUrl="https://twit.tv/floss"/>
<outline type="rss" text="The Path to Performance" title="The Path to Performance" xmlUrl="https://simplecast.com/podcasts/1103/rss" htmlUrl="http://pathtoperf.com/"/>
@wayneashleyberry
wayneashleyberry / UpgradeTimestamps.php
Created April 20, 2016 10:03
Laravel Artisan command to upgrade timestamp columns for MySQL 5.7 strict mode.
<?php
namespace App\Console\Commands;
use DB;
use Illuminate\Console\Command;
class UpgradeTimestamps extends Command
{
/**
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use League\Glide\Responses\SymfonyResponseFactory;
use Aws\S3\S3Client;
use League\Flysystem\AwsS3v3\AwsS3Adapter;
use League\Flysystem\Adapter\Local;
use League\Flysystem\Filesystem;
@wayneashleyberry
wayneashleyberry / progress-bar.go
Created October 29, 2015 13:04
sweet progress bar for go
package main
import "time"
import "github.com/cheggaaa/pb"
func main() {
count := 100000
bar := pb.StartNew(count)
bar.Format("╢██░╟")
for i := 0; i < count; i++ {
@wayneashleyberry
wayneashleyberry / Composer Travis Jank
Last active August 29, 2015 14:15
composer travis stuff
curl -X POST https://api.github.com/authorizations -u wayneashleyberry -H "Content-Type: application/json" -d '{"scopes": ["public_repo"], "note": "Travis"}'
travis encrypt -r org/repo GH_TOKEN=... --add env.global
@wayneashleyberry
wayneashleyberry / app.js
Last active August 29, 2015 14:10
React cross component communications test
var Item = React.createClass({
propTypes: {
name: React.PropTypes.string.isRequired,
active: React.PropTypes.bool.isRequired,
toggleActive: React.PropTypes.func.isRequired
},
getDefaultProps: function() {
return {
active: false
}