Skip to content

Instantly share code, notes, and snippets.

🐹
#TomsterOnTour

Dawid Pośliński PoslinskiNet

🐹
#TomsterOnTour
Block or report user

Report or block PoslinskiNet

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View semantic-commit-messages.md

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@spalladino
spalladino / mysql-docker.sh
Created Dec 22, 2015
Backup and restore a mysql database from a running Docker mysql container
View mysql-docker.sh
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@bastman
bastman / docker-cleanup-resources.md
Created Mar 31, 2016
docker cleanup guide: containers, images, volumes, networks
View docker-cleanup-resources.md

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
@vasind
vasind / ember-cli-build.js
Last active May 11, 2020
Ember CLI performance improvements and tips
View ember-cli-build.js
// Credits to the following posts that helps me to reduce build times drastically
// https://discuss.emberjs.com/t/tips-for-improving-build-time-of-large-apps/15008/12
// https://www.gokatz.me/blog/how-we-cut-down-our-ember-build-time/
//ember-cli-build.js
let EmberApp = require('ember-cli/lib/broccoli/ember-app');
let env = EmberApp.env(),
@joepie91
joepie91 / delay-promise.js
Last active May 7, 2020
ES6 Promise.delay
View delay-promise.js
module.exports = function(duration) {
return function(){
return new Promise(function(resolve, reject){
setTimeout(function(){
resolve();
}, duration)
});
};
};
@ishu3101
ishu3101 / gist_to_github_repo.md
Created Nov 24, 2015
Transfer a gist to a GitHub repository
View gist_to_github_repo.md

Transfer a gist to a GitHub repository

clone the gist

git clone https://gist.github.com/ishu3101/6fb35afd237e42ef25f9

rename the directory

mv 6fb35afd237e42ef25f9 ConvertTo-Markdown

change the working directory to the newly renamed directory

cd ConvertTo-Markdown

@hfossli
hfossli / gist:7234623
Last active Jun 3, 2019
KVO on a views geometry
View gist:7234623
- (void)viewDidLoad
{
[super viewDidLoad];
UIView *view = [[UIView alloc] initWithFrame:CGRectMake(100, 100, 300, 200)];
view.backgroundColor = [UIColor blueColor];
[self.view addSubview:view];
[view addObserver:self forKeyPath:@"frame" options:0 context:NULL];
@mikoscz
mikoscz / elixir_with_asdf_mac.md
Last active Apr 1, 2019
Install elixir with asdf-vm mac os
View elixir_with_asdf_mac.md
  1. brew install asdf
echo -e '\n. $(brew --prefix asdf)/asdf.sh' >> ~/.zshrc
echo -e '\n. $(brew --prefix asdf)/etc/bash_completion.d/asdf.bash' >> ~/.zshrc
brew install \
  coreutils automake autoconf openssl \
@vlado
vlado / gist:1877457
Last active Apr 3, 2018
Postgres on macos or OSX - Fix
View gist:1877457
# ** ERROR 1 **
# FATAL: lock file "postmaster.pid" already exists
# HINT: Is another postmaster (PID 4646) running in data directory "/usr/local/var/postgres"?
#
# ** ERROR 2 **
# Is the server running locally and accepting connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
#
# To fix one of this errors:
cat /usr/local/var/postgres/postmaster.pid # pid is the number on first line
@bstahlhood
bstahlhood / UIImage+Retina4.h
Created Sep 13, 2012
Swizzled UIImage imageNamed for iPhone 5
View UIImage+Retina4.h
//
// UIImage+Retina4.h
// StunOMatic
//
// Created by Benjamin Stahlhood on 9/12/12.
// Copyright (c) 2012 DS Media Labs. All rights reserved.
//
#import <UIKit/UIKit.h>
You can’t perform that action at this time.