Skip to content

Instantly share code, notes, and snippets.

View BonfaceKilz's full-sized avatar
💭
Scheme-ing ❤️

BonfaceKilz BonfaceKilz

💭
Scheme-ing ❤️
View GitHub Profile
@BonfaceKilz
BonfaceKilz / setup.md
Last active June 21, 2018 13:57
Working with laravel 4.1 (which is no longer supported)

Introduction

I've setup a docker image to work with the laravel 4.1 project and all its dependencies. Working with depracated code can be a nuisance, especially if you run a rolling release distro. You might break stuff in you local machine when downgrading things. Needless to say, it's frustrating. This is a short guide on how to set up and run a docker instance that has everything you need to work on any laravel 4.1 project.

I'll try as much as possible to dockerize things since upgrading the project in a safe way is one of the future goals of this project.

My goal for this was to have a working stable environment that can be replicated anywhere on any machine that has docker installed.

For the initial setup, I've cloned laradock to the repository and set up the initial .env.

@BonfaceKilz
BonfaceKilz / laravelPermissions.md
Last active March 20, 2018 12:32
Setting proper laravel permissions. Otherwise, server will be down

If you don't set permissions right, your server will be down. If too restrictive, i.e. your server(e.g nginx or apache) has no write permissions for some things, content won't be served. If too liberal, you will pawned and alot of bad things will maybe happen. Here's how I set the permissions(should be added to playbooks if possible).

There are 2 ways of setting up the permissions:

  1. Make webserver owner of all files [Recommended]
  2. Giving yourself ownership

1. Make webserver owner of all files

sudo chown -R www-data:www-data /path/to/dir
@BonfaceKilz
BonfaceKilz / labels.m
Created December 3, 2017 20:15
The Simulink scope block does not support the manipulation of graphics properties in scope displays. To add labels to the block, the following snippet of Matlab code is used
shh = get(0, 'ShowHiddenHandles');
set(0, 'ShowHiddenHandles', 'On');
set(gcf, 'menubar', 'figure');
set(gcf, 'CloseRequestFcn', 'closereq');
set(gcf, 'DefaultLineClipping', 'Off');
set(0, 'ShowHiddenHandles', shh);
@BonfaceKilz
BonfaceKilz / i3config
Created September 24, 2017 06:21
My i3 config file
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
@BonfaceKilz
BonfaceKilz / capture.js
Created September 19, 2017 09:50
Testing the responsiveness of a website in an array of different screen sizes.
/*
requires: phantomjs, async
usage: phantoms capture.js
*/
var site = 'http://localhost:3000/index.html';
var async = require('async'),
sizes = [
[320, 480], //iphone
[384, 640], //LG Optimus
@BonfaceKilz
BonfaceKilz / tmux-cheatsheet.markdown
Created July 5, 2017 11:58 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@BonfaceKilz
BonfaceKilz / curltest.c
Created June 4, 2017 20:06
A program that uses libcurl to fetch data in JSON format. Later parsed with json-c
/**
* A demo of how to get data from a website in JSON format
* I'll get data from this site:
* http://jsonplaceholder.typicode.com/posts
*
* Requirements:
*
* json-c - https://github.com/json-c/json-c
* libcurl - http://curl.haxx.se/libcurl/c
*
@BonfaceKilz
BonfaceKilz / i3_reference.md
Last active April 17, 2017 21:39
i3 Cheatsheet

Basics

$mod + : Open new terminal
$mod + j : Focus Left
$mod + k : Focus down
$mod + l : Focus up
$mod + ; : Focus right
$mod + : toggle focus mode

Moving Windows

Keybase proof

I hereby claim:

  • I am BonfaceKilz on github.
  • I am bonfacemunyoki (https://keybase.io/bonfacemunyoki) on keybase.
  • I have a public key whose fingerprint is D4F0 9EB1 1017 7E03 C28E 2FE1 F5BB AE1E 0392 253F

To claim this, I am signing this object:

@BonfaceKilz
BonfaceKilz / emacsclient.md
Created March 29, 2017 21:46
Setting up emacsclient

Add the following to your .bashrc file:

# Emacs config
export ALTERNATE_EDITOR=emacs EDITOR=emacsclient VISUAL=emacsclient
# Set an alias
alias ec="emacsclient"

Add the following to your ~/.config/systemd/user/emacs.service file:

[Unit]