Skip to content

Instantly share code, notes, and snippets.

View keiosweb's full-sized avatar

Keios Solutions keiosweb

View GitHub Profile
// by Erik Wrenholt
import java.util.*;
class Mandelbrot
{
static int BAILOUT = 16;
static int MAX_ITERATIONS = 1000;
private static int iterate(float x, float y)
{
@keiosweb
keiosweb / csrf-disable-syntax
Last active August 29, 2015 14:23
Possible csrf disabling syntax for OctoberCMS
public function boot() {
$request = $this->app->make('request');
if ($request->is('should/not/be/csrf/checked/path/*')) {
$this->app->make('csrf')->disable();
}
}
// or, alternatively with facades
public function boot() {
<div class="confirm-container">
<!--This will contain the confirmation when the email is successfully sent-->
</div>
<form class="flexiContactForm" role="form"
data-request="{{ __SELF__ }}::onMailSent"
data-request-update="'{{ __SELF__ }}::confirm': '.confirm-container'">
<div class="form-groups">
<div class="form-group">
<input type="text" class="form-control" value="" name="name" placeholder="Enter name">
{% if not user %}
<form
onsubmit="$(this).request('onSignin', {
url: '{{ __SELF__.signInTarget | raw }}'
{% if __SELF__.hasRedirect %}
, data: {
redirect: '{{ __SELF__.redirect }}'
}
{% endif %}
}); return false;">
{% if not user %}
<form onsubmit="$(this).request('onRegister', {
url: '{{ __SELF__.registerTarget | raw }}'
{% if __SELF__.hasRedirect %}
, data: {
redirect: '{{ __SELF__.redirect }}'
}
{% endif %}
}); return false;">
<div class="form-group">
{{ form_ajax('onUpdate', { model: user, redirect: __SELF__.getRedirect }) }}
<div class="form-group">
<label for="firstName">First Name</label>
<input name="name" type="text" class="form-control" id="firstName" value="{{ form_value('first_name') }}">
</div>
<div class="form-group">
<label for="lastName">First Name</label>
<input name="name" type="text" class="form-control" id="lastName" value="{{ form_value('last_name') }}">
@keiosweb
keiosweb / simplemenu.twig
Last active October 15, 2015 08:22
SimpleMenu Raw
<!-- Static navbar -->
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
@keiosweb
keiosweb / git-update.sh
Created November 22, 2015 17:35
Visits all directories in current directories and git pulls them if they are git repos. Lists directories in which git pull failed at the end.
#!/bin/bash
date=`date +%d%m%Y-%H%M`
echo "Failed updates:" > /tmp/gitupdate-$date.log
for dir in *; do
if [[ -d $dir ]]; then
cd $dir
if [[ -d ".git" ]]; then
echo
echo "Updating $dir ..."
echo "-----------------------------------------"
@keiosweb
keiosweb / msbt54_item_number_bugfix.md
Last active March 4, 2016 16:02
MSBT 5.4 Loot Item Number Bugfix
  1. Go to /Interface/AddOns/MikScrollingBattleText/

  2. Copy MSBTLoot.lua somewhere (backup)

  3. Open MSBTLoot.lua

  4. Find lines 100 - 102

  5. Change

@keiosweb
keiosweb / msbt54_item_number_bugfix_pl.md
Created March 4, 2016 16:12
MSBT 5.4 Loot Item Number Bugfix PL
  1. Przejdź do folderu /Interface/AddOns/MikScrollingBattleText/

  2. Skopiuj gdzieś w ramach kopii zapasowej plik MSBTLoot.lua

  3. Otwórz plik MSBTLoot.lua

  4. Znajdź linie 100 - 102

  5. Zmień