Skip to content

Instantly share code, notes, and snippets.

@mislav
mislav / gist:938183
Created April 23, 2011 02:28
Faraday SSL example
connection = Faraday::Connection.new('http://example.com') do |builder|
builder.request :url_encoded # for POST/PUT params
builder.adapter :net_http
end
# same as above, short form:
connection = Faraday.new 'http://example.com'
# GET
connection.get '/posts'
@adriankeenan
adriankeenan / thinkpad_p1_gen4_usbcpd_charging.md
Last active May 9, 2024 08:05
ThinkPad P1 Gen 4 USB-C PD Charging Testing

The ThinkPad P1 has no official requirements for USB-C chargers. This is the result of testing a few different USB-C chargers on my Gen 4 P1.

Notes:

  • Machine BIOS is N40ET44W 1.26.
  • This configuration (i7 11850H, RTX A3000) shipped with a 230W AC charger.
  • Result wattage read from Lenovo Vantage on Windows 11 Pro.
  • Windows does not acknowledge unsupported chargers at all (eg does not show any error messages). A KDE desktop does show a message that the wattage is too low for unsupported chargers.
  • Tested with a 100W C-C cable or 100W TB4 cable.

| Charger | Charger Wattage | Result |

@wojteklu
wojteklu / clean_code.md
Last active May 9, 2024 08:20
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@notnotrobby
notnotrobby / cgp.md
Last active May 9, 2024 08:01
List of free resources to study computer graphics programming.
@phoe
phoe / package-local-nicknames.md
Last active May 9, 2024 08:01
Package-local nicknames in Common Lisp - a semishitpost about PLNs

Package-local nicknames in Common Lisp

Warning: this is a rant.

Warning: you have been warned.

Note: actually worthwhile content starts in the second subsection. You are free to skip the first one.

Story time

@julyL
julyL / .prettierrc.js
Created March 9, 2020 06:17
.prettierrc.js配置文件
// .prettierrc.js
module.exports = {
// 一行最多 80 字符
printWidth: 80,
// 使用 2 个空格缩进
tabWidth: 2,
// 不使用缩进符,而使用空格
useTabs: false,
// 行尾需要有分号
semi: true,
@staltz
staltz / introrx.md
Last active May 9, 2024 07:59
The introduction to Reactive Programming you've been missing
@dexit
dexit / LanguagePacks.txt
Last active May 9, 2024 07:57
Windows 10 language pack download list
LangPacks for Windows 10 build 10.0.14393.0 (rs1_release.160715-1616)
=======================================================================================================================================
x86
=======================================================================================================================================
ar-SA http://download.windowsupdate.com/c/msdownload/update/software/updt/2016/07/lp_2d27aaac52b3449bddbf6081f934d5a0e04567f5.cab
bg-BG http://download.windowsupdate.com/c/msdownload/update/software/updt/2016/07/lp_859ef8cf0175dd8e54c68ed7939d8c5654521b6e.cab
cs-CZ http://download.windowsupdate.com/c/msdownload/update/software/updt/2016/07/lp_f3aeb974df186c213760b2fca77c12c55b4ef7f2.cab
da-DK http://download.windowsupdate.com/c/msdownload/update/software/updt/2016/07/lp_9334cac301decb6bc155eba301db796171167629.cab
de-DE http://download.windowsupdate.com/c/msdownload/update/software/updt/2016/07/lp_b142c3c021284f6c90eaff7fc59bdaabb6573d72.
@aparrish
aparrish / understanding-word-vectors.ipynb
Last active May 9, 2024 07:54
Understanding word vectors: A tutorial for "Reading and Writing Electronic Text," a class I teach at ITP. (Python 2.7) Code examples released under CC0 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@guwidoe
guwidoe / GetLocalOneDrivePath.bas.vb
Last active May 9, 2024 07:54
VBA Function to get the local path of a OneDrive/SharePoint synchronized Microsoft Office file
'Attribute VB_Name = "GetLocalOneDrivePath"
'
' Cross-platform VBA Function to get the local path of OneDrive/SharePoint
' synchronized Microsoft Office files (Works on Windows and on macOS)
'
' Author: Guido Witt-Dörring
' Created: 2022/07/01
' Updated: 2024/04/23
' License: MIT
'