Skip to content

Instantly share code, notes, and snippets.

View eimkasp's full-sized avatar
🍀
Building...

Eimantas eimkasp

🍀
Building...
View GitHub Profile
add_theme_support('menus');
add_theme_support('post-thumbnails');
add_action('init', 'register_my_menus');
function register_my_menus() {
register_nav_menus(
array(
'primary-menu' => __('Viršutinis meniu'),
'secondary-menu' => __('Kategoriju meniu')
// 'secondary-menu' => __( 'Pagrindinis meniu' ),
$(document).ready(function(){
$('.more_products').click(function(){
$('.flipper:nth-child(3)').slideToggle();
$('.flipper:nth-child(4)').slideToggle();
$('.more_products').css("top", "70%");
});
});
fpsLabel = new createjs.Text("-- fps", "bold 18px Arial", "#000000");
stage.addChild(fpsLabel);
fpsLabel.x = 10;
fpsLabel.y = 20;
stage.addChild(fpsLabel);
function tick(event) {
fpsLabel.text = Math.round(createjs.Ticker.getMeasuredFPS()) + " fps";
}
@eimkasp
eimkasp / createJS start file
Created June 21, 2013 06:04
CreateJS boilerplate
function init() {
hover = false;
angle = 0;
canvas = document.getElementById("mainStage");
stage = new createjs.Stage(canvas);
createjs.Ticker.setFPS(30);
createjs.Ticker.addEventListener("tick", tick);
stage.enableMouseOver(10);
planet1.addEventListener("mouseover", manageMouseOver);
planet1.addEventListener("mouseout", manageMouseOut);
@eimkasp
eimkasp / new_gist_file
Created September 4, 2013 14:53
C++ get line example with few words
getline(fd, pav, ','); fd >> ws;
cout << pav << endl;
getline(fd, degalai, ',');
fd >> sąnaudos;
A[i].Dėti(pav, degalai, sąnaudos);
@eimkasp
eimkasp / gist:f32039881fb3c997efb5
Last active August 29, 2015 14:03
Appache httpd.conf example scriball
<VirtualHost *:80>
ServerName local.scriball.com
DocumentRoot /web/Scriball-FrontEnd/scriball/public
SetEnv APPLICATION_ENV dev2
RewriteEngine on
<Directory /web/Scriball-FrontEnd/scriball/public>
Options Indexes IncludesNOEXEC FollowSymLinks -MultiViews
AllowOverride All
Order allow,deny
@eimkasp
eimkasp / gist:16717f567c7b95b307ac
Created July 8, 2015 13:31
svg gradient text with shadow
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<linearGradient id="textgradient" x1="0%" x2="0%" y1="0%" y2="100%">
<stop stop-color="#cdb57c" offset="0%"/>
<stop stop-color="#66481f" offset="100%"/>
</linearGradient>
</defs>
<filter id="dropShadow">
@eimkasp
eimkasp / laravel
Created August 24, 2018 11:30
Laravel basic komandos
php artisan make:auth // autentifikacijos kodo sukurimui
php artisan make:migration create_product_table // sukuria migracijos faila /database/migrations folderyje
php artisan migrate // Paleisti duombazes migracijas ir sukurti duomenu bazes struktura pagal aprasytas migracijas
php artisan make:controller TestController // kontrolerio sukurimas, TestController - musu kontrolerio pavadinimas.
failai sukuriami /app/Http/controllers folderyje
php artisan make:controller TestController --resource // kontrolerio sukurimas su pradiniais funkcijus aprasais, TestController - musu kontrolerio pavadinimas
php artisan make:model Product // sukuria modeli Product - musu modelio pavadinimas. Modeliai sukuriami /app folderyje
pries naudojant sukurta modeli kontroleryje reikia parasyti failo virsuje: use Product;
public function store( Request $request ) {
//
$newsItem = new NewsItem();
$newsItem->title = $request->input('title');
$newsItem->content = $request->input('content');
$newsItem->image = "";
// sita eilute grazina prisijungusio vartotojo ID
// jei naudoju Auth::user(), tai virsui nepamirsti parasyti use Auth;
$newsItem->user_id = Auth::user()->id;
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class NewsItem extends Model
{
//
protected $table = 'news_items';