Skip to content

Instantly share code, notes, and snippets.

View jongacnik's full-sized avatar

Jon jongacnik

View GitHub Profile
@jongacnik
jongacnik / how-to.md
Last active September 5, 2018 01:44
Installing Homebase
  1. Deploy a new Vultr server. I opted for a little single CPU, 512 mb server. It only supports IPv6, hopefully that doesn't become a problem for homebase... We'll find out.
  2. ssh into the new server. Turns out I needed to specify the interface since it is IPv6. Looked a little something like:
ssh -6 root@xxxxxxxxxxxxxxxxxxxxxxxx
  1. Next up, install nvm so we can install node. At the time of setup, this is the script I used:
var striptags = require('striptags')
function smartExcerpt (string) {
var re = /(^.*?[a-zA-Z0-9\)\”\"]{2,}[.!?])[\s\”\"]+\W*[A-Z]/
var matches = striptags(string).match(re)
return matches && matches[1] ? matches[1] : string
}
var html = require('choo/html')
module.exports = (style, classname, svg) => {
style = style || ''
classname = classname || ''
var viewBox = [0,0,1,1]
if (require('../browser')) {
svg.style.display = 'block'
var html = require('choo/html')
module.exports = function (state, emitter) {
var styletag = html`<style></style>`
document.head.appendChild(styletag)
function addStyle () {
styletag.innerHTML = `.vh{height:${window.innerHeight}px}`
}
@jongacnik
jongacnik / ie-vm.md
Last active March 28, 2018 20:21
Using IE VM in VirtualBox
@jongacnik
jongacnik / firstsentence.php
Created March 22, 2018 23:54
Extract first sentence from text
<?php
function firstsentence($string) {
$parts = preg_split('/(^.*?[a-zA-Z0-9\)\”\"]{2,}[.!?])[\s\”\"]+\W*[A-Z]/', strip_tags($string), -1, PREG_SPLIT_DELIM_CAPTURE);
$parts = array_values(array_filter($parts));
return (is_array($parts) && isset($parts[0])) ? $parts[0] : $string;
}
@jongacnik
jongacnik / bash-snippets.md
Last active March 4, 2019 01:16
bash snippets
  1. zip folder using name of folder (replace folder)
zip -r folder{.zip,}
  1. recursive find and replace in files
# on mac

Keybase proof

I hereby claim:

  • I am jongacnik on github.
  • I am jmg (https://keybase.io/jmg) on keybase.
  • I have a public key whose fingerprint is 045D 53A0 A290 ABF4 4256 CA06 3DCE 993C BC7A E596

To claim this, I am signing this object:

@jongacnik
jongacnik / bam-kirby.sh
Last active April 18, 2018 01:36
bam-kirby
kirby install --kit=plainkit public \
&& cd public \
&& kirby plugin:install jongacnik/kirby-index-field \
&& kirby plugin:install jongacnik/kirby-hidebar-field \
&& kirby plugin:install jongacnik/kirby-image-api \
&& kirby plugin:install jongacnik/kirby-opengraph \
&& kirby plugin:install jongacnik/kirby-favicon \
&& kirby plugin:install jongacnik/kirby-pagetitle \
&& kirby plugin:install jongacnik/kirby-busted \
&& kirby plugin:install jbeyerstedt/kirby-plugin-kirbytextRaw \
@jongacnik
jongacnik / index.js
Created November 25, 2017 04:34
choop - react component
var choo = require('choop')
var html = require('choop/html')
var h = require('choop/h')
var Pickers = require('react-color')
var app = choo()
app.route('/', function () {
return html`
<body>