This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env php | |
<?php | |
function ask($string) { | |
echo "$string (y/n): "; | |
$handle = fopen("php://stdin","r"); | |
$line = trim(fgets($handle)); | |
if ($line == 'y' or $line == 'yes') { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ -z "$1" ]; then | |
echo "mising argument: query" | |
exit 0 | |
fi | |
if [ -z "$2" ]; then | |
echo "mising argument: replace" | |
exit 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir -p "$@" && cd "$_"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exec ssh-agent bash | |
chmod 600 path/to/.ssh/id_rsa | |
ssh-add path/to/.ssh/id_rsa | |
ssh-add -l |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mysqldump -u __USERNAME__ -p __DATABASE__ > dump.sql | |
mysql -u __USERNAME__ -p __DATABASE__ < dump.sql |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo openssl genrsa -out example.key 2048 | |
sudo openssl req -new -key example.key -out example.csr | |
# or | |
sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout example.key -out example.crt | |
# https://www.digitalocean.com/community/tutorials/how-to-create-an-ssl-certificate-on-nginx-for-ubuntu-14-04 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function n() { | |
git log --reverse --pretty=%H master | grep -A 1 $(git rev-parse HEAD) | tail -n1 | xargs git checkout | |
} | |
function p() { | |
git checkout HEAD^1 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function () { | |
console.log('init iframe'); | |
var $btn = $('#btn'); | |
var parent = window.parent; | |
$btn.on('click', function() { | |
parent.postMessage({from: 'iframe'}, '*'); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Verifying that +maximkott is my blockchain ID. https://onename.com/maximkott |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# @help Write an error message and exit. | |
# @usage error <message> | |
error() { | |
local message=$1; shift; | |
printf "\e[01;31merror: $message\e[0m\n" >&2; | |
exit 1; | |
} |
OlderNewer