Skip to content

Instantly share code, notes, and snippets.

View logikinc's full-sized avatar
💭
I may be slow to respond.

LogikIO logikinc

💭
I may be slow to respond.
View GitHub Profile
@logikinc
logikinc / deploy.sh
Created June 14, 2018 19:00 — forked from BenSampo/deploy.sh
Laravel deploy script
# Change to the project directory
cd /home/forge/domain.com
# Turn on maintenance mode
php artisan down
# Pull the latest changes from the git repository
git pull origin master
# Install/update composer dependecies
@logikinc
logikinc / provisioner-php5.5.sh
Created February 23, 2018 17:01 — forked from anonymous/provisioner-php5.5.sh
Scotch Box Change PHP Repository
#!/usr/bin/env bash
# Update PHP Repo
sudo rm /etc/apt/sources.list.d/ondrej-php5-5_6-trusty.list
sudo add-apt-repository -y ppa:ondrej/php
sudo apt-get -y update
# Remove PHP 5.6
sudo apt-get --remove purge -y php5 php5-cli php5-curl php5-gd php5-intl php5-mcrypt php5-memcached php5-mysqlnd php5-readline php5-sqlite php5-cgi php5-common php5-fpm php5-imagick php5-json php5-memcache php5-mongo php5-pgsql php5-redis php-pear
sudo apt-get -y autoremove
@logikinc
logikinc / laravel-forge-deploy.sh
Created July 27, 2017 20:10 — forked from rap2hpoutre/laravel-forge-deploy.sh
Laravel Forge deploy script without downtime
# stop script on error signal
set -e
# remove old deployment folders
if [ -d "/home/forge/deploy" ]; then
rm -R /home/forge/deploy
fi
if [ -d "/home/forge/backup" ]; then
rm -R /home/forge/backup
fi
@logikinc
logikinc / percent-change.php
Created July 18, 2017 07:42 — forked from giltotherescue/percent-change.php
Calculate Percentage Change
<?
/**
Calculates the percentage change between two numbers.
Useful for showing how much traffic has changed from one time period to the next.
*/
$percentChange = function ($cur, $prev) {
@logikinc
logikinc / a-new-mac-setup.md
Created June 1, 2016 22:02 — forked from maxfenton/a-new-mac-setup.md
System setup stuff for a new mac

New computer setup

  • a/o 2016-05-21 *

--

Format the drive

  1. Restart with Cmd-R or Cmd-D
  2. Erase drive / 3x if second-hand
  3. Reinstall MacOS
@logikinc
logikinc / post.md
Created June 1, 2016 04:36 — forked from ikwattro/post.md
Discover Graph Databases with Neo4j & PHP

Discover Graph Databases with Neo4j and PHP

Graph databases are now one of the core technologies of companies dealing with highly connected data.

Business graphs, social graphs, knowledge graphs, interest graphs and media graphs are frequently in the (technology) news. And for a reason. The graph model represents a very flexible way of handling relationships in your data. And graph databases provide fast and efficient storage, retrieval and querying for it.

Neo4j, the most popular graph database, has proven that ability to deal with massive amount of high connected data in many use-cases.

@logikinc
logikinc / 1_instantiate.html
Created March 18, 2016 01:29 — forked from scalabl3/1_instantiate.html
Getting Started Tutorial for Using PubNub Presence with JavaScript
<!-- Include the PubNub Library -->
<script src="https://cdn.pubnub.com/pubnub.min.js"></script>
<!-- Instantiate PubNub -->
<script type="text/javascript">
var PUBNUB_demo = PUBNUB.init({
publish_key: 'demo',
subscribe_key: 'demo'
});
// PhantomJS Cheatsheet
$ brew update && brew install phantomjs // install PhantomJS with brew
phantom.exit();
var page = require('webpage').create();
page.open('http://example.com', function() {});
page.evaluate(function() { return document.title; });
@logikinc
logikinc / index.php
Created October 15, 2015 17:36 — forked from cosenary/index.php
Instagram PHP API - Likes
<?php
require 'Instagram.php';
use MetzWeb\Instagram\Instagram;
$instagram = new Instagram(array(
'apiKey' => 'YOUR_APP_KEY',
'apiSecret' => 'YOUR_APP_SECRET',
'apiCallback' => 'YOUR_APP_CALLBACK'
));
@logikinc
logikinc / follow.php
Created October 15, 2015 17:36 — forked from cosenary/follow.php
Instagram API class - follow user example
<?php
require 'Instagram.php';
use MetzWeb\Instagram\Instagram;
$instagram = new Instagram(array(
'apiKey' => 'YOUR_APP_KEY',
'apiSecret' => 'YOUR_APP_SECRET',
'apiCallback' => 'YOUR_APP_CALLBACK' // must point to success.php
));