Skip to content

Instantly share code, notes, and snippets.

[core]
autocrlf = false
excludesfile = ~/.gitignore.global
[color]
ui = auto
[push]
default = current
followTags = true
@h007
h007 / howto-manually-add-trust-cert-to-rubygems.md
Created December 4, 2020 05:51
Workaround RubyGems' SSL errors on Ruby for Windows (RubyInstaller)

SSL upgrades on rubygems.org and RubyInstaller versions

UPDATE 2016-12-01: Please refer to the official guide instead of this process.

UPDATE 2014-12-21: RubyGems 1.8.30, 2.0.15 and 2.2.3 have been released. It requires manual installation, please see instructions below.


Hello,

@h007
h007 / .gitattributes
Created December 4, 2020 05:50 — forked from dpalomar/.gitattributes
Fixing CRLF with gitattributes
From this [issue](https://github.com/puphpet/puphpet/issues/1025#issuecomment-157059174):
I know that this issue is closed, but as I spent a lot of time to understand what was going on, I made some researches and I can explain why this happen, and you can fix it.
Using git config core.autocrlf true can help, but not on a multi-developpers project.
This command has to be the same on each developper machine, and that's not always the case.
You have to use the .gitattributes provided in the puphpet archive and edit it as follow (carefull, this file need to be in your project root)
You also need to use an IDE that allow you to save/edit files as LF (like phpstorm). You can check the type of the file in the bottom right corner, in the status bar (you'll see LF or CRLF while a file is opened)
@h007
h007 / init.vim
Created December 4, 2020 05:49 — forked from TheCedarPrince/init.vim
My (neo)Vim Configuration File
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" VIM SETTINGS
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" TURNS LINE NUMBERING ON
set nu
" trigger `autoread` when files changes on disk
set autoread
autocmd FocusGained,BufEnter,CursorHold,CursorHoldI * if mode() != 'c' | checktime | endif
@h007
h007 / 123
Created December 4, 2020 05:42
123
@h007
h007 / tmux_cheatsheet.markdown
Created September 18, 2020 15:18 — forked from henrik/tmux_cheatsheet.markdown
tmux cheatsheet

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@h007
h007 / web-servers.md
Created August 24, 2020 02:03 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@h007
h007 / vscode_cmdesettings.json
Last active September 30, 2020 07:24
back Visual Studio Code Settings Sync Gist
{
"editor.formatOnPaste": true,
"editor.multiCursorModifier": "ctrlCmd",
"editor.snippetSuggestions": "top",
"files.autoSave": "onFocusChange",
// cmder
"terminal.external.windowsExec": "D:\\dev\\cmder\\Cmder.exe",
"terminal.integrated.shell.windows": "C:\\Windows\\System32\\cmd.exe",
"terminal.integrated.shellArgs.windows": [
"/k D:\\dev\\cmder\\vsinit.bat"
@h007
h007 / mkcert _python3_ssl_server.py
Last active January 11, 2022 09:01 — forked from 0xBADCA7/ssl_server.py
Simple HTTPS server in Python 3
#!/usr/bin/env python3
from http.server import HTTPServer,SimpleHTTPRequestHandler
from socketserver import BaseServer
import ssl
httpd = HTTPServer(('0.0.0.0', 1443), SimpleHTTPRequestHandler)
httpd.socket = ssl.wrap_socket (httpd.socket, certfile='certificate.pem', keyfile='privatekey.pem', server_side=True)
httpd.serve_forever()
@h007
h007 / https_server.py
Created July 6, 2018 11:55 — forked from gnilchee/https_server.py
Simple Single threaded HTTPS (SSL) "Server" using Python 3
#!/usr/bin/env python3
import http.server, socketserver, socket, ssl
PORT = 443
HOST = socket.gethostname()
Handler = http.server.SimpleHTTPRequestHandler
https = socketserver.TCPServer(("0.0.0.0", PORT), Handler)
https.socket = ssl.wrap_socket(https.socket, keyfile='/path/to/keyfile.key', certfile='/path/to/certfile.crt', server_side=True, ssl_version=ssl.PROTOCOL_TLSv1_2, ca_certs=None, do_handshake_on_connect=True, suppress_ragged_eofs=True, ciphers='ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!3DES:!MD5:!PSK')