Skip to content

Instantly share code, notes, and snippets.

View ninjapanzer's full-sized avatar
🌋
Back to the FOSS

Paul Scarrone ninjapanzer

🌋
Back to the FOSS
View GitHub Profile
@ninjapanzer
ninjapanzer / sync_config_branch.sh
Created December 26, 2016 21:07
Will provide interactive overwrite of diff between two branches
#!/usr/bin/env bash
CONFIGBRANCH=add_config_files
CURRENTBRANCH=`git symbolic-ref --short -q HEAD`
TMPPATH=tmp/config
rm -r $TMPPATH
NAMES="`git diff --name-only $CURRENTBRANCH $CONFIGBRANCH`"
@ninjapanzer
ninjapanzer / thing.php
Last active November 17, 2016 04:18
static method usage
public class Butt{
private $string = '';
public static function ha($some_string)
{
$instance = new self($some_string);
return $instance->addHa();
}
public function __construct($some_string)
@ninjapanzer
ninjapanzer / jest.js
Created November 16, 2016 18:39
Jest Elixir Helper
var Elixir = require('laravel-elixir');
var config = Elixir.config;
var TestingTask = require('laravel-elixir/tasks/shared/Tests');
/*
|----------------------------------------------------------------
| Jest Testing
|----------------------------------------------------------------
|
*/
@ninjapanzer
ninjapanzer / ServeCommand.php
Created October 25, 2016 21:07
Lumen Artisan Serve Command
<?php
namespace App\Console\Commands;
use Exception;
use Illuminate\Console\Command;
use Symfony\Component\Process\ProcessUtils;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Process\PhpExecutableFinder;
/*eslint-disable no-undef */
var path = require('path')
var webpack = require('webpack')
module.exports = {
context: __dirname + '/src',
entry: './app.js',
output: {
filename: 'app.js',
path: __dirname + '/dist'
@ninjapanzer
ninjapanzer / bubble_sort
Created March 6, 2016 16:14
Bubble Sort C++
#include <iostream>
int main() {
const int SIZE = 10;
int unsorted[SIZE] = {5,3,8,4,1,2,9,6,0,7};
for (int i = 0 ; i < ( SIZE - 1 ); i++) {
for (int j = 0 ; j < SIZE - i - 1; j++) {
std::cout << unsorted[i] << " " << unsorted[j] << std::endl;
if (unsorted[j] > unsorted[j+1]){
#include <iostream>
int main() {
int x = 5;
int y = 10;
std::cout << "Orig: x = " << x << std::endl
<< " y = " << y << std::endl;
x = x + y;
@ninjapanzer
ninjapanzer / selection_sort.cpp
Last active March 5, 2016 22:30
Selection Sort
#include <iostream>
int main() {
const int SIZE = 10;
int unsorted[SIZE] = {5,3,1,6,8,2,9,0,4,7};
for(int i = 0; i < SIZE - 1; i++){
int current_pos = i;
for(int j = i + 1; j < SIZE; j++){
if(unsorted[j] < unsorted[current_pos]){
#include <iostream>
int main(int argc, char* argv[]) {
const int SIZE = 12;
std::string* months = new std::string[SIZE];
int* max_days = new int[SIZE];
months[0] = "january";
max_days[0] = 31;