Skip to content

Instantly share code, notes, and snippets.

Avatar

Roger Stringer freekrai

View GitHub Profile
@freekrai
freekrai / notion2blog.js
Created Sep 16, 2020 — forked from mayneyao/notion2blog.js
Notion.so > Personal Blog | custom domain + disqus comment
View notion2blog.js
const MY_DOMAIN = "agodrich.com"
const START_PAGE = "https://www.notion.so/gatsby-starter-notion-2c5e3d685aa341088d4cd8daca52fcc2"
const DISQUS_SHORTNAME = "agodrich"
addEventListener('fetch', event => {
event.respondWith(fetchAndApply(event.request))
})
const corsHeaders = {
"Access-Control-Allow-Origin": "*",
@freekrai
freekrai / install_ffmpeg_ubuntu.sh
Created May 14, 2020 — forked from seankross/install_ffmpeg_ubuntu.sh
Install latest ffmpeg on ubuntu 12.04 or 14.04
View install_ffmpeg_ubuntu.sh
#!/bin/bash
# Bash script to install latest version of ffmpeg and its dependencies on Ubuntu 12.04 or 14.04
# Inspired from https://gist.github.com/faleev/3435377
# Remove any existing packages:
sudo apt-get -y remove ffmpeg x264 libav-tools libvpx-dev libx264-dev
# Get the dependencies (Ubuntu Server or headless users):
sudo apt-get update
@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