Skip to content

Instantly share code, notes, and snippets.

View LeShadow's full-sized avatar
💭
¯\_(ツ)_/¯

Sebastiaan Provost LeShadow

💭
¯\_(ツ)_/¯
View GitHub Profile
@LeShadow
LeShadow / Simple blade view
Created February 1, 2014 18:25
This is an example of a simple blade view
@section('content')
@if (count($sets) == 0)
<p>There are no sets defined yet!</p>
@else
@foreach ($sets as $set)
<p>{{ $set->name }}</p>
@endforeach
@endif
@stop
@LeShadow
LeShadow / gist:9457610
Created March 10, 2014 00:55
laravel baseController function to be able to pass on standard settings defined in an array to your view.
BaseController.php, add the following:
protected function show_view($view, $tempData="")
{
$settings = array('setting1'=>'value');
$data = array();
if($tempData != "")
{
$data['data'] = $tempData;
}
<?php
class Schedule extends Eloquent {
/**
* The database table used by the model.
*
* @var string
*/
protected $table = 'schedule';
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QProcess>
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
this->process = new QProcess(this);
ui->setupUi(this);
=> default: [2014-07-10T13:24:34+00:00] INFO: Setting the run_list to ["recipe[apt]", "recipe[vagrant_1]", "recipe[mysql::server]", "recipe[extras]"] from JSON
==> default: [2014-07-10T13:24:34+00:00] INFO: Run List is [recipe[apt], recipe[vagrant_1], recipe[mysql::server], recipe[extras]]
#
# Cookbook Name:: mysql
# Recipe:: default
#
# Copyright 2008-2011, Opscode, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
@LeShadow
LeShadow / 0_reuse_code.js
Created August 5, 2014 14:32
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
require 'optparse'
options = {}
OptionParser.new do |opts|
opts.banner = "Usage: gitify [options]"
opts.on("-n", "--namespace=NAMESPACE", "Define the namespace of the repository. if this is empty, no namespace will be used.") do |namespace|
options[:namespace] = namespace
end
/usr/bin/gitify:23:in `load': /Library/Ruby/Gems/2.0.0/gems/projectify-0.5.0/bin/gitify:46: syntax error, unexpected keyword_else, expecting keyword_end (SyntaxError)
/Library/Ruby/Gems/2.0.0/gems/projectify-0.5.0/bin/gitify:53: syntax error, unexpected tIDENTIFIER, expecting keyword_end
command = options[:type] + " " options[:dir]
^
/Library/Ruby/Gems/2.0.0/gems/projectify-0.5.0/bin/gitify:54: syntax error, unexpected keyword_elsif, expecting keyword_end
elsif options.has_key?("dir".to_sym) do
^
/Library/Ruby/Gems/2.0.0/gems/projectify-0.5.0/bin/gitify:56: syntax error, unexpected keyword_else, expecting keyword_end
/Library/Ruby/Gems/2.0.0/gems/projectify-0.5.0/bin/gitify:70: syntax error, unexpected end-of-input, expecting keyword_end
from /usr/bin/gitify:23:in `<main>'
@LeShadow
LeShadow / #drupageddon PoC
Created October 16, 2014 07:29
#drupageddon PoC
require 'net/http'
require 'uri'
require 'optparse'
options = {}
OptionParser.new do |opts|
opts.banner = "Usage: poc.rb [options]"
opts.on("-d", "--drupal_url=drupal_host", "Define the url for your drupalsite without. (www.domain.tld)") do |drupal_url|