ssh-add ~/.ssh/id_rsa
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 lazyLoadImages() { | |
var lazyImages = document.getElementsByTagName('img[data-src]'); | |
for (var i = 0; i < lazyImages.length; i++) { | |
if (!lazyImages[i].getAttribute('data-src')) { | |
return; | |
} | |
var imageUrl = lazyImages[i].getAttribute('data-src'); | |
lazyImages[i].setAttribute('src', imageUrl); |
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
class Human | |
attr_reader :health | |
def initialize | |
@health = 100 | |
end | |
def smoke_cigarette | |
@health -= 1 | |
end |
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
style. | |
.metroheading { | |
font-size: 1.3em; | |
line-height: 1.3em; | |
font-family: Georgia, Times New Roman; | |
} | |
.heading { | |
font-size: 2em; | |
line-height: 1.3em; | |
font-family: Georgia, Times New Roman; |
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
require "excon" | |
require "benchmark" | |
n = 10000 | |
Benchmark.bm(30) do |benchmark| | |
benchmark.report("reuse connection") do | |
client = Excon.new("http://localhost:8080", persistent: true) | |
n.times do |
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/sh | |
### lolcommits hook (begin) ### | |
LANG="en_US.UTF-8" && PATH="/Users/cyril/.rbenv/versions/2.3.5/bin:/usr/local/bin:$PATH" && if [ ! -d "$GIT_DIR/rebase-merge" ] && [ "$LOLCOMMITS_CAPTURE_DISABLED" != "true" ]; then lolcommits --capture --delay 1 --stealth --fork; fi | |
### lolcommits hook (end) ### |
If you get this error when open neovim:
$ nvim
MatchTagAlways unavailable: requires python.
Press ENTER or type command to continue
Try to install neovim
package:
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
git filter-branch --env-filter ' | |
oldname="Cyril" | |
oldemail="[email protected]" | |
newname="Cyril Sadovnik" | |
newemail="[email protected]" | |
[ "$GIT_AUTHOR_EMAIL" = "$oldemail" ] && GIT_AUTHOR_EMAIL="$newemail" | |
[ "$GIT_COMMITTER_EMAIL" = "$oldemail" ] && GIT_COMMITTER_EMAIL="$newemail" | |
[ "$GIT_AUTHOR_NAME" = "$oldname" ] && GIT_AUTHOR_NAME="$newname" | |
[ "$GIT_COMMITTER_NAME" = "$oldname" ] && GIT_COMMITTER_NAME="$newname" | |
' head |
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
location ~ \.php$ { | |
# Variable FOO_ENV_VARIABLE with value "bar" | |
fastcgi_param FOO_ENV_VARIABLE bar; | |
include snippets/fastcgi-php.conf; | |
fastcgi_pass unix:/run/php/php7.0-fpm.sock; | |
} |
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/sh | |
# size of swapfile in megabytes | |
swapsize=2048 | |
# does the swap file already exist? | |
grep -q "swapfile" /etc/fstab | |
# if not then create it | |
if [ $? -ne 0 ]; then |
NewerOlder