Skip to content

Instantly share code, notes, and snippets.

Serghei Iakovlev sergeyklay

Block or report user

Report or block sergeyklay

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
@sergeyklay
sergeyklay / CMakeLists.txt
Last active Oct 22, 2019
CMakeLists.txt for PHP-extension. This CMake file is just for syntax highlighting in CLion.
View CMakeLists.txt
cmake_minimum_required(VERSION 3.5)
project(extname
VERSION 1.0.0
LANGUAGES C)
message(STATUS "Begin cmaking of PHP extension ...")
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug CACHE STRING
View sed-cheatsheet.md

Sed Cheat Sheet

Sed command line options

sed [options] sed-command [input-file]
Option Description Example
View bash-tips.md

Here's how to test whether a parameter is unset, or empty ("Null") or set with a value:

+--------------------+----------------------+-----------------+-----------------+
|                    |       parameter      |     parameter   |    parameter    |
|                    |   Set and Not Null   |   Set But Null  |      Unset      |
+--------------------+----------------------+-----------------+-----------------+
| ${parameter:-word} | substitute parameter | substitute word | substitute word |
| ${parameter-word}  | substitute parameter | substitute null | substitute word |
| ${parameter:=word} | substitute parameter | assign word     | assign word     |
| ${parameter=word}  | substitute parameter | substitute null | assign word     |
@sergeyklay
sergeyklay / install.sh
Last active Aug 10, 2018
Install Nginx with Nchan
View install.sh
#!/usr/bin/env bash
# Works fine on Ubuntu 14.0.4 LTS
NGINX_VERSION="1.9.9"
NCHAN_VERSION="0.97"
HEADERS_MORE_VERSION="0.29"
DEV_KIT_VERSION="0.2.19"
ECHO_VERSION="0.58"
FANCY_INDEX_VERSION="0.3.5"
@sergeyklay
sergeyklay / makeauthority.sh
Last active Jan 26, 2016 — forked from richieforeman/makeauthority.sh
Issue Your Own Self-Signed S/MIME Certs with OpenSSL
View makeauthority.sh
# Run this once
openssl genrsa -des3 -out ca.key 4096
openssl req -new -x509 -days 365 -key ca.key -out ca.crt
@sergeyklay
sergeyklay / zep_to_php.sh
Last active Apr 8, 2017
Phalcon IDE stubs: Convert zep to php
View zep_to_php.sh
find . -type f -name "*.zep.php" | sed -e 'p' -E -e "s/.zep.php/.php/g" | xargs -n2 mv
@sergeyklay
sergeyklay / get_phalcon_events.sh
Last active Apr 8, 2017
Phalcon : Get list of all events from source
View get_phalcon_events.sh
$ pwd
/home/klay/projects/c/cphalcon
$ git branch
2.0.0
* 2.0.x
master
$ php --ri phalcon | grep 'Version =>'
You can’t perform that action at this time.