#likemycode search results
export OLDPS1="$PS1" function ps1 () { : toggle the prompt on and off : if [ "$PS1" != '%# ' ]; then export PS1='%# ' else export PS1="$OLDPS1" fi } #LikeMyCode
#LikeMyCode Bash echo alpha >a echo bravo >b CURL1='curl -i --user "$(cat a):$(cat b)"' set $CURL1 echo $# # 6 echo $@ # curl -i --user "$(cat a):$(cat b)" CURL2="curl -i --user '$(cat a):$(cat b)'" set $CURL2 echo $# # 4 echo $@ # curl -i --user 'alpha:bravo' logout
export OLDPS1="$PS1" eval "$(dircolors <(dircolors -p | sed 's,1;,0;,g'))" stty -ixon function ps1-theirs () { export PS1="$OLDPS1"; } function ps1-plain () { export PS1="$(echo "$OLDPS1" | sed 's,1;,0;,g')"; } function ps1-mine () { export PS1='\$ '; } ps1-mine #LikeMyCode
#LikeMyCode def open_read_close(*args, **kwargs): with open(*args, **kwargs) as incoming: fetched = incoming.read() return fetched
| python3 -c 'import sys;print("".join(sorted(set(sys.stdin.read().replace("\n","")))),end="\n")' #LikeMyCode
% git clone github.com/pelavarre/pyba… % cd pybashish/ % bin/hearme.py rstrip + pbpaste | awk '//{sub(" *$", ""); print}'| pbcopy % echo ' abc ' | cat -etv abc $ % echo ' abc ' | hearme.py rstrip | cat -etv + awk '//{sub(" *$", ""); print}' abc$ % #LikeMyCode
An example calculator definition is function + { echo plus; } function ++ { echo plus-plus; } function - { echo minus; } function -- { echo minus-minus; } #LikeMyCode
def sshprocess_run(there, far, *args, **kwargs): near = "ssh {} {!r}".format(there, far) ran = subprocess.run(near, shell=True, input="", stdout=subprocess.PIPE, stderr=subprocess.PIPE, *args, **kwargs) return ran #LikeMyCode
Any chance we’ll go somewhere good now by pushing out code richly decontextualised? The replies and quote-tweets of this tweet take it non-literally and mock things But I’ve dropped my first few literal samples into #LikeMyCode
why are we only commenting our code? we should be liking and subscribing too
> a lot of extra typing to implement for something that is pretty common I collect such idioms inside #LikeMyCode, this one at def open_read(*args, **kwargs): with open(*args, **kwargs) as ... Sadly, I have no good way to distribute updates of these across my code
got hashtag? me, by your lead here, i started pushing my code into #LikeMyCode, but i don't see many of us making that choice as yet?
#LikeMyCode is the most I can ask Asking you to #LoveMyCode like I do would be too much to ask
Todo programador tem um caso de amor com seu código! #lovemycode
# hello Python sys.maxsize >>> import math, sys >>> print(hex(1 << 63)); print(hex(sys.maxsize)) 0x8000000000000000 0x7fffffffffffffff >>> print("{:_}".format(sys.maxsize)); print("{:e}".format(sys.maxsize)) 9_223_372_036_854_775_807 9.223372e+18 >>> #LikeMyCode
#Python factlet: The len() function insists that the corresponding __len__() method return a value x such that: 0 ≤ x.__index__() ≤ sys.maxsize * 3.0 and '3' don't have an __index__ method. * -1 is too small. * sys.maxsize+1 is too big. 1/
def stderr_print(*args, **kwargs): sys.stdout.flush() print(*args, **kwargs, file=sys.stderr) sys.stderr.flush() #LikeMyCode
why are we only commenting our code? we should be liking and subscribing too
def check(goal, want=True, got=None, **kwargs): try: if isinstance(want, bool): assert want is bool(got) else: assert want == got except AssertionError: pdb.set_trace() print(want) print(got) print(kwargs) raise #LikeMyCode
why are we only commenting our code? we should be liking and subscribing too
@bekki_lomax you didn't have to carry it on and which one we on about a or r? #likemycode?
def stderr_stamp(*args, **kwargs): now = dt.datetime.now() stamp = now.strftime("%Y-%m-%d %H:%M:%S.%f") stderr_print(stamp, *args, **kwargs) #LikeMyCode
why are we only commenting our code? we should be liking and subscribing too
# hello Python sys.maxsize >>> import math, sys >>> print(hex(1 << 63)); print(hex(sys.maxsize)) 0x8000000000000000 0x7fffffffffffffff >>> print("{:_}".format(sys.maxsize)); print("{:e}".format(sys.maxsize)) 9_223_372_036_854_775_807 9.223372e+18 >>> #LikeMyCode
#Python factlet: The len() function insists that the corresponding __len__() method return a value x such that: 0 ≤ x.__index__() ≤ sys.maxsize * 3.0 and '3' don't have an __index__ method. * -1 is too small. * sys.maxsize+1 is too big. 1/
An example calculator definition is function + { echo plus; } function ++ { echo plus-plus; } function - { echo minus; } function -- { echo minus-minus; } #LikeMyCode
#LikeMyCode def open_read_close(*args, **kwargs): with open(*args, **kwargs) as incoming: fetched = incoming.read() return fetched
> a lot of extra typing to implement for something that is pretty common I collect such idioms inside #LikeMyCode, this one at def open_read(*args, **kwargs): with open(*args, **kwargs) as ... Sadly, I have no good way to distribute updates of these across my code
#LikeMyCode Bash echo alpha >a echo bravo >b CURL1='curl -i --user "$(cat a):$(cat b)"' set $CURL1 echo $# # 6 echo $@ # curl -i --user "$(cat a):$(cat b)" CURL2="curl -i --user '$(cat a):$(cat b)'" set $CURL2 echo $# # 4 echo $@ # curl -i --user 'alpha:bravo' logout
% git clone github.com/pelavarre/pyba… % cd pybashish/ % bin/hearme.py rstrip + pbpaste | awk '//{sub(" *$", ""); print}'| pbcopy % echo ' abc ' | cat -etv abc $ % echo ' abc ' | hearme.py rstrip | cat -etv + awk '//{sub(" *$", ""); print}' abc$ % #LikeMyCode
got hashtag? me, by your lead here, i started pushing my code into #LikeMyCode, but i don't see many of us making that choice as yet?
#LikeMyCode is the most I can ask Asking you to #LoveMyCode like I do would be too much to ask
Todo programador tem um caso de amor com seu código! #lovemycode
Any chance we’ll go somewhere good now by pushing out code richly decontextualised? The replies and quote-tweets of this tweet take it non-literally and mock things But I’ve dropped my first few literal samples into #LikeMyCode
why are we only commenting our code? we should be liking and subscribing too
export OLDPS1="$PS1" eval "$(dircolors <(dircolors -p | sed 's,1;,0;,g'))" stty -ixon function ps1-theirs () { export PS1="$OLDPS1"; } function ps1-plain () { export PS1="$(echo "$OLDPS1" | sed 's,1;,0;,g')"; } function ps1-mine () { export PS1='\$ '; } ps1-mine #LikeMyCode
export OLDPS1="$PS1" function ps1 () { : toggle the prompt on and off : if [ "$PS1" != '%# ' ]; then export PS1='%# ' else export PS1="$OLDPS1" fi } #LikeMyCode
def sshprocess_run(there, far, *args, **kwargs): near = "ssh {} {!r}".format(there, far) ran = subprocess.run(near, shell=True, input="", stdout=subprocess.PIPE, stderr=subprocess.PIPE, *args, **kwargs) return ran #LikeMyCode
| python3 -c 'import sys;print("".join(sorted(set(sys.stdin.read().replace("\n","")))),end="\n")' #LikeMyCode
def check(goal, want=True, got=None, **kwargs): try: if isinstance(want, bool): assert want is bool(got) else: assert want == got except AssertionError: pdb.set_trace() print(want) print(got) print(kwargs) raise #LikeMyCode
why are we only commenting our code? we should be liking and subscribing too
def stderr_stamp(*args, **kwargs): now = dt.datetime.now() stamp = now.strftime("%Y-%m-%d %H:%M:%S.%f") stderr_print(stamp, *args, **kwargs) #LikeMyCode
why are we only commenting our code? we should be liking and subscribing too
def stderr_print(*args, **kwargs): sys.stdout.flush() print(*args, **kwargs, file=sys.stderr) sys.stderr.flush() #LikeMyCode
why are we only commenting our code? we should be liking and subscribing too
@bekki_lomax you didn't have to carry it on and which one we on about a or r? #likemycode?
Something went wrong.
Something went wrong.
United States Trends
- 1. Penn State 23.6K posts
- 2. Indiana 39.3K posts
- 3. Mendoza 20.7K posts
- 4. Gus Johnson 6,947 posts
- 5. #UFCVegas111 5,443 posts
- 6. #iufb 4,300 posts
- 7. Sayin 70.4K posts
- 8. Omar Cooper 9,773 posts
- 9. Iowa 20.2K posts
- 10. Mizzou 3,985 posts
- 11. Josh Hokit N/A
- 12. Estevao 41.3K posts
- 13. Kirby Moore N/A
- 14. Sunderland 156K posts
- 15. Beck 7,575 posts
- 16. Oregon 34.2K posts
- 17. Texas Tech 14.2K posts
- 18. Happy Valley 1,932 posts
- 19. Jim Knowles N/A
- 20. Preston Howard N/A