Skip to content

Instantly share code, notes, and snippets.

View tiggreen's full-sized avatar
🤖

Tigran Hakobyan tiggreen

🤖
View GitHub Profile
<?php
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Tests\TestCase;
class SettingsTest extends TestCase
{
use DatabaseTransactions;
public function setUp()
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class SettingsController extends Controller
{
public function __construct()
@tiggreen
tiggreen / vue_tabs.js
Created March 9, 2018 14:43
Simple Vue.js tab navigation component with Bulma
<template>
<div class="container">
<div class="columns">
<div class="column is-12">
<div class="tabs help-tabs">
<ul>
<li :class="[ lang === 'crontab' ? 'is-active' : '']"><a @click="lang='crontab'">Crontab</a>
</li>
<li :class="[ lang === 'php' ? 'is-active' : '']"><a @click="lang='php'">PHP</a></li>
<li :class="[ lang === 'bash' ? 'is-active' : '']"><a @click="lang='bash'">Bash</a></li>
{
"user": {
"debug": true,
"delay": 0.25,
"error_color": "D02000",
"gutter_theme": "Packages/SublimeLinter/gutter-themes/Default/Default.gutter-theme",
"gutter_theme_excludes": [],
"lint_mode": "background",
"linters": {
"php": {
@tiggreen
tiggreen / ex.js
Created July 23, 2016 21:39 — forked from JeffreyWay/ex.js
Laracasts.com Episode: Algolia + JavaScript + Vue
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Algolia with JS</title>
<link rel="stylesheet" href="app.css">
</head>
<body>
@tiggreen
tiggreen / psr2.php
Created May 12, 2016 13:26
psr-2-sample.php
// PSR2 codin standard
class Foo extends Bar implements FooInterface
{
public function sampleFunction($a, $b = null)
{
if ($a === $b) {
bar();
} elseif ($a > $b) {
$foo->bar($arg1);
} else {
@tiggreen
tiggreen / trait_example.php
Created April 15, 2016 21:31
PHP Trait Use Example
<?php
trait HelloBufferWorld {
public function sayHello() {
echo 'Hello Buffer Engineers!';
}
}
class ASampleClass {
use HelloBufferWorld;
}
@tiggreen
tiggreen / week1_rob.java
Created January 24, 2016 15:44
Misht Community #1
import static org.junit.Assert.assertEquals;
import java.util.*;
import java.lang.*;
import java.io.*;
/*
"Given an input string s, reverse words in a string."
Do this in-place without allocating an extra space.
The input string doesn't contain any leading or trailing
@tiggreen
tiggreen / week1_karen.cpp
Last active January 24, 2016 15:39
Misht Community #1
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <string>
using namespace std;
void reverseWordOrder(string::iterator begin, string::iterator end){
// reverse string by chars
reverse(begin, end);
// now, reverse the words
@tiggreen
tiggreen / QuickSort.scala
Created May 28, 2014 15:09
QuickSort in Scala
object Sorting {
def main(args: Array[String]) {
var lst = Array(1, 6, 2, 12, 22, 8, 99, 45, 12, 28, 1, 54)
val sortedList = quickSort(lst)
for(i <- sortedList) {
println(i)
}
}