Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

kapitanluffy kapitanluffy

🏠
Working from home
View GitHub Profile
View SublimeLinter.sublime-settings
{
"debug": true,
"delay": 0.5,
"linters": {
// basically, this is just what you need in enabling a linter
"php": {
"disable": false
},
"phpcs": {
"args": [
View .tmux.conf
set -g prefix C-space
# Use Alt-arrow keys without prefix key to switch panes
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tpm'
@kapitanluffy
kapitanluffy / compiler.php
Created Nov 12, 2019
Compiles classes into a single giant package file
View compiler.php
<?php
/**
* Compiles all files into one giant package file
*
* Usage php compiler.php path/directory/PackageFoo
*
* We assume that your package is under a package folder. This will be used as the package file name
* e.g. path/directory/PackageFoo/
*
@kapitanluffy
kapitanluffy / mount.bat
Created Apr 22, 2019
Mount directory to specified drive letter with fallback to achieve ubiquity across networks
View mount.bat
@echo off
:: Mount directory to specified drive letter with fallback to achieve ubiquity across networks
:: Checks existence of host by the following order
:: - Check host in LAN
:: - Check host in Remote
:: - Check host in Local
:: Since Windows does not have native support for sftp/ssh we use sshfs (FUSE) instead
@kapitanluffy
kapitanluffy / gamifyApi.js
Created Mar 18, 2019
amazon.com/hz/gamification/api/contributor/dashboard
View gamifyApi.js
function gamifyApi() {
window.location.href = "https://www.amazon.com/hz/gamification/api/contributor/dashboard/"
+ window.CustomerProfileRootProps.directedId
+ "?ownerView=false"
+ "&customerFollowEnabled=false"
+ "&token=" + window.CustomerProfileRootProps.contributorDashboardData.token
}
@kapitanluffy
kapitanluffy / install-docker-ubuntu.sh
Created Jan 25, 2019
Convenience script for installing docker in Ubuntu
View install-docker-ubuntu.sh
#!/bin/bash
# Convenience script for installing docker in Ubuntu
#
# https://docs.docker.com/install/linux/docker-ce/ubuntu/#install-using-the-repository
# https://docs.docker.com/install/linux/linux-postinstall/
apt-get update
apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
View isEven.php
<?php
function isEven($num) {
return ($num % 2 == 0);
}
View screen_cheatsheet.markdown

Screen Quick Reference

Basic

Description Command
Start a new session with session name screen -S <session_name>
List running sessions / screens screen -ls
Attach to a running session screen -x
Attach to a running session with name screen -r <session_name>
@kapitanluffy
kapitanluffy / SetTransparency.bat
Created Dec 7, 2018
Portable batch file for creating SetTransparency.exe in Sublime Text directory
View SetTransparency.bat
@echo off
SETLOCAL EnableDelayedExpansion
:: Run to automatically place SetTransparency.exe in ST3 installation folder instead of downloading it from repo
:: Original exe found @ https://github.com/ivellioscolin/settransparency
:: Related issue @ https://github.com/ivellioscolin/sublime-plugin-glassit/issues/4
:: Settings
set stpath=%ProgramFiles%\Sublime Text 3
set exefile=SetTransparency.exe
View StringList.php
<?php
class StringList extends \ArrayObject
{
protected $data = [];
public function __construct($data, $delimiter = " ")
{
self::checkNonScalarValues($data);