Skip to content

Instantly share code, notes, and snippets.

View dkushnikov's full-sized avatar

Dmitry Kushnikov dkushnikov

  • ManyChat Inc.
  • London, UK
View GitHub Profile
@lennartvdd
lennartvdd / install_newrelic_server.sh
Created June 10, 2015 09:01
Install NewRelic Server
#!/bin/sh
echo "This script will install NewRelic Server Monitoring"
read -p "License Key:" NEWRELIC_LICENSE_KEY
echo deb http://apt.newrelic.com/debian/ newrelic non-free >> /etc/apt/sources.list.d/newrelic.list
wget -O- https://download.newrelic.com/548C16BF.gpg | apt-key add -
apt-get update
apt-get install newrelic-sysmond
@nolanlawson
nolanlawson / protips.js
Last active February 4, 2024 18:06
Promise protips - stuff I wish I had known when I started with Promises
// Promise.all is good for executing many promises at once
Promise.all([
promise1,
promise2
]);
// Promise.resolve is good for wrapping synchronous code
Promise.resolve().then(function () {
if (somethingIsNotRight()) {
throw new Error("I will be rejected asynchronously!");
@lennartvdd
lennartvdd / codeship-test-yii2-advanced.sh
Last active September 8, 2016 22:34
CodeShip - Yii 2.x (Advanced Template) test setup script
# Set php version through phpenv. 5.3, 5.4 and 5.5 available
phpenv local 5.4
# == install pecl extensions
yes yes | pecl install imagick
# == prepare composer
composer config -g github-oauth.github.com "$GITHUB_ACCESS_TOKEN" #make sure this env var is configured in your project settings. otherwise remove this line.
# update phpunit
composer global remove "phpunit/phpunit" --update-with-dependencies
@dkushnikov
dkushnikov / README.md
Last active January 3, 2016 00:29
Vagrantfile for bem/project-stub

Инструкция по использованию

Перед началом использования необходимо установить для вашей операционной системы Vagrant и VirtualBox.

  1. После клонирования project-stub перейдите в папку проекта и скопируйте туда Vagrantfile
  2. При необходимости настройте параметры виртуальной машины (ip-адрес, порт и прочее)
  3. Запустить виртуальную машину

> vagrant up

@SalemHarrache
SalemHarrache / add-apt-repository.sh
Last active December 14, 2015 15:09
add-apt-repository for debian
#!/bin/bash
NM=`uname -a && date`
NAME=`echo $NM | md5sum | cut -f1 -d" "`
UBUNTU_VERSION=${2:-"lucid"}
ppa_name=`echo "$1" | cut -d":" -f2 -s`
if [ -z "$ppa_name" ]
then
echo "PPA name not found"
echo "Utility to add PPA repositories in your debian machine"
echo "$0 ppa:user/ppa-name"
@cherifGsoul
cherifGsoul / RestController.php
Last active November 1, 2018 13:54
Yii simple rest controller exemple
<?php
/**
* Controller is the customized base controller class.
* All controller classes for this application should extend from this base class.
*/
class RestController extends CController
{
/**
* @var string the default layout for the controller view. Defaults to '//layouts/column1',
* meaning using a single column layout. See 'protected/views/layouts/column1.php'.
@menny
menny / verify_appstore_in_app.php
Last active February 15, 2024 14:45
How to verify in-app purchases from AppStore and Market in PHP code (server-side)
function verify_app_store_in_app($receipt, $is_sandbox)
{
//$sandbox should be TRUE if you want to test against itunes sandbox servers
if ($is_sandbox)
$verify_host = "ssl://sandbox.itunes.apple.com";
else
$verify_host = "ssl://buy.itunes.apple.com";
$json='{"receipt-data" : "'.$receipt.'" }';
//opening socket to itunes
@ziadoz
ziadoz / awesome-php.md
Last active May 10, 2024 15:06
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.
@tsabat
tsabat / zsh.md
Last active December 25, 2023 19:16
Getting oh-my-zsh to work in Ubuntu