Skip to content

Instantly share code, notes, and snippets.

View keevitaja's full-sized avatar
💭
building jedmud

Tanel Tammik keevitaja

💭
building jedmud
View GitHub Profile
-- class implementation
local function class(t)
t.__index = t
return t
end
local function extend(dst,src)
for k,v in pairs(src) do
if type(k) == "string" and k:sub(1,1) ~= "_" then
dst[k] = dst[k] or v
end
<?php
require 'vendor/autoload.php';
$client = new GuzzleHttp\Client();
//$client->setDefaultOption('auth', array('username', 'password', 'Basic|Digest|NTLM|Any'));
$client->setDefaultOption('auth', array('DjangoFR', '********', 'Basic'));
$res = $client->get('http://www.example.com/system/get_user_categories/format/json/user_id/**10**');
@dzava
dzava / default.blade.php
Created January 31, 2017 02:03
Laravel bulma pagination
@if ($paginator->hasPages())
<nav class="pagination">
<a href="{{ $paginator->previousPageUrl() }}"
class="pagination-previous {{ $paginator->onFirstPage() ? 'is-disabled': '' }}">
Previous
</a>
<a href="{{ $paginator->nextPageUrl() }}"
class="pagination-next {{ !$paginator->hasMorePages() ? 'is-disabled': '' }}">
@kamigerami
kamigerami / default.vcl
Last active April 30, 2018 05:55
haproxy + ssl -> varnish -> back to haproxy for loadbalancing to --> backend0/1/2 (webhost)
# This versions uses ELB loadbalancing
# The ELB points to these two HAProxy hosts
# The C-name of the Domain points to the ELB
# ELB -> HAPROXY 1 or 2 -> Varnish --> HIT or MISS --> HAPROXY 1 or 2 -> Backend 1/2/3
vcl 4.0;
import directors;
backend haproxy1 {
.host = "172.31.xx.235"; # back to HAPROXY-1 internal address
.port = "8080";
.probe = {
@adamwathan
adamwathan / 1.md
Created August 20, 2015 16:28
Move vertically quickly in Sublime Test

Option + left/right is awesome for jumping around quickly horizontally, but if you're like me, you've probably tried to use that same muscle memory to jump vertically by using option + up/down.

Here's a few macros you can use to accomplish that, as well as creating selections while jumping vertically as well.

Add these shortcuts and you'll be in bizniz:

    //...
    { "keys": ["alt+up"], "command": "run_macro_file", "args": {"file": "Packages/User/move_3_lines_up.sublime-macro"} },
 { "keys": ["alt+down"], "command": "run_macro_file", "args": {"file": "Packages/User/move_3_lines_down.sublime-macro"} },
@depsimon
depsimon / bulma.blade.php
Created July 16, 2017 14:37
Laravel Bulma Pagination Template
@if ($paginator->hasPages())
<nav class="pagination">
{{-- Previous Page Link --}}
@if ($paginator->onFirstPage())
<a class="pagination-previous" disabled>Previous</li>
@else
<a class="pagination-previous" href="{{ $paginator->previousPageUrl() }}" rel="prev">Previous</a>
@endif
{{-- Next Page Link --}}
@dhavalv
dhavalv / LAMP_Stack_Installation.md
Last active August 26, 2020 20:15
Document for lamp stack is only apache 2.4 & php5.6 Installation...

How To Install Linux, Apache, MySQL, PHP (LAMP) stack on Ubuntu 12.04

About Lemp

LAMP stack is a group of open source software used to get web servers up and running. The acronym stands for Linux, Apache, MySQL, and PHP. Since the virtual private server is already running Ubuntu, the linux part is taken care of. Here is how to install the rest.

If any existing lamp installation & you need to upgrade your old server, uninstall all things & backup first all databases & files.

sudo apt-get purge php5*
@kolach
kolach / fix_zsh_history.sh
Created November 26, 2015 23:50
Fix for zsh: corrupt history file /home/marc/.zsh_history
#!/bin/sh
# Borrowed from http://marcparadise.com/blog/2013/09/21/how-to-fix-a-corrupt-history-file/
# If you ever see a message like this upon starting a new shell
# zsh: corrupt history file /home/marc/.zsh_history
# here is a quick fix
cd ~
mv .zsh_history .zsh_history_bad
strings .zsh_history_bad > .zsh_history
# And reload history
fc -R .zsh_history
@deeshrestha
deeshrestha / bootstrap-4.blade.php
Created December 6, 2018 18:20
Bulma Blade Template For Laravel 5.7 Pagination
{{--
Laravel's default pagination html tags modifed to make Bulma CSS compatible paginator.
1. First run "php artisan vendor:publish --tag=laravel-pagination"
2. This command will place the views in the resources/views/vendor/pagination directory.
3. Replace text on "bootstrap-4.blade.php" with this code.
@davidgomes
davidgomes / How to change Pantheon Terminal's color scheme.md
Created March 14, 2013 16:53
How to change Pantheon Terminal's color scheme

How to change Pantheon Terminal's color scheme

Many of us spend many hours of our days using their terminal. Plus, we all have different tastes when it comes to color schemes. That's why the ability to change the color scheme of a terminal is one of its more important featuresl. Throughout this tutorial, I'll teach you how you can change the looks of your terminal, step by step.

This tutorial is aimed at elementary OS users, but it also works for any Ubuntu user. Start by installing dconf-tools:

sudo apt-get install dconf-tools

Secondly, you need to decide which theme you're going to apply. You can find dozens of terminal color schemes online, you can even design your own using this web application. Design the color scheme, hit "Get Scheme" and choose "Terminator". You'll get a raw text file with a background color, a foreground color and a palette. Those strings define your color scheme. In this tutorial, I'll post an