Skip to content

Instantly share code, notes, and snippets.

View smgladkovskiy's full-sized avatar
💻
Senior Refactoring Engineer

Sergey Gladkovskiy smgladkovskiy

💻
Senior Refactoring Engineer
View GitHub Profile
@montanaflynn
montanaflynn / pget.go
Last active October 21, 2023 06:12
Bounded Parallel Get Requests in Golang
package main
import (
"fmt"
"net/http"
"sort"
"time"
)
// a struct to hold the result from each request including an index
@MrTrustor
MrTrustor / clean-docker-for-mac.sh
Last active November 21, 2023 11:38
This script cleans the Docker.qcow2 file that takes a lot of disk space with Docker For Mac. You can specify some Docker images that you would like to keep.
#!/bin/bash
# Copyright 2017 Théo Chamley
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in the Software
# without restriction, including without limitation the rights to use, copy, modify, merge,
# publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
# to whom the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all copies or
@Ellrion
Ellrion / AbstractPresenter.php
Last active September 23, 2021 00:02
Презентеры в Laravel.
<?php
namespace App\Presenters;
abstract class AbstractPresenter
{
/**
* The resource that is the object that was decorated.
*
* @var mixed
@ssx
ssx / logstash.conf
Created October 24, 2015 15:09
Laravel Logs to Logstash
input {
lumberjack {
port => 5000
type => "logs"
ssl_certificate => "/shared/logstash-certs/logstash-forwarder.crt"
ssl_key => "/shared/logstash-certs/logstash-forwarder.key"
}
}
## Add your filters here
@lefant
lefant / README.unison.md
Created October 9, 2015 04:53
how to set up unison on mac os x for dropbox style instant syncing

installing unison on mac

brew install unison

workaround for missing unison-fswatch in brew

sudo pip install macfsevents
curl https://raw.githubusercontent.com/jumpstarter-io/unox/master/unox.py |sudo tee /usr/local/bin/unison-fsmonitor >/dev/null
sudo chmod +x /usr/local/bin/unison-fsmonitor

Contributing

When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.

Please note we have a code of conduct, please follow it in all your interactions with the project.

Pull Request Process

  1. Ensure any install or build dependencies are removed before the end of the layer when doing a
@wenzhixin
wenzhixin / ubuntu14.04-command-line-install-android-sdk
Last active July 4, 2024 05:29
Ubuntu 14.04 command line install android sdk
# install openjdk
sudo apt-get install openjdk-7-jdk
# download android sdk
wget http://dl.google.com/android/android-sdk_r24.2-linux.tgz
tar -xvf android-sdk_r24.2-linux.tgz
cd android-sdk-linux/tools
# install all sdk packages
@chrismdp
chrismdp / s3.sh
Last active March 5, 2024 12:57
Uploading to S3 in 18 lines of Shell (used to upload builds for http://soltrader.net)
# You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine
# This is how I upload my new Sol Trader builds (http://soltrader.net)
# Based on a modified script from here: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash
S3KEY="my aws key"
S3SECRET="my aws secret" # pass these in
function putS3
{
path=$1
@ngauthier
ngauthier / timeout_and_tick.go
Created February 10, 2015 18:14
Golang timeout and tick loop
// keepDoingSomething will keep trying to doSomething() until either
// we get a result from doSomething() or the timeout expires
func keepDoingSomething() (bool, error) {
timeout := time.After(5 * time.Second)
tick := time.Tick(500 * time.Millisecond)
// Keep trying until we're timed out or got a result or got an error
for {
select {
// Got a timeout! fail with a timeout error
case <-timeout:
@smgladkovskiy
smgladkovskiy / RelationOrderScopeTrait.php
Last active August 29, 2015 14:08
Laravel 4 Relation table column orderBy scope
<?php namespace Site\Traits;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasOne;
use Illuminate\Database\Eloquent\Builder;
trait RelationOrderScopeTrait {
/**
* Order also and by related table column