Skip to content

Instantly share code, notes, and snippets.

View SofijaErkin's full-sized avatar
🎯
Focusing

Vittore Marcas SofijaErkin

🎯
Focusing
View GitHub Profile
@SofijaErkin
SofijaErkin / .tmux.conf
Created March 1, 2022 03:38 — forked from shanzi/.tmux.conf
My tmux configuration
run-shell "powerline-daemon -q"
source "$HOME/.local/lib/python3.8/site-packages/powerline/bindings/tmux/powerline.conf"
set -g default-terminal "xterm-256color"
# set-option -g default-command "/usr/local/bin/reattach-to-user-namespace -l /bin/zsh"
# install reattach-to-user-namespace first
# --> brew install reattach-to-user-namespace
new-session

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.

@SofijaErkin
SofijaErkin / tutorial.md
Created January 20, 2022 11:32 — forked from UnaNancyOwen/tutorial.md
How to write CMakeLists

CMakeLists Tutorial

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

Basic Uses

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

  • cmake_minimum_required
    CMakeの最小要求バージョンを設定します。
@SofijaErkin
SofijaErkin / gist:e1fa6a6040779c1bc9ed4c8e7d447c18
Created January 9, 2022 07:25 — forked from jrwren/gist:1925688
llvm gcc vs. Apple LLVM 3.0 (clang)
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (
#ifdef __clang__
strong,
#endif
nonatomic) UIWindow *window;
@end
@SofijaErkin
SofijaErkin / vs-code_gist.md
Created January 2, 2022 10:42 — forked from nuovotaka/vs-code_gist.md
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 となりますので必要な語彙を入力してみましょう。 大概のものは用意されていると思います。

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.
@SofijaErkin
SofijaErkin / github_multiple-accounts.md
Created December 24, 2021 00:34 — forked from JoaquimLey/github_multiple-accounts.md
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

@SofijaErkin
SofijaErkin / install_nginx_macos_source.md
Created December 9, 2021 13:59 — forked from beatfactor/install_nginx_macos_source.md
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
@SofijaErkin
SofijaErkin / 0_reuse_code.js
Created December 9, 2021 12:32 — forked from WouterPeeters/0_reuse_code.js
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@SofijaErkin
SofijaErkin / nginx_config.md
Created December 9, 2021 10:59 — forked from Mioke/nginx_config.md
Mac OS下安装及配置nginx