Skip to content

Instantly share code, notes, and snippets.

View mikedotexe's full-sized avatar
🤙
hakuna matata

Mike Purvis mikedotexe

🤙
hakuna matata
View GitHub Profile
@walterhiggins
walterhiggins / trampoline.js
Last active August 29, 2015 14:15
A Minecraft Trampoline (Version 2)
/*global require, events */
var blocks = require('blocks'),
sounds = require('sounds');
var bouncers = {};
function bounceOn___(event){
var player = event.player;
var id = player.ID;
var bounce = bouncers[id] || 0.75; // get bounciness (default 0.75)
var location = player.location;
@mardlin
mardlin / coinbaseAuthUrlGenerator.js
Last active May 10, 2025 08:59
A simple script for building a Coinbase Connect Authorization URL
/*
* A simple script for building an authorization redirect URL for your Coinbase Connect app.
* Follow the ##STEPS
*/
/* ##STEP1**: To generate an Authorization URI for a Sandbox App, set this to TRUE
* Hint: If you're using this script, you probably want to start on the Sandbox
*/
var useSandbox = true;
@jeebak
jeebak / boxstarter.ps1
Last active August 18, 2022 15:10
My Boxstarter Script
#
# https://github.com/tknerr/bills-kitchen
# All you need for cooking with Chef and Vagrant on Windows you will find in Bill's Kitchen
# https://github.com/tknerr/linus-kitchen
# An Ubuntu-based developer VM for hacking with Chef, Vagrant, Docker & Co
#
# Based on: https://github.com/felixrieseberg/windows-development-environment
# Test-Admin is not available yet, so use...
if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) {
@kvnm
kvnm / UntoldDrupalValetDriver.php
Created September 7, 2016 02:32
Valet driver for Drupal that allows a custom web directory.
<?php
class UntoldDrupalValetDriver extends DrupalValetDriver {
private function documentRoot($sitePath) {
return $sitePath . '/drupal';
}
public function serves($sitePath, $siteName, $uri) {
return parent::serves($this->documentRoot($sitePath), $siteName, $uri);
}
@shahdhiren
shahdhiren / P12toPEM.txt
Created September 9, 2016 14:57
Convert P12 file for Push Notification to PEM format
Development Phase:
Step 1: Create Certificate .pem from Certificate .p12
Command: openssl pkcs12 -clcerts -nokeys -out apns-dev-cert.pem -in apns-dev-cert.p12
Step 2: Create Key .pem from Key .p12
Command : openssl pkcs12 -nocerts -out apns-dev-key.pem -in apns-dev-key.p12
Step 3: Optional (If you want to remove pass phrase asked in second step)
Command : openssl rsa -in apns-dev-key.pem -out apns-dev-key-noenc.pem
@liberatr
liberatr / Debug
Last active August 28, 2021 00:08
A Drupal 8 migrate processor plugin for debugging
<?php
namespace Drupal\uwec_migration\Plugin\migrate\process;
use Drupal\migrate\MigrateExecutableInterface;
use Drupal\migrate\ProcessPluginBase;
use Drupal\migrate\Row;
/**
* This plugin allows your migration to spit the value to the command line.
@arxdsilva
arxdsilva / working_directory.go
Last active January 6, 2025 19:29
How to get the current working directory in golang
package main
// More info on Getwd()
// https://golang.org/src/os/getwd.go
//
import(
"os"
"fmt"
"log"
)
@daggerhart
daggerhart / mymodule.module.php
Last active August 4, 2020 05:55
Simple Drupal 7 hook_theme() and render array examples
<?php
/**
* Implements hook_theme()
* @return array
*/
function mymodule_theme(){
$items = array();
$items['mymodule_custom_template'] = array(
@timneutkens
timneutkens / index.js
Last active February 14, 2025 21:45
Clear console/terminal in node.js the right way
const readline = require('readline')
const blank = '\n'.repeat(process.stdout.rows)
console.log(blank)
readline.cursorTo(process.stdout, 0, 0)
readline.clearScreenDown(process.stdout)
@twardnw
twardnw / slack_files_cleanup.rb
Created August 8, 2017 17:14
script to delete public files in Slack org, anything > 30 days is deleted
require 'net/http'
require 'json'
require 'uri'
@token = ''
@count = 0
def list_files
ts_to = (Time.now - 30 * 24 * 60 * 60).to_i # 30 days ago
params = {
token: @token,