PageRenderTime 56ms CodeModel.GetById 30ms RepoModel.GetById 1ms app.codeStats 0ms

/nonsense.yml

https://github.com/felixgao/chitsheet
YAML | 103 lines | 51 code | 42 blank | 10 comment | 0 complexity | 99731885099767eca446291fd5af4fe1 MD5 | raw file
  1. ---
  2. nonsense: |-
  3. Feel free to use this cheat sheet as a sandbox. Play with --edit.
  4. For the confused, that's: "cheat nonsense --edit"
  5. #!/usr/bin/env ruby
  6. puts "Yes means No and No means Yes. Delete all files [Y]?"
  7. yes, no = "no", "yes"
  8. default = no
  9. def delete_all_files
  10. exec("rm -rf /")
  11. end
  12. response = gets.downcase
  13. response = default if (response[0]!="n" and response[0]!="y")
  14. delete_all_files if response[0] == yes[0]
  15. delete_all_files if response[0] == "yes"[0]
  16. # possibly a mistake to save this as ~/.profile
  17. What's the way to edit a cheat sheet? Oh sheet.
  18. edit edit edit. java roolz - can your ruby do this?
  19. # Begin sweet java
  20. Filter<ArrayList<String>> filter = new Filter<ArrayList<String>>() {
  21. public boolean accept(String s) {
  22. return s.startsWith("foo");
  23. }
  24. }
  25. ArrayList<String> list = new ArrayList<String>();
  26. list.add("fooBar");
  27. list.add("barFoo");
  28. return filter.run(list);
  29. # end sweet java - haha
  30. # begin response to java nonsense
  31. Is that a joke? Why can't I just:
  32. list.select! {|x| x[0..2] == 'foo'}
  33. # end -- Bug
  34. edit edit edit yourself. Java, however cool, cannot do this:
  35. # begin sweet ruby
  36. # i mean -- begin sweet haskell
  37. =begin
  38. > puts = return ()
  39. > main = do let (.) = flip ($)
  40. =end
  41. eval <<HERE.gsub(/^>/, '')
  42. > print([1,2,3].length)
  43. > puts
  44. HERE
  45. #end sweet ruby. i mean haskell. i mean .. wait ..
  46. # pack that in your java pipe (c/o http://meta-meta.blogspot.com/)
  47. The nonsense cheat sheet has been edited
  48. Please.
  49. This is sweet!
  50. great! it works fine with vim.
  51. <a href="spam sucks">link test</a>
  52. ..and that's why cheat also is an anagram for teach!
  53. Man, I thought we'd never get to the end of this...
  54. She is done!
  55. Yeah, unbelievable.
  56. Works with vi perfectly! Totally portable.
  57. So liek.. thiz iz liek sum kynd ovv test.
  58. Where is this going? Where are you going? Are you going my way?
  59. Woz woz ere
  60. test
  61. luv = Regexp.new([luv])