Skip to content

Instantly share code, notes, and snippets.

View keltanas's full-sized avatar
🇷🇺
justice will be served

Ke7Tana5 keltanas

🇷🇺
justice will be served
  • Saint Petersburg
View GitHub Profile
@asukakenji
asukakenji / 0-go-os-arch.md
Last active April 24, 2024 06:51
Go (Golang) GOOS and GOARCH

Go (Golang) GOOS and GOARCH

All of the following information is based on go version go1.17.1 darwin/amd64.

GOOS Values

GOOS Out of the Box
aix
android
@CMCDragonkai
CMCDragonkai / ssh_key_conversions.sh
Last active January 15, 2018 19:25
SSH: Conversions between OpenSSH Keys (Public/Private) and Putty Keys (PPK)
# it turns out that puttygen can do almost all conversions anyway
: '
ssh-private-public - Convert an openssh private key to an openssh public key
Usage: ssh-private-public <path-to-key> <path-to-key.pub>
'
ssh-private-public () {
ssh-keygen -f "$1" -y >"$2"
}
@subfuzion
subfuzion / curl.md
Last active May 3, 2024 09:26
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@infloop
infloop / abstractCollection.js
Last active October 19, 2015 10:43
marionette.app.utils
(function (app , _, model, $) {
/**
* @extends {Backbone.Collection}
* @type {app.collections.collectionAbstract}
*/
app.collections.collectionAbstract = Backbone.Collection.extend({
modelName: 'abstractModel',
model: model,
urlType: '',
urlParam: '',
@chadrien
chadrien / README.md
Last active September 1, 2023 12:43
Debug PHP in Docker with PHPStorm and Xdebug

Debug your PHP in Docker with Intellij/PHPStorm and Xdebug

  1. For your local dev, create a Dockerfile that is based on your production image and simply install xdebug into it. Exemple:
FROM php:5

RUN yes | pecl install xdebug \
&amp;&amp; echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" &gt; /usr/local/etc/php/conf.d/xdebug.ini \
@marvell
marvell / remove_apt_cache
Created May 18, 2015 15:29
Remove APT cache (for Dockerfile)
apt-get clean autoclean
apt-get autoremove --yes
rm -rf /var/lib/{apt,dpkg,cache,log}/
@vsouza
vsouza / .bashrc
Last active April 9, 2024 05:27
Golang setup in Mac OSX with HomeBrew. Set `GOPATH` and `GOROOT` variables in zshell, fish or bash.
# Set variables in .bashrc file
# don't forget to change your path correctly!
export GOPATH=$HOME/golang
export GOROOT=/usr/local/opt/go/libexec
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/bin
@icchan
icchan / geospatial-querying-with-go-and-mongodb.go
Created October 18, 2014 07:37
Geospatial Querying with GoLang and MongoDB
package main
import (
"encoding/json"
"fmt"
"gopkg.in/mgo.v2"
"gopkg.in/mgo.v2/bson"
"log"
)
@Kartones
Kartones / postgres-cheatsheet.md
Last active May 3, 2024 20:51
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@docteurklein
docteurklein / CompilerPass.php
Last active October 17, 2017 11:39
Service Repository Factory
<?php
public function process(ContainerBuilder $container)
{
$factory = $container->findDefinition('app.doctrine.repository.factory');
$repositories = [];
foreach ($container->findTaggedServiceIds('app.repository') as $id => $params) {
foreach ($params as $param) {
$repositories[$param['class']] = $id;