Skip to content

Instantly share code, notes, and snippets.

View fosron's full-sized avatar
💻
Hard at work

Tautvydas fosron

💻
Hard at work
View GitHub Profile
#!/bin/bash
# Install script for Latest WordPress by Johnathan Williamson - extended by Don Gilbert
# Disclaimer: It might not bloody work
# Disclaimer 2: I'm not responsible for any screwups ... :)
# DB Variables
echo "MySQL Host:"
read mysqlhost
export mysqlhost
@fosron
fosron / sequencer-tests.js
Created August 6, 2014 07:44
sequencer.js
shiv.addOnLoad(function() {
var seq = new Sequencer([
function(cb) {
shiv.log("Log callback 1");
cb && cb();
},
function(cb) {
shiv.log("Log callback 2");
cb && cb();
},
@fosron
fosron / drupalCoreVuln.txt
Created October 16, 2014 10:54
Drupal <= 7.31 core SQL vulnerability
SektionEins GmbH
www.sektioneins.de
-= Security Advisory =-
Advisory: Drupal - pre-auth SQL Injection Vulnerability
Release Date: 2014/10/15
Last Modified: 2014/10/15
Author: Stefan Horst [stefan.horst[at]sektioneins.de]
@fosron
fosron / lietuviskiVardai.php
Created October 29, 2014 10:49
Lietuviškų vardų linksniai.
<?php
/**
* Lietuviškų vardų linksniai.
*
* @author Dainius Kaupaitis <dainius at kaupaitis dot lt>
* @copyright Copyleft (ↄ) 2011, Dainius Kaupaitis
* @version 1.0
* @package Vardai
*/
<?php
class Arr
{
/**
* Remove keys from input array that are not in the whitelist
*
* // Get the values "username", "password" from $_POST
* $auth = Arr::filterKeys($_POST, array('username', 'password'));
@fosron
fosron / osx_install.sh
Last active August 29, 2015 14:17 — forked from t-io/osx_install.sh
#!/bin/sh
echo Install all AppStore Apps at first!
# no solution to automate AppStore installs
read -p "Press any key to continue... " -n1 -s
echo '\n'
echo Install and Set San Francisco as System Font
ruby -e "$(curl -fsSL https://raw.github.com/wellsriley/YosemiteSanFranciscoFont/master/install)"
echo Install Homebrew, Postgres, wget and cask
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
@fosron
fosron / modal.css
Last active August 29, 2015 14:20
Simple jQuery Modal Window
.ModalOverlay {
position: absolute;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.29);
z-index: 1000;
overflow: hidden;
}
.ModalOverlay .Modal {
@fosron
fosron / stringEncryption.php
Created July 23, 2015 09:14
Modern method to encrypt/decrypt a string in PHP
<?php
/**
* Simple string encryption/decryption function.
* CHANGE $secret_key and $secret_iv !!!
**/
function stringEncryption($action, $string){
$output = false;
$encrypt_method = 'AES-256-CBC'; // Default
@fosron
fosron / lumen-resource-route.php
Created February 18, 2016 15:27 — forked from sohelamin/lumen-resource-route.php
Lumen Resource Routing
<?php
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
@fosron
fosron / promises-reading-list.md
Created February 25, 2016 15:48 — forked from joepie91/promises-reading-list.md
Promises (Bluebird) reading list

Promises reading list

This is a list of examples and articles, in roughly the order you should follow them, to show and explain how promises work and why you should use them. I'll probably add more things to this list over time.

This list primarily focuses on Bluebird, but the basic functionality should also work in ES6 Promises, and some examples are included on how to replicate Bluebird functionality with ES6 promises. You should still use Bluebird where possible, though - they are faster, less error-prone, and have more utilities.

I'm available for tutoring and code review :)

You may reuse all gists for any purpose under the WTFPL / CC0 (whichever you prefer).