Skip to content

Instantly share code, notes, and snippets.

View mdesjardins's full-sized avatar

Mike Desjardins mdesjardins

View GitHub Profile
@mdesjardins
mdesjardins / Output of mypy example.py
Last active March 16, 2022 19:54
Marshmallow Dataclass Issue #178
🐍 v3.8.12 (remit) ~/_work/wave/src/marshmallow-dataclass-mypy-bug-example on  main ❯ mypy example.py
/Users/mdesjardins/_work/wave/src/marshmallow-dataclass-mypy-bug-example/example.py:41: error: Unexpected keyword argument "red" for "FavoriteColor"
/Users/mdesjardins/.virtualenvs/remit/lib/python3.8/site-packages/mypy/typeshed/stdlib/3/builtins.pyi:93: note: "FavoriteColor" defined here
/Users/mdesjardins/_work/wave/src/marshmallow-dataclass-mypy-bug-example/example.py:41: error: Unexpected keyword argument "green" for "FavoriteColor"
/Users/mdesjardins/.virtualenvs/remit/lib/python3.8/site-packages/mypy/typeshed/stdlib/3/builtins.pyi:93: note: "FavoriteColor" defined here
/Users/mdesjardins/_work/wave/src/marshmallow-dataclass-mypy-bug-example/example.py:41: error: Unexpected keyword argument "blue" for "FavoriteColor"
/Users/mdesjardins/.virtualenvs/remit/lib/python3.8/site-packages/mypy/typeshed/stdlib/3/builtins.pyi:93: note: "FavoriteColor" defined here
/Users/mdesjardins/_work/wave/src/marshmallow-da
@mdesjardins
mdesjardins / sample.css
Created October 13, 2017 18:42
Wait 2s to become visible
/* Also tried opacity instead of visibility */
@keyframes waitTwoSeconds {
from { visibility: hidden; }
to { visibility: visible; }
}
.loadingPleaseWait {
animation-delay: 5s;
animation-duration: 100ms;
animation-name: waitTwoSeconds;
Verifying that +mikedesjardins is my blockchain ID. https://onename.com/mikedesjardins
@mdesjardins
mdesjardins / gist:4e11a8c2ffc9a1964826
Created January 14, 2016 22:43
mix deps.get error on new server
deployer@staging-rmv1:~/app/rmv$ mix deps.get
** (UndefinedFunctionError) undefined function Hex.shell/0
(hex) Hex.shell()
(hex) lib/hex/remote_converger.ex:91: anonymous fn/2 in Hex.RemoteConverger.check_deps/1
(elixir) lib/enum.ex:604: Enum."-each/2-lists^foreach/1-0-"/2
(elixir) lib/enum.ex:604: Enum.each/2
(hex) lib/hex/remote_converger.ex:27: Hex.RemoteConverger.converge/2
(mix) lib/mix/dep/converger.ex:85: Mix.Dep.Converger.all/4
(mix) lib/mix/dep/converger.ex:47: Mix.Dep.Converger.converge/4
(mix) lib/mix/dep/fetcher.ex:16: Mix.Dep.Fetcher.all/3
@mdesjardins
mdesjardins / gist:1327630
Created October 31, 2011 14:40
Mail Unread Menu Sample Process
Sampling process 5579 for 3 seconds with 1 millisecond of run time between samples
Sampling completed, processing symbols...
Analysis of sampling Mail Unread Menu (pid 5579) every 1 millisecond
Process: Mail Unread Menu [5579]
Path: /Applications/Mail Unread Menu.app/Contents/MacOS/Mail Unread Menu
Load Address: 0x6b000
Identifier: com.loganrockmore.MailUnreadMenu
Version: 3.3 (328)
Code Type: X86 (Native)
Parent Process: launchd [423]
@mdesjardins
mdesjardins / gist:1324482
Created October 29, 2011 13:56
Same assignment operator thing with more print statements
class FakeCache
def self.write(key,value)
File.open(key,'w') { |f| f.write(value) }
end
def self.read(key)
begin
File.open(key).each_line{ |s| result = s }
result
rescue
return nil
@mdesjardins
mdesjardins / gist:1324475
Created October 29, 2011 13:47
Ruby increment operators not working like we think they're working?
# Stub class acts as a proxy for the memcache Rails cache. Stores key/value pairs in files.
class FakeCache
def self.write(key,value)
File.open(key,'w') { |f| f.write(value) }
end
def self.read(key)
begin
File.open(key).each_line{ |s| result = s }
result