Skip to content

Instantly share code, notes, and snippets.

Roger Stringer freekrai

Block or report user

Report or block freekrai

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@freekrai
freekrai / NextValetDriver.php
Created Feb 23, 2019 — forked from james2doyle/NextValetDriver.php
A Laravel Valet driver for running generated Next.js sites. This driver assumes you have not changed the default public path (/out) in the next.config.js
View NextValetDriver.php
<?php
/**
* NextValetDriver for running compiled next.js sites
*/
class NextValetDriver extends BasicValetDriver
{
/**
* Determine if the driver serves the request.
*
View ApplePushNotification.php
<?
/*
This is part of the Reprise framework, not yet released publicly.
Copyright 2013 Marco Arment. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
View README.md

Build the application

go build -o queued *.go

Run the application

Now, to run our application, how about we start it with 2048 workers, just for kicks?

@freekrai
freekrai / Tab.css
Last active Feb 22, 2018 — forked from diegocasmo/Tab.js
Source code for implementing a React <Tabs/> component.
View Tab.css
ul.tabs-nav.nav.navbar-nav.navbar-left {
margin: 0px;
padding: 0px;
list-style: none;
}
li.tab {
display: inline-block;
padding: 10px;
margin-right: 5px;
@freekrai
freekrai / Procfile
Created Feb 16, 2018 — forked from jordansissel/Procfile
Jenkins on Heroku
View Procfile
# Only listen on http; disable ajp and https
web: java -jar jenkins.war --httpPort=$PORT --ajp13Port=-1 --httpsPort=-1
View Good-CONTRIBUTING.md-template.md

Contributing

When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.

Please note we have a code of conduct, please follow it in all your interactions with the project.

Pull Request Process

  1. Ensure any install or build dependencies are removed before the end of the layer when doing a
@freekrai
freekrai / 1.js
Last active Aug 11, 2017
questions
View 1.js
var string = "Alphabet";
function firstNonRepeatedCharacter(string) {
var string = string.toLowerCase();
for (var i = 0; i < string.length; i++) {
var c = string.charAt(i);
if (string.indexOf(c) == i && string.indexOf(c, i + 1) == -1) {
return c;
}
}
@freekrai
freekrai / gist:636a92008f3099c4bb4399677082eb8f
Created Jun 25, 2017 — forked from pnommensen/gist:707b5519766ba45366dd
Ghost CMS with NGINX for Maximum Performance
View gist:636a92008f3099c4bb4399677082eb8f

Full blog post can be found here: http://pnommensen.com/2014/09/07/high-performance-ghost-configuration-with-nginx/

Ghost is an open source platform for blogging founded by John O'Nolan and Hannah Wolfe. It's a node.js application and therefore works great in conjunction with nginx. This guide will will help you create a high performance nginx virtual host configuration for Ghost.

"Don't use #nodejs for static content" - @trevnorris. If #nginx isn't sitting in front of your node server, you're probably doing it wrong.

— Bryan Hughes (@nebrius) August 30, 2014
<script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>

The node.js application runs on a port on your server

@freekrai
freekrai / examples.md
Created Jun 25, 2017 — forked from ErisDS/examples.md
Ghost Filter Query examples
View examples.md

Filter Queries - Example Use Cases

Here are a few example use cases, these use cases combine filter with other parameters to make useful API queries. The syntax for any of this may change between now, implementation, and release - they're meant as illustrative examples :)

Fetch 3 posts with tags which match 'photo' or 'video' and aren't the post with id 5.

api.posts.browse({filter: "tags:[photo, video] + id:-5", limit="3"});

GET /api/posts?filter=tags%3A%5Bphoto%2Cvideo%5D%2Bid%3A-5&limit=3

View 5 minute local Kubernetes Cluster on Mac
# Reference:
https://www.cloudgear.net/blog/2015/5-minutes-kubernetes-setup/
# install homebrew and cask
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# install virtualbox
brew cask install virtualbox
# install dockertoolbox
You can’t perform that action at this time.