Skip to content

Instantly share code, notes, and snippets.

View mortymacs's full-sized avatar

Morteza NourelahiAlamdari mortymacs

View GitHub Profile

Restore from backup

Install the version that you want:

curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | bash
apt-cache madison gitlab-ce
apt install gitlab-ce=12.10.2-ce.0

in this sample we are going to config Gitlab with external Postgresql:

apt install postgresql=9.6+181+deb9u3
@graninas
graninas / What_killed_Haskell_could_kill_Rust.md
Last active June 22, 2024 07:05
What killed Haskell, could kill Rust, too

At the beginning of 2030, I found this essay in my archives. From what I know today, I think it was very insightful at the moment of writing. And I feel it should be published because it can teach us, Rust developers, how to prevent that sad story from happening again.


What killed Haskell, could kill Rust, too

What killed Haskell, could kill Rust, too. Why would I even mention Haskell in this context? Well, Haskell and Rust are deeply related. Not because Rust is Haskell without HKTs. (Some of you know what that means, and the rest of you will wonder for a very long time). Much of the style of Rust is similar in many ways to the style of Haskell. In some sense Rust is a reincarnation of Haskell, with a little bit of C-ish like syntax, a very small amount.

Is Haskell dead?

/**
* Using a single integer to represent multiple permissions
* based on binary values using bitwise operators
*
* & bitwise AND - if both the top and bottom bit are 1, result is 1
* | bitwise OR - if either the top and bottom bit or both are 1, result is 1
* ^ bitwise XOR - if only one of the bits are 1, result is 1
* 0101
* 0100 & = 0100
*
@rougier
rougier / clean.el
Created May 10, 2020 02:43
A very minimal but elegant emacs configuration file
(require 'org)
(setq-default indent-tabs-mode nil)
(setq org-display-inline-images t)
(setq org-redisplay-inline-images t)
(setq org-startup-with-inline-images "inlineimages")
(setq default-frame-alist
(append (list '(width . 72) '(height . 40))))
@naesean
naesean / jsonapi_oas.yml
Last active May 6, 2024 00:41
OpenAPI 3.0 schemas that comply with the JSON:API 1.0 specification
JSONAPIObject:
description: Includes the current JSON:API version for this specification as well as optional meta information
type: object
required:
- version
properties:
version:
type: string
default: '1.0'
example: '1.0'
@mortymacs
mortymacs / custom code block in cpp.cc
Created September 16, 2019 09:30
custom code block in cpp
// This file is a "Hello, world!" in C++ language by GCC for wandbox.
#include <iostream>
#include <unordered_map>
#include <optional>
#include <functional>
# define eval(a) [&](){a};
#include <iostream>
#include <functional>
struct XWorker {
std::function<void(int, int)> func;
@MattPD
MattPD / cpp.std.coroutines.draft.md
Last active May 10, 2024 06:45
C++ links: Coroutines (WIP draft)
@mortymacs
mortymacs / worldofgoo.md
Created March 9, 2019 09:11
WorldOfGoo Ubuntu 18.4

Just run the main file by padsp command:

$ padsp WorldOfGoo

Or you can change the .desktop file of WorldOfGoo:

$ vim /usr/share/applications/WorldOfGoo.desktop
@arturfog
arturfog / gnome-terminal-bold-fonts.sh
Created January 2, 2019 15:03
disable bold fonts in gnome terminal
dconf write /org/gnome/terminal/legacy/profiles:/:<id>/allow-bold false
@llonchj
llonchj / main.go
Created October 17, 2018 21:46
Proof of concept
package main
import (
"fmt"
"net/http"
"github.com/gocolly/colly"
)
type MyCollector struct {