Skip to content

Instantly share code, notes, and snippets.

View j3ck's full-sized avatar
🏠
Working from home

Eugene j3ck

🏠
Working from home
View GitHub Profile
"abcda".chars.group_by(&:chr).map{|k,v| {k => v.size}}
"abca".chars.inject(Hash.new(0)){|h, c| h[c] +=1; h}
"abca".chars.inject(Hash.new(0)){|h, c| h[c] +=1}
"abca".chars.inject(Hash.new(0)){|h, c| puts h; h[c] +=1; }
@j3ck
j3ck / gist:acf1d7f0ceabc7c0f33f
Created March 15, 2015 21:31
backgrouns properties
background: url("https://codecademy-content.s3.amazonaws.com/courses/web-beginner-en-3pc6w/images/splash.jpg");
background-size: cover;
background-position: center center;
background-repeat: no-repeat;
background-attachment: fixed;
if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="green"; fi
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
PROMPT='%{$fg_bold[$NCOLOR]%}%n@%m\
%{$reset_color%}:%{$fg_bold[magenta]%}%~\
$(git_prompt_info)\
%{$fg_bold[red]%}$%{$reset_color%} '
PROMPT2='%{$fg_bold[red]%}\ %{$reset_color%}'
RPS1='${return_code}'
@j3ck
j3ck / gist:5cde4fd3a48d5fc0df75
Last active August 29, 2015 14:19
sublime config
{
"color_scheme": "Packages/User/Styles/Tomorrow-Night-Eighties.tmTheme",
"draw_white_space": "all",
"ensure_newline_at_eof_on_save": true,
"fade_fold_buttons": false,
"font_size": 11.0,
"highlight_line": true,
"highlight_modified_tabs": true,
"ignored_packages":
[
@j3ck
j3ck / gist:d454e180f011cc28f56e
Created April 18, 2015 22:32
Tomorrow-Night-Eighties.tmTheme
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>comment</key>
<string>http://chriskempson.com</string>
<key>name</key>
<string>Tomorrow Night - Eighties</string>
<key>settings</key>
<array>
@j3ck
j3ck / gist:350d3513839b65a721d4
Created April 18, 2015 22:35
sublime packages
BracketHighlighter
AutoFileName
GitGutter
Emmet
Package Control
Error mounting: Failed to read NTFS $Bitmap: Input/output error
NTFS is either inconsistent, or there is a hardware fault, or it's a
SoftRAID/FakeRAID hardware.
sudo ntfsfix /dev/sdb1
@j3ck
j3ck / gist:8dd44c26c3d7cda12369
Created February 29, 2016 12:04 — forked from yano3/gist:1378948
git commit --amend --reset-author
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:
git config --global user.name "Your Name"
git config --global user.email [email protected]
After doing this, you may fix the identity used for this commit with:
git commit --amend --reset-author
err:
OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
solution:
brew install openssl
brew link openssl --force
rvm reinstall 2.1.1 --disable-binary
@j3ck
j3ck / nginx.conf
Created March 18, 2016 15:05 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048