Skip to content

Instantly share code, notes, and snippets.

:octocat:
Busy busy bee.

Luke Oliff lukeocodes

View GitHub Profile
@lukeocodes
lukeocodes / force-push.sh
Created Dec 12, 2018
Forcibly push your changes to remote.
View force-push.sh
# Force your push to remote.
git push --force
@lukeocodes
lukeocodes / add-commit-with-message.sh
Created Dec 12, 2018
Add changes and commit with message.
View add-commit-with-message.sh
# Add your changes.
git add <files>
# Commit your changes again.
git commit -m
@lukeocodes
lukeocodes / rescue-last-commit.sh
Last active Dec 12, 2018
Rescue your Repo! Reset the last commit and fix it.
View rescue-last-commit.sh
# Reset exactly 1 commit.
git reset HEAD~
@lukeocodes
lukeocodes / create-react-app.sh
Last active Dec 12, 2018
Create a new React app using create-react-app
View create-react-app.sh
npx create-react-app my-secure-react-app && cd my-secure-react-app
@lukeocodes
lukeocodes / node-check.sh
Created Dec 12, 2018
Check Node and NPM Version
View node-check.sh
node --version && npm --version
View loading.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View XMLWriter.php
<?php
namespace App\Libs;
class XMLWriter
{
private $output;
public function recursiveArrayToXml($array, $parent = '', $prefix = '', $header = '<?xml version="1.0" encoding="UTF-8"?>')
{
@lukeocodes
lukeocodes / Differ.sh
Last active Aug 29, 2015
Diff two source locations and produce deployment script.
View Differ.sh
#!/bin/bash
diffing() {
echo "$(diff -arq --exclude='.svn' --exclude='.git' $1 $2)"
}
while [[ $# > 1 ]] do
key="$1"
shift
View test.php
<?php
$xml = simplexml_load_file('set_5-221A-1-y08.xml');
$StopPoints = $xml->StopPoints;
foreach ($StopPoints->AnnotatedStopPointRef as $key => $StopPoint) {
$StopPointsData[] = (array)$StopPoint;
}
@lukeocodes
lukeocodes / QuickRearrangeFiles.php
Created May 7, 2013
Rearrange file import array to be nicer for geeks :)
View QuickRearrangeFiles.php
<?php
public static function rearrangeFiles($arr) {
foreach($arr as $key => $all){
foreach($all as $i => $val){
$new[$i][$key] = $val;
}
}
return $new;
}
You can’t perform that action at this time.