Skip to content

Instantly share code, notes, and snippets.

View necromant2005's full-sized avatar

Rostyslav Mykhajliw necromant2005

View GitHub Profile
@hikari-no-yume
hikari-no-yume / example.php
Created March 20, 2017 20:02
function chaining for PHP 7
<?php declare(strict_types=1);
require_once "✨.🐘";
✨($_)->strlen("foo")->var_dump($_);
@craigvantonder
craigvantonder / flush-dns.sh
Last active February 3, 2021 04:42
Flushing the DNS in Ubuntu 16.04
#!/bin/bash
# NB: First install nscd with sudo apt-get install nscd
# run this command to flush dns cache:
sudo /etc/init.d/dns-clean restart
# or use:
sudo /etc/init.d/networking force-reload
# Flush nscd dns cache:
sudo /etc/init.d/nscd restart
@yunano
yunano / consul.service
Created May 1, 2015 15:52
/etc/systemd/system/consul.service
[Unit]
Description=consul agent
Requires=network-online.target
After=network-online.target
[Service]
EnvironmentFile=-/etc/sysconfig/consul
Environment=GOMAXPROCS=2
Restart=on-failure
ExecStart=/usr/local/sbin/consul agent $OPTIONS -config-dir=/etc/consul.d
@denji
denji / Phalcon-Zephir.md
Last active February 24, 2023 03:02
Zephir write your PHP Extension

About this article will do the following things:

  • Install & Setup
  • Write a simple Router
  • Zephir rewritten version
  • Extension installation and testing

Installation

@PaulKinlan
PaulKinlan / criticalcss-bookmarklet-devtool-snippet.js
Last active April 2, 2024 02:45
CriticalCSS Bookmarklet and Devtool Snippet.js
(function() {
var CSSCriticalPath = function(w, d, opts) {
var opt = opts || {};
var css = {};
var pushCSS = function(r) {
if(!!css[r.selectorText] === false) css[r.selectorText] = {};
var styles = r.style.cssText.split(/;(?![A-Za-z0-9])/);
for(var i = 0; i < styles.length; i++) {
if(!!styles[i] === false) continue;
var pair = styles[i].split(": ");
@surjikal
surjikal / prediction-io-ubuntu-precise.md
Last active March 24, 2017 11:33
Prediction IO Install Notes on Ubuntu Precise (12.04)
@necromant2005
necromant2005 / deploy.rb
Created November 1, 2012 08:39
recipy php
ssh_options[:keys] = [File.join(Dir.pwd, "config", "ubuntu.pem")]
set :application, "MyAPPNAME"
set :repository, "git@github.com:necromant2005/MYAPPName.git"
# If you aren't deploying to /u/apps/#{application} on the target
# servers (which is the default), you can specify the actual location
# via the :deploy_to variable:
set :deploy_to, "/var/www/#{application}"
@gllist
gllist / gist:3668037
Created September 7, 2012 17:36 — forked from markstreich/gist:3667944
PhantomJS: Ajax response capture through console.log
var page = require('webpage').create();
page.open('http://www.website.com/', function (status) {
if (status === 'success') {
captureAjaxResponsesToConsole();
}
});
function captureAjaxResponsesToConsole() {
// logs ajax response contents to console so sublime's onConsoleMessage can use the contents
@Ocramius
Ocramius / di.create-definitions.php
Created June 26, 2012 16:32 — forked from SocalNick/di.create-definitions.php
ZF2 Di definition compiler
<?php
// in ZF2 project, place this in ./bin directory
chdir(dirname(__DIR__));
$zf2Path = (getenv('ZF2_PATH') ?: 'vendor/ZendFramework/library');
require_once $zf2Path . '/Zend/Loader/AutoloaderFactory.php';
require_once $zf2Path . '/Zend/Loader/StandardAutoloader.php';
use Zend\Loader\AutoloaderFactory;
use Zend\Loader\StandardAutoloader;
@SocalNick
SocalNick / di.create-definitions.php
Created June 26, 2012 16:13
ZF2 Di definition compiler
<?php
// in ZF2 project, place this in ./bin directory
chdir(dirname(__DIR__));
$zf2Path = (getenv('ZF2_PATH') ?: 'vendor/ZendFramework/library');
require_once $zf2Path . '/Zend/Loader/AutoloaderFactory.php';
require_once $zf2Path . '/Zend/Loader/StandardAutoloader.php';
use Zend\Loader\AutoloaderFactory;
use Zend\Loader\StandardAutoloader;