Skip to content

Instantly share code, notes, and snippets.

View kostaspt's full-sized avatar

Konstantinos Pittas kostaspt

View GitHub Profile
@kostaspt
kostaspt / gist:3710645
Last active October 10, 2015 15:18
Sublime Text 2 Preferences
{
"auto_complete_commit_on_tab": true,
"bold_folder_labels": true,
"color_scheme": "Packages/User/daylerees/Peacock.tmTheme",
"draw_white_space": "selection",
"ensure_newline_at_eof_on_save": true,
"fade_fold_buttons": false,
"font_face": "Source Code Pro",
"font_size": 12,
"highlight_line": true,
@kostaspt
kostaspt / greek-domains.txt
Created December 13, 2013 15:50
999 .com and .gr domains based on 5000 top used greek words.
άκουσες = akouses.gr - akouses.com
άλλαξε = allakse.com
άλλοι = alloi.gr
άλλον = allon.gr
άλλους = allous.gr
άνδρα = andra.gr
άνθρωπο = anthropo.gr
άνοιξε = anoikse.gr - anoikse.com
άντρα = antra.gr
άρεσε = arese.gr
@kostaspt
kostaspt / DatabaseSeeder.php
Created February 4, 2014 16:42
For Laravel database seeder. It truncates all tables and then it runs all seeders available.
// File: app/database/seeds/DatabaseSeeder.php
class DatabaseSeeder extends Seeder {
public function run()
{
if (App::environment() === 'production') exit();
Eloquent::unguard();
@kostaspt
kostaspt / OADate.php
Created December 8, 2014 11:57
Convert OADate to DateTime format
<?php
use Carbon\Carbon;
public function oaDateToFormat($OADate, $format = 'Y-m-d H:i:s')
{
$date = Carbon::createFromFormat('Y-m-d H:i:s', '1899-12-30 00:00:00');
$date->addSeconds($OADate * 24 * 60 * 60);
@kostaspt
kostaspt / ExampleRequest.php
Last active October 30, 2015 17:56
[Laravel 5.1] Form Request
<?php
namespace App\Http\Requests;
class ExampleRequest extends Request
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
@kostaspt
kostaspt / trello-client.js
Last active November 17, 2021 05:32
trello-client.js
var deferred, isFunction, isReady, ready, waitUntil, wrapper,
slice = [].slice;
wrapper = function(window, jQuery, opts) {
var $, Trello, apiEndpoint, authEndpoint, authorizeURL, baseURL, collection, fn, fn1, i, intentEndpoint, j, key, len, len1, localStorage, location, parseRestArgs, readStorage, ref, ref1, storagePrefix, token, type, version, writeStorage;
$ = jQuery;
key = opts.key, token = opts.token, apiEndpoint = opts.apiEndpoint, authEndpoint = opts.authEndpoint, intentEndpoint = opts.intentEndpoint, version = opts.version;
baseURL = apiEndpoint + "/" + version + "/";
location = window.location;
Trello = {
# Install/Update dependencies with npm (using yarn), bower, composer and then runs gulp.
alias depsinstall="if [ -f ./package.json ]; then yarn ; fi && if [ -f ./bower.json ]; then bower install ; fi && if [ -f ./composer.json ]; then composer install ; fi && if [ -f ./gulpfile.js ]; then gulp ; fi"
alias depsupdate="if [ -f ./package.json ]; then yarn upgrade ; fi && if [ -f ./bower.json ]; then bower update ; fi && if [ -f ./composer.json ]; then composer update ; fi && if [ -f ./gulpfile.js ]; then gulp ; fi"
@kostaspt
kostaspt / alias.sh
Created August 22, 2017 17:37
Alias to get the current Ethereum price from Coinbase
alias eth_price="curl --silent -XGET https://api.coinbase.com/v2/prices/ETH-EUR/buy | python3 -c \"import sys, json; print(json.load(sys.stdin)['data']['amount'] + '€')\""
@kostaspt
kostaspt / gr.bash
Created December 6, 2022 10:49
Git Rebase (alias)
unalias gr
gr() {
if [ -z $1 ]; then branch="master"; else branch=$1; fi
old_stash=$(git rev-parse -q --verify refs/stash)
git stash save -u
git checkout $branch
git pull --rebase
git checkout -
@kostaspt
kostaspt / Makefile
Created May 18, 2024 11:36
Makefile for Go
DIRECTORIES=go list -f '{{.Dir}}' ./... | grep -v /vendor/
PACKAGES=go list ./... | grep -v /vendor/
.PHONY: build
build: clean
mkdir -p bin/ && go build -o ./bin/ `$(call DIRECTORIES)`
.PHONY: clean
clean:
go clean