Skip to content

Instantly share code, notes, and snippets.

View codyphobe's full-sized avatar
🏍️
Chasing the sunset

Cody codyphobe

🏍️
Chasing the sunset
View GitHub Profile
<?php
namespace App\Merge;
class Marge
{
protected $data = [];
public function setData($data)
{
@codyphobe
codyphobe / v-cloak.md
Created May 12, 2017 02:26 — forked from adamwathan/v-cloak.md
Useful CSS utilities for Vue.js cloaking

Handy helpers for controlling visibility of elements until Vue has compiled.

Use like:

<div v-cloak>
  <h1>
    <span class="v-cloak--inline">Loading...</span> <!-- Only displayed before compiling -->
    <span class="v-cloak--hidden">{{ post.title }}</span> <!-- Hidden until compiling is finished -->
 
@codyphobe
codyphobe / HashidsRoutable.php
Created May 7, 2017 16:51 — forked from TheNodi/HashidsRoutable.php
Laravel Model Bindings with Hashids
<?php
namespace App;
use Vinkla\Hashids\HashidsManager;
/**
* Bind a model to a route based on the hash of
* its id (or other specified key).
*
#!/usr/bin/env bash
function pw {
# Set the command that should run when changes are detected
run="clear && printf '\e[3J' && vendor/bin/phpunit"
# Retrieve the custom arguments, defaulting to "tests"
[[ -n $@ ]] && args=$@ || args="tests"
# Run the command first...
@codyphobe
codyphobe / repl_bot.js
Created April 26, 2017 05:54 — forked from vogonistic/repl_bot.js
REPL example bot for mineflayer. Allows testing javascript over CLI to speed up development.
// REPL example bot for mineflayer
//
// Connects to server but doesn't have any built in logic. The terminal where
// it was started is now a REPL (Read-Eval-Print-Loop). Anything typed will be
// interpreted as javascript printed using util.inspect. Don't forget to try
// tab completion. These variables are exposed as local:
//
// var mineflayer = require('mineflayer');
// var bot = mineflayer.createBot({ username: 'REPL' });
//
@codyphobe
codyphobe / PlayerDisplayModifier.java
Created January 21, 2017 04:52 — forked from aadnk/PlayerDisplayModifier.java
Change the display name and skin of any player. Credit to @bigteddy98, @ferrybig and @lenis0012 for writing the original version.
package com.comphenix.example;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.TimeUnit;
@codyphobe
codyphobe / DetectInventoryOpenClose.java
Created January 20, 2017 13:07 — forked from MineTheCube/DetectInventoryOpenClose.java
Detect when a player opens or closes his own inventory
package fr.onecraft.inventory;
import com.comphenix.tinyprotocol.TinyProtocol;
import io.netty.channel.Channel;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
import java.lang.reflect.Field;
@codyphobe
codyphobe / INSTALL.md
Created January 6, 2017 00:29 — forked from jpillora/INSTALL.md
Headless Transmission on Mac OS X
  1. Go to https://developer.apple.com/downloads/index.action and search for "Command line tools" and choose the one for your Mac OSX

  2. Go to http://brew.sh/ and enter the one-liner into the Terminal, you now have brew installed (a better Mac ports)

  3. Install transmission-daemon with

    brew install transmission
    
  4. Copy the startup config for launchctl with

    ln -sfv /usr/local/opt/transmission/*.plist ~/Library/LaunchAgents
    
@codyphobe
codyphobe / bishop.c
Created October 13, 2016 20:43 — forked from nirenjan/bishop.c
Simulate a drunken bishop walk to produce OpenSSL random art.
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#define XLIM 17
#define YLIM 9
#define ARSZ (XLIM * YLIM)
#define DEBUG 0
@codyphobe
codyphobe / config.php
Created September 27, 2016 23:54 — forked from jarektkaczyk/config.php
Laravel - tinker like a boss (with PsySH)
<?php // ~/.config/psysh/config.php
// Anything not Laravel - let's try to autoload something likely to exist
if (!defined('LARAVEL_START')) {
return [
'defaultIncludes' => [
getcwd().'/vendor/autoload.php',
getcwd().'/bootstrap/autoload.php',
],
];