Skip to content

Instantly share code, notes, and snippets.

View moshohayeb's full-sized avatar

Mohammed Alshohayeb moshohayeb

  • Riyadh, Saudi Arabia
View GitHub Profile

Core Coding Standard

Coding practices are a source of a lot of arguments among programmers. Coding standards, to some degree, help us to put certain questions to bed and resolve stylistic debates. No coding standard makes everyone happy. (And even their existence is sure to make some unhappy.) What follows are the standards we put together on the Core team, which have become the general coding standard for all programming teams on new code development. We’ve tried to balance the need for creating a common, recognizable and readable code base with not unduly burdening the programmer with minor code formatting concerns.

Table Of Contents

@puremourning
puremourning / Vagrantfile
Created June 10, 2017 19:06
Setting up a Vagrant VM for CentOS 7
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "parallels/centos-7.3"
#config.vm.network "forwarded_port", guest: 80, host: 8080
config.vm.network "public_network"
config.vm.provider "parallels" do |v|
@agzam
agzam / all ex commands.org
Last active September 14, 2022 14:36
All ex commands
e[dit]evil-edit
w[rite]evil-write
wa[ll]evil-write-all
sav[eas]evil-save
r[ead]evil-read
b[uffer]evil-buffer
bn[ext]evil-next-buffer
bp[revious]evil-prev-buffer
bN[ext]bprevious
sb[uffer]evil-split-buffer
@jeongho
jeongho / pin_centos6.7.txt
Created August 3, 2016 16:05
Pin CentOS repository to 6.7 to prevent yum update goes to 6.8
1. disable Base repo
sed -i.bak '/^gpgcheck=1/ a enabled=0 ' /etc/yum.repos.d/CentOS-Base.repo
2. append Vault repo with CentOS 6.7
#-----------------
[C6.7-base]
name=CentOS-6.7 - Base
baseurl=http://vault.centos.org/6.7/os/$basearch/
gpgcheck=1
@ryands
ryands / debian.sh
Last active December 6, 2017 13:49
Debian KVM virt-install script
#!/usr/bin/env bash
INSTALL_MEDIA="http://cdimage.debian.org/cdimage/jessie_di_beta_2/amd64/iso-cd/debian-jessie-DI-b2-amd64-netinst.iso"
VMNAME="debian-jessie-vm"
[[ "x$1" != "x" ]] && VMNAME=$1
echo
echo "Building VM: $VMNAME"
echo " Creating disk image"
@rothgar
rothgar / install-tmux
Last active August 19, 2024 07:37 — forked from ekiara/how_to_install_tmux_on_centos
Install tmux 1.9 on rhel/centos 6
# Install tmux on Centos release 6.5
# install deps
yum install gcc kernel-devel make ncurses-devel
# DOWNLOAD SOURCES FOR LIBEVENT AND MAKE AND INSTALL
curl -OL https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
tar -xvzf libevent-2.0.21-stable.tar.gz
cd libevent-2.0.21-stable
./configure --prefix=/usr/local
@LeCoupa
LeCoupa / nodejs-cheatsheet.js
Last active February 27, 2025 20:09
Complete Node.js CheatSheet --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
/* *******************************************************************************************
* THE UPDATED VERSION IS AVAILABLE AT
* https://github.com/LeCoupa/awesome-cheatsheets
* ******************************************************************************************* */
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html
// 1. The signum of a number is 1 if the number is positive, -1 if it is negative, and
// 0 if it is zero. Write a function that computes this value.
def signum(n: Int) = {
if (n > 0) 1
else if (n < 0) -1
else 0
} //> signum: (n: Int)Int
signum(4) //> res0: Int = 1