Skip to content

Instantly share code, notes, and snippets.

View SofijaErkin's full-sized avatar
🎯
Focusing

Vittore Marcas SofijaErkin

🎯
Focusing
View GitHub Profile
@jakelevi1996
jakelevi1996 / Multiple source files in C.md
Last active March 5, 2024 11:06
Multiple source files in C.

Multiple source files in C

This Gist presents an introduction to a few different ways of working with multiple source files in C, including:

  1. Simple .c source files and .h header files compiled into a .exe
  2. First compiling into .o object files, and then linking together
  3. Makefiles
  4. Statically linked libraries
  5. Dynamically linked libraries

The concepts are demonstrated using gcc (tdm64-1) 5.1.0 on Windows 8.1, using 3 C source files (linkedlist.c, listprimes.c and main.c) and 2 header files (linkedlist.h and listprimes.h), all of which are included at the end. It is assumed that all the source files are saved in a single directory, and any terminal commands are entered in a terminal window open in that same directory.

@ffeu
ffeu / clang-format@5.rb
Last active May 17, 2022 04:50
EDIT 2021: NOT WORKING ANYMORE!! clang-format version 5 (5.0.2) formula for brew (check comment below on how to install it)
class ClangFormatAT5 < Formula
desc "Formatting tool for C/C++/Java/JavaScript/Objective-C/Protobuf"
homepage "https://releases.llvm.org/5.0.2/tools/clang/docs/ClangFormat.html"
version "5.0.2"
if MacOS.version >= :sierra
url "https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_502/final/", :using => :svn
else
url "http://llvm.org/svn/llvm-project/llvm/tags/RELEASE_502/final/", :using => :svn
end
@beatfactor
beatfactor / install_nginx_macos_source.md
Last active December 3, 2023 13:20
Install Nginx on Mac OS from source (without brew)

Install Nginx on Mac OS from source

no Homebrew required

1. Download Nginx

$ cd /usr/local/src
$ curl -OL http://nginx.org/download/nginx-1.12.2.tar.gz
$ tar -xvzf nginx-1.12.2.tar.gz && rm nginx-1.12.2.tar.gz
@ochim
ochim / mac-redis-cluster.md
Last active December 8, 2021 06:36
Mac OS X で Redis Clusterを組む

開発環境

  • Mac:10.12.6
  • redis:4.0.0
  • ruby:2.0.0p648

1サーバで3台のRedis Clusterを作る(最低3台かららしい)

1.ディレクトリの用意

@nrollr
nrollr / MongoDB_macOS_Sierra.md
Last active April 1, 2024 16:23
Install MongoDB on Sierra using Homebrew

Install MongoDB on macOS Sierra

This procedure explains how to install MongoDB using Homebrew on macOS Sierra 10.12.
Official MongoDB install documentation: here

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
@JoaquimLey
JoaquimLey / github_multiple-accounts.md
Last active April 30, 2023 22:17
How to Work with GitHub and Multiple Accounts

Step 1 - Create a New SSH Key

We need to generate a unique SSH key for our second GitHub account.

ssh-keygen -t rsa -C "your-email-address"

Be careful that you don't over-write your existing key for your personal account. Instead, when prompted, save the file as id_rsa_COMPANY. In my case, I've saved the file to ~/.ssh/id_rsa_work.

Step 2 - Attach the New Key

@Mioke
Mioke / nginx_config.md
Last active June 10, 2023 06:20
Mac OS下安装及配置nginx
@UnaNancyOwen
UnaNancyOwen / tutorial.md
Last active December 1, 2023 03:44
How to write CMakeLists

CMakeLists Tutorial

ここでは、基本的な設定スクリプト(CMakeLists.txt)の書き方を紹介します。
(主にVisual C++向けに説明します。)

Basic Uses

CMakeでC++のプロジェクトを生成するための最小限必要のスクリプトを説明します。

  • cmake_minimum_required
    CMakeの最小要求バージョンを設定します。
@oanhnn
oanhnn / using-multiple-github-accounts-with-ssh-keys.md
Last active May 15, 2024 18:24
Using multiple github accounts with ssh keys

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.
@nuovotaka
nuovotaka / vs-code_gist.md
Last active April 20, 2023 04:42
Visual Studio Code でGitHub Gistを使ってみた

##Visual Studio Code でGitHub Gistを使ってみた(Mac)

先ずは、Extension の Installの方法 SHIFT + COMMAND + PもしくはView > Command Palette...Command Paletteを表示させたら >installと入力します。

ext_install

Install Extensionsが選択されてext install となりますので必要な語彙を入力してみましょう。 大概のものは用意されていると思います。