Skip to content

Instantly share code, notes, and snippets.

View djekl's full-sized avatar
:octocat:
Working from home

Alan Wynn djekl

:octocat:
Working from home
View GitHub Profile
G90 ;Set to absolute positioning
M82 ;Extruder absolute mode
G28 ;Move to origin / Home
G1 X120 Y50 Z3 ;Linear move (X, Y, Z)
G92 E0 ;Set position
G1 E30 ;Linear move (Extruder)
G92 E0 ;Set position
G1 E-1.5 F500 ;Linear move (Extruder) (Speed 500)
G1 Z6 ;Linear move (Z)
G1 Y35 F2000 ;Linear move (Y) (Speed 2000)
<?php
/**
* Call protected/private method of a class.
*
* @param object &$object Instantiated object that we will run method on.
* @param string $methodName Method name to call
* @param array $parameters Array of parameters to pass into method.
*
* @return mixed Method return.
@djekl
djekl / artisan_db_open.php
Created February 1, 2020 20:51 — forked from calebporzio/artisan_db_open.php
An artisan command for opening the project's database in TablePlus
<?php
Artisan::command('db:open {connection?}', function ($connection = null) {
if (! file_exists('/Applications/TablePlus.app')) {
$this->warn('This command uses TablePlus, are you sure it\'s installed?');
$this->line("Install here: https://tableplus.com/\n");
}
$driver = $connection ?: config('database.default');
$host = config("database.connections.{$driver}.host");
@djekl
djekl / CSS Xbox One Achievement.markdown
Last active December 14, 2019 13:39
CSS Xbox One Achievement

CSS Xbox One Achievement

As an avid Xbox Gamer and always wanting to push myself, I decided to recreate the Xbox One Achievement Toast. ou can see a video example of it here - https://www.youtube.com/watch?v=CgwkK2uUk1c&feature=youtu.be

All I need to do now, is play this to make it complete - (Achievement Notification Sound) http://majornelson.com/2011/10/07/download-the-achievement-unlocked-sound/

Here is an example of the old 360 one - http://codepen.io/jesseGlacken/details/uwtsx/

A Pen by Alan Wynn on CodePen.

:: 1) Download srvany.exe from Microsoft Windows 2003 Resource Kit (available free from Microsoft).
:: http://www.microsoft.com/en-au/download/details.aspx?id=17657
:: ----------------------
:: 2) Copy srvany.exe into the folder where google drive is installed or next to this script file.
:: ----------------------
:: 3) Run this script as an Administrator
:: ----------------------
echo off
cls
@djekl
djekl / XboxAPI Send Message.php
Created July 31, 2019 07:06
Example on how to send a message using Guzzle via XboxAPI
<?php
require 'vendor/autoload.php';
use GuzzleHttp\Pool;
use GuzzleHttp\Client;
use GuzzleHttp\Psr7\Request;
$client = new Client();
@djekl
djekl / XboxAuth.php
Created June 15, 2019 16:33
This is the example code for XboxAuth.dev, a service that allows you to have "Sign in with Xbox" on your site!
<?php
if (isset($_GET['code'])) {
XboxAuth::callback($_GET['code']);
} else {
XboxAuth::redirect();
}
class XboxAuth
{
@djekl
djekl / 2018_02_13_142413_add_renews_at_column_to_subscriptions.php
Created March 25, 2019 06:38 — forked from garygreen/2018_02_13_142413_add_renews_at_column_to_subscriptions.php
Sync Stripe Renewal Date for all subscriptions - Laravel Console Command
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddRenewsAtColumnToSubscriptions extends Migration
{
/**
* Run the migrations.
@djekl
djekl / README.md
Created October 28, 2018 19:13 — forked from mpociot/README.md
Discord + BotMan example

BotMan - Discord example chatbot

Once you set up your discord bot, you need to add it to your server:

Look up your chatbot's client ID and visit this URL:

https://discordapp.com/oauth2/authorize?client_id=YOUR_CLIENT_ID&scope=bot&permissions=0

Run the discord.php file through CLI:

@djekl
djekl / clean-up-boot-partition-ubuntu.md
Created September 29, 2018 15:31 — forked from ipbastola/clean-up-boot-partition-ubuntu.md
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r