Skip to content

Instantly share code, notes, and snippets.

View sergeyklay's full-sized avatar

Serghei Iakovlev sergeyklay

View GitHub Profile
@shovon
shovon / increase_swap.sh
Created April 10, 2015 15:18
Increasing swap size. Only tested on the ubuntu/trusty64 Vagrant box. CREDIT GOES TO ---> http://jeqo.github.io/blog/devops/vagrant-quickstart/
#!/bin/sh
# size of swapfile in megabytes
swapsize=8000
# does the swap file already exist?
grep -q "swapfile" /etc/fstab
# if not then create it
if [ $? -ne 0 ]; then
@nkbt
nkbt / .eslintrc.js
Last active April 1, 2025 03:07
Strict ESLint config for React, ES6 (based on Airbnb Code style)
{
"env": {
"browser": true,
"node": true,
"es6": true
},
"plugins": ["react"],
"ecmaFeatures": {
Hey all!
So, We are active users who uses Phalcon/Zephir and we want to see good progress on this.
But due to some problems in the organization process of the community, and not enought time for contirube from main maintainers (@andres ....
Projects are developing quite sluggish and It's awfull.
We would like to create a public vote "Transfer Phalcon and Zephir to Zephir and Phalcon organtizations",
identifying major maintainers and principles "How to development this projects".
Basic things that we are motivated:
use \Phalcon\DI\Exception as Exception,
\Phalcon\DI\FactoryDefault as DefaultInjector,
\Phalcon\DI\InjectionAwareInterface,
\Phalcon\Config\Adapter\Json as JsonConfig;
/**
* DependencyInjector class
* Override the default DI class, due to an inability to update shared services
*
* @extends DefaultInjector
@andrewseidl
andrewseidl / Clang-format Comparison.md
Last active May 27, 2025 17:50
Clang-format style comparison

This is a comparison of the different formatting styles including with clang-format.

Generated via:

styles=( LLVM Google Chromium Mozilla WebKit )
for style in $styles
do
  clang-format -style=$style ChLcpIterativeAPGD.h > ChLcpIterativeAPGD.$style.h

done

Practical Cryptographic Release Branch Validation

One of the problems I've been thinking about recently is how to get reasonable cryptographic validation of release sources and artifacts without destroying usability. There are several randomly-assorted problems here:

  • SHA-1 is relatively easy to collide, and thus signed Git commits and tags are insufficient
  • Maintaining an auditable and relatively tamper-proof list of trusted signatures is hard
  • "Strong crypto" is generally (and accurately) equated with "not human usable"

Things to Sign

@jcefoli
jcefoli / move-recursive.ps1
Last active July 30, 2024 03:08
Powershell: Move Files & Folders In Directory Recursively to Another Directory
<#
Recursively move all files in C:\SourceDir into C:\Destination
Assumes C:\Destination exists already, or there could be problems
#>
Move-Item -Path "C:\SourceDir\*" -Destination "C:\Destination"
@discordier
discordier / gist:ed4b9cba14652e7212f5
Created December 4, 2014 06:23
options for phpStorm @noinspection annotation
javascript
ES6ValidationInspection
JSAccessibilityCheckInspection
JSBitwiseOperatorUsageInspection
JSCheckFunctionSignaturesInspection
JSClosureCompilerSyntaxInspection
JSCommentMatchesSignatureInspection
JSComparisonWithNaNInspection
JSConsecutiveCommasInArrayLiteralInspection
#!/usr/bin/env python
"""A noddy fake smtp server."""
import smtpd
import asyncore
class FakeSMTPServer(smtpd.SMTPServer):
"""A Fake smtp server"""
def __init__(*args, **kwargs):
@mattes
mattes / check.go
Last active April 22, 2025 19:16
Check if file or directory exists in Golang
if _, err := os.Stat("/path/to/whatever"); os.IsNotExist(err) {
// path/to/whatever does not exist
}
if _, err := os.Stat("/path/to/whatever"); !os.IsNotExist(err) {
// path/to/whatever exists
}