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 / 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;
@ninjapanzer
ninjapanzer / config_editor.pseudo
Created March 1, 2016 13:49
config editor pseudo
// If we are initializing the file
argv = ["C:/config.exe", "init"]
// If we are editing first_name
argv = ["C:/config.exe", "edit", "cypher"]
BEGIN
if argv[1] == "init"
string first_name = ""
open file "./config" for writing
do
output "Enter first name"
@ninjapanzer
ninjapanzer / event.js
Last active April 26, 2016 21:22
Timezone_Rails
//eonasdan-bootstrap-datetimepicker
jQuery('#datetimepickerStart').datetimepicker({
sideBySide: true
});
jQuery('#datetimepickerStop').datetimepicker({
sideBySide: true,
useCurrent: false //Important! See issue #1075
});
jQuery('#datetimepickerStart').on('dp.change', function (e) {