From 029c5c40d0d12db77859571a102c08c893fe1ac5 Mon Sep 17 00:00:00 2001 From: ilv Date: Thu, 5 Mar 2015 03:39:02 +0000 Subject: [PATCH 001/379] First version of OnionAddress IA idea --- lib/DDG/Goodie/OnionAddress.pm | 36 ++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 lib/DDG/Goodie/OnionAddress.pm diff --git a/lib/DDG/Goodie/OnionAddress.pm b/lib/DDG/Goodie/OnionAddress.pm new file mode 100644 index 000000000..2afa28215 --- /dev/null +++ b/lib/DDG/Goodie/OnionAddress.pm @@ -0,0 +1,36 @@ +package DDG::Goodie::OnionAddress; +# ABSTRACT: Provide quick access to HTTP onion services. + +use strict; +use DDG::Goodie; + +zci is_cached => 1; +zci answer_type => "onion_address"; + +primary_example_queries 'https://3g2upl4pq6kufc4m.onion'; +secondary_example_queries 'How do I access https://3g2upl4pq6kufc4m.onion:81/?q=dont+track+us?'; +description 'Provide quick access to HTTP onion services'; +name 'OnionAddress'; +code_url 'https://github.com/duckduckgo/zeroclickinfo-goodies/blob/master/lib/DDG/Goodie/OnionAddress.pm'; +category 'reference'; +topics 'special_interest', 'cryptography'; +attribution email => 'ilv@torproject.org'; + +# regex to detect an onion address +# this cover several cases, including addresses with ports and/or paths +# e.g. https://3g2upl4pq6kufc4m.onion:5000/?q=dont+track+us +my $onion_addess_qr = qr/\bhttps?:\/\/([a-z0-9]{16})\.onion[:\d+]?[\/.*]?\b/; + +# add an optional question mark in case it's at the end of a question sentence +# e.g. How do I access https://0123456789abcdef.onion? +triggers query_lc => qr/$onion_addess_qr[\?]?/; + +handle query_lc => sub { + if ($1) { + return $1, heading => "Access to onion service", html => "Access $1.onion using the Tor Browser or via Tor2web."; + } + + return; +}; + +1; From 0c9f77f5cbe2771cc03168ad3eee31b2b174139d Mon Sep 17 00:00:00 2001 From: ilv Date: Thu, 5 Mar 2015 03:39:31 +0000 Subject: [PATCH 002/379] Tests for OnionAddress IA idea --- t/OnionAddress.t | 84 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 t/OnionAddress.t diff --git a/t/OnionAddress.t b/t/OnionAddress.t new file mode 100644 index 000000000..30067486c --- /dev/null +++ b/t/OnionAddress.t @@ -0,0 +1,84 @@ +#!/usr/bin/env perl + +use strict; +use warnings; + +use Test::More; +use DDG::Test::Goodie; + +zci answer_type => 'onion_address'; +zci is_cached => 1; + +ddg_goodie_test( + [ + 'DDG::Goodie::OnionAddress' + ], + 'https://3g2upl4pq6kufc4m.onion' => + test_zci( + '3g2upl4pq6kufc4m', + heading => 'Access to onion service', + html => "Access 3g2upl4pq6kufc4m.onion using the Tor Browser or via Tor2web." + ), + 'How to access https://3g2upl4pq6kufc4m.onion?' => + test_zci( + '3g2upl4pq6kufc4m', + heading => 'Access to onion service', + html => "Access 3g2upl4pq6kufc4m.onion using the Tor Browser or via Tor2web." + ), + 'How to access https://3g2upl4pq6kufc4m.onion/?q=dont+track+us' => + test_zci( + '3g2upl4pq6kufc4m', + heading => 'Access to onion service', + html => "Access 3g2upl4pq6kufc4m.onion using the Tor Browser or via Tor2web." + ), + 'How to access https://3g2upl4pq6kufc4m.onion/privacy?' => + test_zci( + '3g2upl4pq6kufc4m', + heading => 'Access to onion service', + html => "Access 3g2upl4pq6kufc4m.onion using the Tor Browser or via Tor2web." + ), + 'How to access https://3g2upl4pq6kufc4m.onion/anti-censorship/?' => + test_zci( + '3g2upl4pq6kufc4m', + heading => 'Access to onion service', + html => "Access 3g2upl4pq6kufc4m.onion using the Tor Browser or via Tor2web." + ), + 'http://3g2upl4pq6kufc4m.onion' => + test_zci( + '3g2upl4pq6kufc4m', + heading => 'Access to onion service', + html => "Access 3g2upl4pq6kufc4m.onion using the Tor Browser or via Tor2web." + ), + 'https://0123456789abcdef.onion/' => + test_zci( + '0123456789abcdef', + heading => 'Access to onion service', + html => "Access 0123456789abcdef.onion using the Tor Browser or via Tor2web." + ), + 'https://0123456789abcdef.onion:123/' => + test_zci( + '0123456789abcdef', + heading => 'Access to onion service', + html => "Access 0123456789abcdef.onion using the Tor Browser or via Tor2web." + ), + 'https://0123456789abcdef.onion:5000/about-us' => + test_zci( + '0123456789abcdef', + heading => 'Access to onion service', + html => "Access 0123456789abcdef.onion using the Tor Browser or via Tor2web." + ), + 'http://0000000000000000.onion/' => + test_zci( + '0000000000000000', + heading => 'Access to onion service', + html => "Access 0000000000000000.onion using the Tor Browser or via Tor2web." + ), + 'what is https://aaaaaaaaaaaaaaaa.onion?' => + test_zci( + 'aaaaaaaaaaaaaaaa', + heading => 'Access to onion service', + html => "Access aaaaaaaaaaaaaaaa.onion using the Tor Browser or via Tor2web." + ), +); + +done_testing; \ No newline at end of file From cdd8d3e1496193079b43fe45f9c873a447850b79 Mon Sep 17 00:00:00 2001 From: ilv Date: Thu, 5 Mar 2015 03:43:31 +0000 Subject: [PATCH 003/379] Fixed minor typo --- lib/DDG/Goodie/OnionAddress.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/DDG/Goodie/OnionAddress.pm b/lib/DDG/Goodie/OnionAddress.pm index 2afa28215..5adc341f7 100644 --- a/lib/DDG/Goodie/OnionAddress.pm +++ b/lib/DDG/Goodie/OnionAddress.pm @@ -19,11 +19,11 @@ attribution email => 'ilv@torproject.org'; # regex to detect an onion address # this cover several cases, including addresses with ports and/or paths # e.g. https://3g2upl4pq6kufc4m.onion:5000/?q=dont+track+us -my $onion_addess_qr = qr/\bhttps?:\/\/([a-z0-9]{16})\.onion[:\d+]?[\/.*]?\b/; +my $onion_address_qr = qr/\bhttps?:\/\/([a-z0-9]{16})\.onion[:\d+]?[\/.*]?\b/; # add an optional question mark in case it's at the end of a question sentence # e.g. How do I access https://0123456789abcdef.onion? -triggers query_lc => qr/$onion_addess_qr[\?]?/; +triggers query_lc => qr/$onion_address_qr[\?]?/; handle query_lc => sub { if ($1) { From 5948f7d38b524cdc354d0dd1d933416943ae63eb Mon Sep 17 00:00:00 2001 From: ilv Date: Thu, 5 Mar 2015 05:28:21 +0000 Subject: [PATCH 004/379] Clearer return + div zci__caption in html. Deleted heading. --- lib/DDG/Goodie/OnionAddress.pm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/DDG/Goodie/OnionAddress.pm b/lib/DDG/Goodie/OnionAddress.pm index 5adc341f7..7a0c11c0d 100644 --- a/lib/DDG/Goodie/OnionAddress.pm +++ b/lib/DDG/Goodie/OnionAddress.pm @@ -26,11 +26,10 @@ my $onion_address_qr = qr/\bhttps?:\/\/([a-z0-9]{16})\.onion[:\d+]?[\/.*]?\b/; triggers query_lc => qr/$onion_address_qr[\?]?/; handle query_lc => sub { - if ($1) { - return $1, heading => "Access to onion service", html => "Access $1.onion using the Tor Browser or via Tor2web."; - } - return; + return unless $1; + return $1, html => "
Access $1.onion using the Tor Browser or via Tor2web.
"; + }; 1; From cc9e779aed1354c840c14e147da9f5bcfa5bb559 Mon Sep 17 00:00:00 2001 From: ilv Date: Thu, 5 Mar 2015 05:28:54 +0000 Subject: [PATCH 005/379] Deleted heading. Added div zci__caption to expected html --- t/OnionAddress.t | 33 +++++++++++---------------------- 1 file changed, 11 insertions(+), 22 deletions(-) diff --git a/t/OnionAddress.t b/t/OnionAddress.t index 30067486c..55295cc2d 100644 --- a/t/OnionAddress.t +++ b/t/OnionAddress.t @@ -16,68 +16,57 @@ ddg_goodie_test( 'https://3g2upl4pq6kufc4m.onion' => test_zci( '3g2upl4pq6kufc4m', - heading => 'Access to onion service', - html => "Access 3g2upl4pq6kufc4m.onion using the Tor Browser or via Tor2web." + html => "
Access 3g2upl4pq6kufc4m.onion using the Tor Browser or via Tor2web.
" ), 'How to access https://3g2upl4pq6kufc4m.onion?' => test_zci( '3g2upl4pq6kufc4m', - heading => 'Access to onion service', - html => "Access 3g2upl4pq6kufc4m.onion using the Tor Browser or via Tor2web." + html => "
Access 3g2upl4pq6kufc4m.onion using the Tor Browser or via Tor2web.
" ), 'How to access https://3g2upl4pq6kufc4m.onion/?q=dont+track+us' => test_zci( '3g2upl4pq6kufc4m', - heading => 'Access to onion service', - html => "Access 3g2upl4pq6kufc4m.onion using the Tor Browser or via Tor2web." + html => "
Access 3g2upl4pq6kufc4m.onion using the Tor Browser or via Tor2web.
" ), 'How to access https://3g2upl4pq6kufc4m.onion/privacy?' => test_zci( '3g2upl4pq6kufc4m', - heading => 'Access to onion service', - html => "Access 3g2upl4pq6kufc4m.onion using the Tor Browser or via Tor2web." + html => "
Access 3g2upl4pq6kufc4m.onion using the Tor Browser or via Tor2web.
" ), 'How to access https://3g2upl4pq6kufc4m.onion/anti-censorship/?' => test_zci( '3g2upl4pq6kufc4m', - heading => 'Access to onion service', - html => "Access 3g2upl4pq6kufc4m.onion using the Tor Browser or via Tor2web." + html => "
Access 3g2upl4pq6kufc4m.onion using the Tor Browser or via Tor2web.
" ), 'http://3g2upl4pq6kufc4m.onion' => test_zci( '3g2upl4pq6kufc4m', - heading => 'Access to onion service', - html => "Access 3g2upl4pq6kufc4m.onion using the Tor Browser or via Tor2web." + html => "
Access 3g2upl4pq6kufc4m.onion using the Tor Browser or via Tor2web.
" ), 'https://0123456789abcdef.onion/' => test_zci( '0123456789abcdef', - heading => 'Access to onion service', - html => "Access 0123456789abcdef.onion using the Tor Browser or via Tor2web." + html => "
Access 0123456789abcdef.onion using the Tor Browser or via Tor2web.
" ), 'https://0123456789abcdef.onion:123/' => test_zci( '0123456789abcdef', - heading => 'Access to onion service', - html => "Access 0123456789abcdef.onion using the Tor Browser or via Tor2web." + html => "
Access 0123456789abcdef.onion using the Tor Browser or via Tor2web.
" ), 'https://0123456789abcdef.onion:5000/about-us' => test_zci( '0123456789abcdef', - heading => 'Access to onion service', - html => "Access 0123456789abcdef.onion using the Tor Browser or via Tor2web." + html => "
Access 0123456789abcdef.onion using the Tor Browser or via Tor2web.
" ), 'http://0000000000000000.onion/' => test_zci( '0000000000000000', - heading => 'Access to onion service', - html => "Access 0000000000000000.onion using the Tor Browser or via Tor2web." + html => "
Access 0000000000000000.onion using the Tor Browser or via Tor2web.
" ), 'what is https://aaaaaaaaaaaaaaaa.onion?' => test_zci( 'aaaaaaaaaaaaaaaa', - heading => 'Access to onion service', - html => "Access aaaaaaaaaaaaaaaa.onion using the Tor Browser or via Tor2web." + html => "
Access aaaaaaaaaaaaaaaa.onion using the Tor Browser or via Tor2web.
" ), ); From a712d40d93f6e08a41950baedbc0e875ae1d3635 Mon Sep 17 00:00:00 2001 From: ilv Date: Fri, 6 Mar 2015 19:23:25 +0000 Subject: [PATCH 006/379] Made http(s) optional (but no other protos). Fixed wrong grouping in regex --- lib/DDG/Goodie/OnionAddress.pm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/DDG/Goodie/OnionAddress.pm b/lib/DDG/Goodie/OnionAddress.pm index 7a0c11c0d..5d705f733 100644 --- a/lib/DDG/Goodie/OnionAddress.pm +++ b/lib/DDG/Goodie/OnionAddress.pm @@ -7,7 +7,7 @@ use DDG::Goodie; zci is_cached => 1; zci answer_type => "onion_address"; -primary_example_queries 'https://3g2upl4pq6kufc4m.onion'; +primary_example_queries '3g2upl4pq6kufc4m.onion'; secondary_example_queries 'How do I access https://3g2upl4pq6kufc4m.onion:81/?q=dont+track+us?'; description 'Provide quick access to HTTP onion services'; name 'OnionAddress'; @@ -19,16 +19,18 @@ attribution email => 'ilv@torproject.org'; # regex to detect an onion address # this cover several cases, including addresses with ports and/or paths # e.g. https://3g2upl4pq6kufc4m.onion:5000/?q=dont+track+us -my $onion_address_qr = qr/\bhttps?:\/\/([a-z0-9]{16})\.onion[:\d+]?[\/.*]?\b/; +my $onion_address_qr = qr/(\w+:\/\/)?([a-z0-9]{16})\.onion(:\d+)?(\/.*)?/; # add an optional question mark in case it's at the end of a question sentence # e.g. How do I access https://0123456789abcdef.onion? -triggers query_lc => qr/$onion_address_qr[\?]?/; +triggers query_lc => qr/\b$onion_address_qr(\?)?\b/; handle query_lc => sub { - return unless $1; - return $1, html => "
Access $1.onion using the Tor Browser or via Tor2web.
"; + # we only accept queries for web onion services + # we also assume that an onion service without protocol:// should be web + return unless !$1 or $1 eq 'https://' or $1 eq 'http://' or $2; + return $2, html => "
Access $2.onion using the Tor Browser or via Tor2web.
"; }; From b8e2768fa0e524961fea864402caa28dd890d23b Mon Sep 17 00:00:00 2001 From: ilv Date: Fri, 6 Mar 2015 19:24:24 +0000 Subject: [PATCH 007/379] Removed http(s) from some tests (because it's optional now) --- t/OnionAddress.t | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/t/OnionAddress.t b/t/OnionAddress.t index 55295cc2d..88a4032a9 100644 --- a/t/OnionAddress.t +++ b/t/OnionAddress.t @@ -23,7 +23,7 @@ ddg_goodie_test( '3g2upl4pq6kufc4m', html => "
Access 3g2upl4pq6kufc4m.onion using the Tor Browser or via Tor2web.
" ), - 'How to access https://3g2upl4pq6kufc4m.onion/?q=dont+track+us' => + 'How to access 3g2upl4pq6kufc4m.onion/?q=dont+track+us' => test_zci( '3g2upl4pq6kufc4m', html => "
Access 3g2upl4pq6kufc4m.onion using the Tor Browser or via Tor2web.
" @@ -33,7 +33,7 @@ ddg_goodie_test( '3g2upl4pq6kufc4m', html => "
Access 3g2upl4pq6kufc4m.onion using the Tor Browser or via Tor2web.
" ), - 'How to access https://3g2upl4pq6kufc4m.onion/anti-censorship/?' => + 'How to access 3g2upl4pq6kufc4m.onion/anti-censorship/?' => test_zci( '3g2upl4pq6kufc4m', html => "
Access 3g2upl4pq6kufc4m.onion using the Tor Browser or via Tor2web.
" @@ -48,7 +48,7 @@ ddg_goodie_test( '0123456789abcdef', html => "
Access 0123456789abcdef.onion using the Tor Browser or via Tor2web.
" ), - 'https://0123456789abcdef.onion:123/' => + '0123456789abcdef.onion:123/' => test_zci( '0123456789abcdef', html => "
Access 0123456789abcdef.onion using the Tor Browser or via Tor2web.
" @@ -63,7 +63,7 @@ ddg_goodie_test( '0000000000000000', html => "
Access 0000000000000000.onion using the Tor Browser or via Tor2web.
" ), - 'what is https://aaaaaaaaaaaaaaaa.onion?' => + 'what is aaaaaaaaaaaaaaaa.onion?' => test_zci( 'aaaaaaaaaaaaaaaa', html => "
Access aaaaaaaaaaaaaaaa.onion using the Tor Browser or via Tor2web.
" From 90a94b22923c4bd7311f9ed5c9f979b277ceebf0 Mon Sep 17 00:00:00 2001 From: ilv Date: Fri, 6 Mar 2015 19:27:43 +0000 Subject: [PATCH 008/379] Fixed bad indentantion --- lib/DDG/Goodie/OnionAddress.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/DDG/Goodie/OnionAddress.pm b/lib/DDG/Goodie/OnionAddress.pm index 5d705f733..82b91b1a6 100644 --- a/lib/DDG/Goodie/OnionAddress.pm +++ b/lib/DDG/Goodie/OnionAddress.pm @@ -27,9 +27,9 @@ triggers query_lc => qr/\b$onion_address_qr(\?)?\b/; handle query_lc => sub { - # we only accept queries for web onion services - # we also assume that an onion service without protocol:// should be web - return unless !$1 or $1 eq 'https://' or $1 eq 'http://' or $2; + # we only accept queries for web onion services + # we also assume that an onion service without protocol:// should be web + return unless !$1 or $1 eq 'https://' or $1 eq 'http://' or $2; return $2, html => "
Access $2.onion using the Tor Browser or via Tor2web.
"; }; From a6c8f6dfaeb093ccd4126d06f016216733d9f6ed Mon Sep 17 00:00:00 2001 From: Sagar Hani Date: Fri, 17 Jul 2015 03:06:33 +0530 Subject: [PATCH 009/379] Added ubuntu.json file Cheat sheet for Ubuntu. --- share/goodie/cheat_sheets/ubuntu.json | 239 ++++++++++++++++++++++++++ 1 file changed, 239 insertions(+) create mode 100644 share/goodie/cheat_sheets/ubuntu.json diff --git a/share/goodie/cheat_sheets/ubuntu.json b/share/goodie/cheat_sheets/ubuntu.json new file mode 100644 index 000000000..c8e186f3f --- /dev/null +++ b/share/goodie/cheat_sheets/ubuntu.json @@ -0,0 +1,239 @@ +{ + "id": "ubuntu_cheat_sheet", + "name": "Ubuntu", + "description": "Ubuntu Reference", + "metadata": { + "sourceName": "Ubuntu", + "sourceUrl": "http://www.cheat-sheets.org/saved-copy/ubunturef.pdf" + }, + "section_order": [ + "Privileges", + "Display", + "System Services", + "Package Management", + "Network", + "Special Packages", + "Firewall", + "Application Names", + "System" + ], + "sections": { + "Privileges": [{ + "val": "run command as root ", + "key": "sudo command" + }, { + "val": "open a root shell", + "key": "sudo -s" + }, { + "val": "open a shell as user", + "key": "sudo -s -u user" + }, { + "val": "forget sudo passwords", + "key": "sudo -k" + }, { + "val": "visual sudo dialog (GNOME)", + "key": "gksudo command" + }, { + "val": "visual sudo dialog (KDE)", + "key": "kdesudo command" + }, { + "val": "edit /etc/sudoers", + "key": "sudo visudo" + }, { + "val": "root file manager (GNOME)", + "key": "gksudo nautilus" + }, { + "val": "root file manager (KDE)", + "key": "kdesudo konqueror" + }, { + "val": "change your password", + "key": "passwd" + }], + "Display": [{ + "val": "restart X and return to login (GNOME)", + "key": "sudo /etc/init.d/gdm restart" + }, { + "val": "restart X and return to login (KDE)", + "key": "sudo /etc/init.d/kdm restart" + }, { + "val": "display configuration", + "key": "(file) /etc/X11/xorg.conf" + }, { + "val": "reset xorg.conf configuration", + "key": "sudo dexconf" + }, { + "val": "restart X display if frozen", + "key": "[Ctrl] [Alt] [Backspace]" + }, { + "val": "switch to tty N", + "key": "[Ctrl] [Alt] [Fn]" + }, { + "val": "switch back to X display", + "key": "[Ctrl] [Alt] [F7]" + }], + "System Services": [{ + "val": "start job service (Upstart)", + "key": "start service" + }, { + "val": "stop job service (Upstart)", + "key": "stop service" + }, { + "val": "check if service is running (Upstart)", + "key": "status service" + }, { + "val": "start service(SysV)", + "key": "/etc/init.d/service start" + }, { + "val": "stop service (SysV)", + "key": "/etc/init.d/service stop" + }, { + "val": "check service (SysV)", + "key": "/etc/init.d/service status" + }, { + "val": "restart service (SysV)", + "key": "/etc/init.d/service restart" + }, { + "val": "get current runlevel", + "key": "runlevel" + }], + "Package Management": [{ + "val": "refresh available updates", + "key": "apt-get update" + }, { + "val": "upgrade all packages", + "key": "apt-get upgrade" + }, { + "val": "upgrade with package replacements; upgrade Ubuntu version", + "key": "apt-get dist-upgrade" + }, { + "val": "install pkg", + "key": "apt-get install pkg" + }, { + "val": "uninstall pkg", + "key": "apt-get purge pkg" + }, { + "val": "remove obsolete packages", + "key": "apt-get autoremove" + }, { + "val": "try to fix broken packages", + "key": "apt-get -f install" + }, { + "val": "try to fix broken packages", + "key": "dpkg --configure -a" + }, { + "val": "install file pkg.deb", + "key": "dpkg -i pkg.deb" + }, { + "val": "APT repository list", + "key": "(file) /etc/apt/sources.list" + }], + "Network": [{ + "val": "show network information", + "key": "ifconfig" + }, { + "val": "show wireless information", + "key": "iwconfig" + }, { + "val": "scan for wireless networks", + "key": "sudo iwlist scan" + }, { + "val": "reset network for manual configurations", + "key": "sudo /etc/init.d/networking restart" + }, { + "val": "manual configuration", + "key": "(file) /etc/network/interfaces" + }, { + "val": "bring interface online", + "key": "ifup interface" + }, { + "val": "disable interface", + "key": "ifdown interface" + }], + "Special Packages": [{ + "val": "standard Ubuntu environment", + "key": "ubuntu-desktop" + }, { + "val": "KDE desktop", + "key": "kubuntu-desktop" + }, { + "val": "XFCE desktop", + "key": "xubuntu-desktop" + }, { + "val": "core Ubuntu utilities", + "key": "ubuntu-minimal" + }, { + "val": "standard Ubuntu utilities", + "key": "ubuntu-standard" + }, { + "val": "non-free, but useful", + "key": "ubuntu-restricted-extras" + }, { + "val": "KDE of the above", + "key": "kubuntu-restricted-extras" + }, { + "val": "packages used to compile programs", + "key": "xubuntu-restricted-extras" + }, { + "val": "latest generic kernel image", + "key": "linux-image-generic" + }, { + "val": "latest build headers", + "key": "linux-headers-generic" + }], + "Firewall": [{ + "val": "turn on the firewall", + "key": "ufw enable" + }, { + "val": "turn off the firewall", + "key": "ufw disable" + }, { + "val": "allow all connections by default", + "key": "ufw default allow" + }, { + "val": "drop all connections by default", + "key": "ufw default deny" + }, { + "val": "current status and rules", + "key": "ufw status" + }, { + "val": "allow traffic on port", + "key": "ufw allow port" + }, { + "val": "block port", + "key": "ufw deny port" + }, { + "val": "block ip adress", + "key": "ufw deny from ip" + }], + "Application Names": [{ + "val": "file manager (GNOME)", + "key": "nautilus" + }, { + "val": "file manager (KDE)", + "key": "dolphin" + }, { + "val": "web browser (KDE)", + "key": "konqueror" + }, { + "val": "text editor (KDE)", + "key": "kate" + }, { + "val": "text editor (GNOME)", + "key": "gedit" + }], + "System": [{ + "val": "Type the phrase REISUB while holding down Alt and SysRq (PrintScrn) with about 1 second between each letter. Your system will reboot", + "key": "Recovery" + + }, { + "val": "get Ubuntu version", + "key": "lsb_release -a" + }, { + "val": "get kernel version", + "key": "uname -r" + }, { + "val": "get all kernel information", + "key": "uname -a" + }] + } +} From d2870e0b2130e4aa3ee50c347aa400e03805df36 Mon Sep 17 00:00:00 2001 From: Sagar Hani Date: Fri, 17 Jul 2015 18:28:10 +0530 Subject: [PATCH 010/379] Fixed minor issues. --- share/goodie/cheat_sheets/ubuntu.json | 128 +++++++++++++------------- 1 file changed, 64 insertions(+), 64 deletions(-) diff --git a/share/goodie/cheat_sheets/ubuntu.json b/share/goodie/cheat_sheets/ubuntu.json index c8e186f3f..668538b86 100644 --- a/share/goodie/cheat_sheets/ubuntu.json +++ b/share/goodie/cheat_sheets/ubuntu.json @@ -19,138 +19,138 @@ ], "sections": { "Privileges": [{ - "val": "run command as root ", + "val": "Run command as root ", "key": "sudo command" }, { - "val": "open a root shell", + "val": "Open a root shell", "key": "sudo -s" }, { - "val": "open a shell as user", + "val": "Open a shell as user", "key": "sudo -s -u user" }, { - "val": "forget sudo passwords", + "val": "Forget sudo passwords", "key": "sudo -k" }, { - "val": "visual sudo dialog (GNOME)", + "val": "Visual sudo dialog (GNOME)", "key": "gksudo command" }, { - "val": "visual sudo dialog (KDE)", + "val": "Visual sudo dialog (KDE)", "key": "kdesudo command" }, { - "val": "edit /etc/sudoers", + "val": "Edit /etc/sudoers", "key": "sudo visudo" }, { - "val": "root file manager (GNOME)", + "val": "Root file manager (GNOME)", "key": "gksudo nautilus" }, { - "val": "root file manager (KDE)", + "val": "Root file manager (KDE)", "key": "kdesudo konqueror" }, { - "val": "change your password", + "val": "Change your password", "key": "passwd" }], "Display": [{ - "val": "restart X and return to login (GNOME)", + "val": "Restart X and return to login (GNOME)", "key": "sudo /etc/init.d/gdm restart" }, { - "val": "restart X and return to login (KDE)", + "val": "Restart X and return to login (KDE)", "key": "sudo /etc/init.d/kdm restart" }, { - "val": "display configuration", + "val": "Display configuration", "key": "(file) /etc/X11/xorg.conf" }, { - "val": "reset xorg.conf configuration", + "val": "Reset xorg.conf configuration", "key": "sudo dexconf" }, { - "val": "restart X display if frozen", + "val": "Restart X display if frozen", "key": "[Ctrl] [Alt] [Backspace]" }, { - "val": "switch to tty N", + "val": "Switch to TTY N", "key": "[Ctrl] [Alt] [Fn]" }, { - "val": "switch back to X display", + "val": "Switch back to X display", "key": "[Ctrl] [Alt] [F7]" }], "System Services": [{ - "val": "start job service (Upstart)", + "val": "Start job service (Upstart)", "key": "start service" }, { - "val": "stop job service (Upstart)", + "val": "Stop job service (Upstart)", "key": "stop service" }, { - "val": "check if service is running (Upstart)", + "val": "Check if service is running (Upstart)", "key": "status service" }, { - "val": "start service(SysV)", + "val": "Start service(SysV)", "key": "/etc/init.d/service start" }, { - "val": "stop service (SysV)", + "val": "Stop service (SysV)", "key": "/etc/init.d/service stop" }, { - "val": "check service (SysV)", + "val": "Check service (SysV)", "key": "/etc/init.d/service status" }, { - "val": "restart service (SysV)", + "val": "Restart service (SysV)", "key": "/etc/init.d/service restart" }, { - "val": "get current runlevel", + "val": "Get current runlevel", "key": "runlevel" }], "Package Management": [{ - "val": "refresh available updates", + "val": "Refresh available updates", "key": "apt-get update" }, { - "val": "upgrade all packages", + "val": "Upgrade all packages", "key": "apt-get upgrade" }, { - "val": "upgrade with package replacements; upgrade Ubuntu version", + "val": "Upgrade with package replacements; upgrade Ubuntu version", "key": "apt-get dist-upgrade" }, { - "val": "install pkg", + "val": "Install pkg", "key": "apt-get install pkg" }, { - "val": "uninstall pkg", + "val": "Uninstall pkg", "key": "apt-get purge pkg" }, { - "val": "remove obsolete packages", + "val": "Remove obsolete packages", "key": "apt-get autoremove" }, { - "val": "try to fix broken packages", + "val": "Try to fix broken packages", "key": "apt-get -f install" }, { - "val": "try to fix broken packages", + "val": "Try to fix broken packages", "key": "dpkg --configure -a" }, { - "val": "install file pkg.deb", + "val": "Install file pkg.deb", "key": "dpkg -i pkg.deb" }, { "val": "APT repository list", "key": "(file) /etc/apt/sources.list" }], "Network": [{ - "val": "show network information", + "val": "Show network information", "key": "ifconfig" }, { - "val": "show wireless information", + "val": "Show wireless information", "key": "iwconfig" }, { - "val": "scan for wireless networks", + "val": "Scan for wireless networks", "key": "sudo iwlist scan" }, { - "val": "reset network for manual configurations", + "val": "Reset network for manual configurations", "key": "sudo /etc/init.d/networking restart" }, { - "val": "manual configuration", + "val": "Manual configuration", "key": "(file) /etc/network/interfaces" }, { - "val": "bring interface online", + "val": "Bring interface online", "key": "ifup interface" }, { - "val": "disable interface", + "val": "Disable interface", "key": "ifdown interface" }], "Special Packages": [{ - "val": "standard Ubuntu environment", + "val": "Standard Ubuntu environment", "key": "ubuntu-desktop" }, { "val": "KDE desktop", @@ -159,66 +159,66 @@ "val": "XFCE desktop", "key": "xubuntu-desktop" }, { - "val": "core Ubuntu utilities", + "val": "Core Ubuntu utilities", "key": "ubuntu-minimal" }, { - "val": "standard Ubuntu utilities", + "val": "Standard Ubuntu utilities", "key": "ubuntu-standard" }, { - "val": "non-free, but useful", + "val": "Non-free, but useful", "key": "ubuntu-restricted-extras" }, { "val": "KDE of the above", "key": "kubuntu-restricted-extras" }, { - "val": "packages used to compile programs", + "val": "Packages used to compile programs", "key": "xubuntu-restricted-extras" }, { - "val": "latest generic kernel image", + "val": "Latest generic kernel image", "key": "linux-image-generic" }, { - "val": "latest build headers", + "val": "Latest build headers", "key": "linux-headers-generic" }], "Firewall": [{ - "val": "turn on the firewall", + "val": "Turn on the firewall", "key": "ufw enable" }, { - "val": "turn off the firewall", + "val": "Turn off the firewall", "key": "ufw disable" }, { - "val": "allow all connections by default", + "val": "Allow all connections by default", "key": "ufw default allow" }, { - "val": "drop all connections by default", + "val": "Drop all connections by default", "key": "ufw default deny" }, { - "val": "current status and rules", + "val": "Current status and rules", "key": "ufw status" }, { - "val": "allow traffic on port", + "val": "Allow traffic on port", "key": "ufw allow port" }, { - "val": "block port", + "val": "Block port", "key": "ufw deny port" }, { - "val": "block ip adress", + "val": "Block ip adress", "key": "ufw deny from ip" }], "Application Names": [{ - "val": "file manager (GNOME)", + "val": "File manager (GNOME)", "key": "nautilus" }, { - "val": "file manager (KDE)", + "val": "File manager (KDE)", "key": "dolphin" }, { - "val": "web browser (KDE)", + "val": "Web browser (KDE)", "key": "konqueror" }, { - "val": "text editor (KDE)", + "val": "Text editor (KDE)", "key": "kate" }, { - "val": "text editor (GNOME)", + "val": "Text editor (GNOME)", "key": "gedit" }], "System": [{ @@ -226,13 +226,13 @@ "key": "Recovery" }, { - "val": "get Ubuntu version", + "val": "Get Ubuntu version", "key": "lsb_release -a" }, { - "val": "get kernel version", + "val": "Get kernel version", "key": "uname -r" }, { - "val": "get all kernel information", + "val": "Get all kernel information", "key": "uname -a" }] } From a4c55ebf0945d6ca839d50ea8b042972cfa4448a Mon Sep 17 00:00:00 2001 From: mickeypash Date: Thu, 6 Aug 2015 13:42:14 +0000 Subject: [PATCH 011/379] Bulgarian phrases cheat sheet. --- share/goodie/cheat_sheets/bulgarian.json | 232 +++++++++++++++++++++++ 1 file changed, 232 insertions(+) create mode 100644 share/goodie/cheat_sheets/bulgarian.json diff --git a/share/goodie/cheat_sheets/bulgarian.json b/share/goodie/cheat_sheets/bulgarian.json new file mode 100644 index 000000000..e1dac1df2 --- /dev/null +++ b/share/goodie/cheat_sheets/bulgarian.json @@ -0,0 +1,232 @@ +{ + "id" : "bulgarian_cheat_sheet", + "name" : "Bulgarian Cheat Sheet", + "metadata" : { + "sourceName" : "Linguanaut", + "sourceUrl" : "http://www.linguanaut.com/english_bulgarian.htm" + }, + "section_order" : [ + "Basics", + "Getting Help", + "Travelling", + "Etiquette", + "Dinner on the Town" + ], + "description" : "Basic German words and phrases", + "sections" : { + "Etiquette" : [ + { + "val" : "Leka nosht!", + "key" : "Good Night!" + }, + { + "val" : "Dobur den!", + "key" : "Good day!" + }, + { + "val" : "Dobar wecher!", + "key" : "Good Evening!" + }, + { + "val" : "Izvinete.", + "key" : "I'm sorry." + }, + { + "val" : "Blagodaria!", + "key" : "Thank you!" + }, + { + "val" : "Molia.", + "key" : "Please." + }, + { + "val" : "Mnogo blagodaria!", + "key" : "Thank you very much!" + }, + { + "val" : "Dobro utro!", + "key" : "Good Morning!" + }, + { + "val" : "S udovolstvie!", + "key" : "You're welcome!" + } + ], + "Getting Help" : [ + { + "val" : "Viknete Policia!", + "key" : "Call the Police!" + }, + { + "val" : "Govorete po bavno!", + "key" : "Please speak more slowly!" + }, + { + "val" : "Az sum alergichen.", + "key" : "I am allergic." + }, + { + "val" : "Molia, povtorete.", + "key" : "Repeat, please." + }, + { + "val" : "Kak kazvate \"X\" na bulgarski?", + "key" : "How do you say \"X\" in German?" + }, + { + "val" : "Spri!", + "key" : "Stop!" + }, + { + "val" : "Govorite li angliiski?", + "key" : "Do you speak English?" + }, + { + "val" : "Izvinete!", + "key" : "Excuse me!" + }, + { + "val" : "Imam nujda ot lekar!", + "key" : "I need a doctor!" + }, + { + "val" : "Moje li da napishete tova?", + "key" : "Can you write that down?" + }, + { + "val" : "Viknete lineika!", + "key" : "Call an ambulance!" + }, + { + "val" : "Pomosht!", + "key" : "I am in danger!" + }, + { + "val" : "Mojete li da mi pomognete?", + "key" : "Can you help me?" + }, + { + "val" : "Pojar!", + "key" : "Fire!" + } + ], + "Basics" : [ + { + "val" : "Kazvam se...", + "key" : "My name is..." + }, + { + "val" : "Dobre sum, blagodaria!", + "key" : "I'm fine thanks!" + }, + { + "val" : "Kak ste?", + "key" : "How are you?" + }, + { + "val" : "Zdrawei", + "key" : "Hello" + }, + { + "val" : "Dobredo doshli", + "key" : "Welcome" + }, + { + "val" : "Kak se kazvate?", + "key" : "What's your name?" + } + ], + "Travelling" : [ + { + "val" : "Zavii na liavo.", + "key" : "Turn left." + }, + { + "val" : "Kude e izhoda?", + "key" : "Where is the exit?" + }, + { + "val" : "Kude?", + "key" : "Where?" + }, + { + "val" : "Dalech li e?", + "key" : "Is it far?" + }, + { + "val" : "Vurvi pravo napred.", + "key" : "Go straight ahead." + }, + { + "val" : "Imate li karta na grada?", + "key" : "Do you have a city map?" + }, + { + "val" : "Molia sprete tuk.", + "key" : "Stop here please." + }, + { + "val" : "Zavii na diasno.", + "key" : "Turn right." + }, + { + "val" : "Kude moga da nameria taxi?", + "key" : "Where can I find the taxis?" + }, + { + "val" : "Kak moga da vikna taxi?", + "key" : "How can I get a taxi?" + } + ], + "Dinner on the Town" : [ + { + "val" : "Imate li vegeratarianski yastia?", + "key" : "Do you have vegetarian dishes?" + }, + { + "val" : "Osnovno yastie.", + "key" : "Main dish." + }, + { + "val" : "Starter.", + "key" : "Entrée." + }, + { + "val" : "Az sum alergichen.", + "key" : "I am allergic." + }, + { + "val" : "Desert.", + "key" : "Dessert" + }, + { + "val" : "Smetkata, molia!", + "key" : "The check please!" + }, + { + "val" : "Chasha kafe ako moje.", + "key" : "A cup of coffee please." + }, + { + "val" : "Imate li yastia bez gluten?", + "key" : "Do you have gluten-free dishes?" + }, + { + "val" : "Kude ima dobur restorant?", + "key" : "Where is a good restaurant?" + }, + { + "val" : "Chasha voda, molia.", + "key" : "A glass of water please." + }, + { + "val" : "Masa za dvama, molia!", + "key" : "A table for two please!" + }, + { + "val" : "Shte moje li da vidq menu, molia?", + "key" : "Can I get a menu, please?" + } + ] + } +} From a69bbd2e10a49f2ff1f3fdc7bd8d7d362456cd24 Mon Sep 17 00:00:00 2001 From: mickeypash Date: Thu, 6 Aug 2015 14:08:45 +0000 Subject: [PATCH 012/379] Minor change --- share/goodie/cheat_sheets/bulgarian.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/goodie/cheat_sheets/bulgarian.json b/share/goodie/cheat_sheets/bulgarian.json index e1dac1df2..6b783f845 100644 --- a/share/goodie/cheat_sheets/bulgarian.json +++ b/share/goodie/cheat_sheets/bulgarian.json @@ -12,7 +12,7 @@ "Etiquette", "Dinner on the Town" ], - "description" : "Basic German words and phrases", + "description" : "Basic Bulgarian words and phrases", "sections" : { "Etiquette" : [ { From c2337429fb0a7efd711fc9a161673f0fc693eb82 Mon Sep 17 00:00:00 2001 From: mickeypash Date: Thu, 6 Aug 2015 15:00:24 +0000 Subject: [PATCH 013/379] My DuckDuckHack --- lib/DDG/Goodie/IsAwesome/mickeypash.pm | 34 ++++++++++++++++++++++++++ t/IsAwesome/mickeypash.t | 19 ++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 lib/DDG/Goodie/IsAwesome/mickeypash.pm create mode 100644 t/IsAwesome/mickeypash.t diff --git a/lib/DDG/Goodie/IsAwesome/mickeypash.pm b/lib/DDG/Goodie/IsAwesome/mickeypash.pm new file mode 100644 index 000000000..f99b8eb3e --- /dev/null +++ b/lib/DDG/Goodie/IsAwesome/mickeypash.pm @@ -0,0 +1,34 @@ +package DDG::Goodie::IsAwesome::mickeypash; +# ABSTRACT: Write an abstract here +# Start at https://duck.co/duckduckhack/goodie_overview if you are new +# to instant answer development + +use DDG::Goodie; +use strict; + +zci answer_type => "is_awesome_mickeypash"; +zci is_cached => 1; + +# Metadata. See https://duck.co/duckduckhack/metadata for help in filling out this section. +name "IsAwesome mickeypash"; +description "Succinct explanation of what this instant answer does"; +primary_example_queries "first example query", "second example query"; +secondary_example_queries "optional -- demonstrate any additional triggers"; +# Uncomment and complete: https://duck.co/duckduckhack/metadata#category +# category ""; +# Uncomment and complete: https://duck.co/duckduckhack/metadata#topics +# topics ""; +code_url "https://github.com/duckduckgo/zeroclickinfo-goodies/blob/master/lib/DDG/Goodie/IsAwesome/mickeypash.pm"; +attribution github => ["mickeypash", "Mickey Pash"], + twitter => "mickeypash"; + +# Triggers +triggers start => "duckduckhack mickeypash"; + +# Handle statement +handle remainder => sub { + return if $_; + return "mickeypash is awesome and has successfully completed the DuckDuckHack Goodie tutorial!"; +}; + +1; diff --git a/t/IsAwesome/mickeypash.t b/t/IsAwesome/mickeypash.t new file mode 100644 index 000000000..ef8158890 --- /dev/null +++ b/t/IsAwesome/mickeypash.t @@ -0,0 +1,19 @@ +#!/usr/bin/env perl + +use strict; +use warnings; +use Test::More; +use DDG::Test::Goodie; + +zci answer_type => "is_awesome_mickeypash"; +zci is_cached => 1; + +ddg_goodie_test( + [qw( + DDG::Goodie::IsAwesome::mickeypash + )], + 'duckduckhack mickeypash' => test_zci('mickeypash is awesome and has successfully completed the DuckDuckHack Goodie tutorial!'), + 'duckduckhack mickeypash is awesome' => undef, +); + +done_testing; From 6176dd9cf8865d8c728ffc262fb8bf767adb0d4c Mon Sep 17 00:00:00 2001 From: mickeypash Date: Thu, 6 Aug 2015 18:08:47 +0000 Subject: [PATCH 014/379] Fixed issues spotted by @andrey-p for #1369 --- share/goodie/cheat_sheets/bulgarian.json | 48 ++++++++++++------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/share/goodie/cheat_sheets/bulgarian.json b/share/goodie/cheat_sheets/bulgarian.json index 6b783f845..1bf412048 100644 --- a/share/goodie/cheat_sheets/bulgarian.json +++ b/share/goodie/cheat_sheets/bulgarian.json @@ -20,11 +20,11 @@ "key" : "Good Night!" }, { - "val" : "Dobur den!", + "val" : "Dobar den!", "key" : "Good day!" }, { - "val" : "Dobar wecher!", + "val" : "Dobar vecher!", "key" : "Good Evening!" }, { @@ -32,15 +32,15 @@ "key" : "I'm sorry." }, { - "val" : "Blagodaria!", + "val" : "Blagodarya!", "key" : "Thank you!" }, { - "val" : "Molia.", + "val" : "Molya.", "key" : "Please." }, { - "val" : "Mnogo blagodaria!", + "val" : "Mnogo blagodarya!", "key" : "Thank you very much!" }, { @@ -54,7 +54,7 @@ ], "Getting Help" : [ { - "val" : "Viknete Policia!", + "val" : "Viknete Policya!", "key" : "Call the Police!" }, { @@ -66,7 +66,7 @@ "key" : "I am allergic." }, { - "val" : "Molia, povtorete.", + "val" : "Molya, povtorete.", "key" : "Repeat, please." }, { @@ -116,7 +116,7 @@ "key" : "My name is..." }, { - "val" : "Dobre sum, blagodaria!", + "val" : "Dobre sum, blagodarya!", "key" : "I'm fine thanks!" }, { @@ -128,7 +128,7 @@ "key" : "Hello" }, { - "val" : "Dobredo doshli", + "val" : "Dobre doshli", "key" : "Welcome" }, { @@ -138,15 +138,15 @@ ], "Travelling" : [ { - "val" : "Zavii na liavo.", + "val" : "Zavii na lyavo.", "key" : "Turn left." }, { - "val" : "Kude e izhoda?", + "val" : "Kade e izhoda?", "key" : "Where is the exit?" }, { - "val" : "Kude?", + "val" : "Kade?", "key" : "Where?" }, { @@ -154,7 +154,7 @@ "key" : "Is it far?" }, { - "val" : "Vurvi pravo napred.", + "val" : "Varvi pravo napred.", "key" : "Go straight ahead." }, { @@ -162,15 +162,15 @@ "key" : "Do you have a city map?" }, { - "val" : "Molia sprete tuk.", + "val" : "Molya sprete tuk.", "key" : "Stop here please." }, { - "val" : "Zavii na diasno.", + "val" : "Zavii na dyasno.", "key" : "Turn right." }, { - "val" : "Kude moga da nameria taxi?", + "val" : "Kade moga da namerya taxi?", "key" : "Where can I find the taxis?" }, { @@ -180,8 +180,8 @@ ], "Dinner on the Town" : [ { - "val" : "Imate li vegeratarianski yastia?", - "key" : "Do you have vegetarian dishes?" + "val" : "Imate li vegerataryanski yastya?", + "key" : "Do you have vegetaryan dishes?" }, { "val" : "Osnovno yastie.", @@ -200,7 +200,7 @@ "key" : "Dessert" }, { - "val" : "Smetkata, molia!", + "val" : "Smetkata, molya!", "key" : "The check please!" }, { @@ -208,23 +208,23 @@ "key" : "A cup of coffee please." }, { - "val" : "Imate li yastia bez gluten?", + "val" : "Imate li yastya bez gluten?", "key" : "Do you have gluten-free dishes?" }, { - "val" : "Kude ima dobur restorant?", + "val" : "Kade ima dobar restorant?", "key" : "Where is a good restaurant?" }, { - "val" : "Chasha voda, molia.", + "val" : "Chasha voda, molya.", "key" : "A glass of water please." }, { - "val" : "Masa za dvama, molia!", + "val" : "Masa za dvama, molya!", "key" : "A table for two please!" }, { - "val" : "Shte moje li da vidq menu, molia?", + "val" : "Shte moje li da vidya menu, molya?", "key" : "Can I get a menu, please?" } ] From 53e040940a35f898373295d5a7da63dac441eb79 Mon Sep 17 00:00:00 2001 From: Sagar Hani Date: Sat, 29 Aug 2015 15:47:32 +0530 Subject: [PATCH 015/379] Added aliases Added aliases --- share/goodie/cheat_sheets/ubuntu.json | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/share/goodie/cheat_sheets/ubuntu.json b/share/goodie/cheat_sheets/ubuntu.json index 668538b86..536a70052 100644 --- a/share/goodie/cheat_sheets/ubuntu.json +++ b/share/goodie/cheat_sheets/ubuntu.json @@ -1,11 +1,14 @@ { - "id": "ubuntu_cheat_sheet", - "name": "Ubuntu", - "description": "Ubuntu Reference", + "id": "ubuntu_unity_cheat_sheet", + "name": "Ubuntu Unity Cheat Sheet", + "description": "Ubuntu Unity Reference", "metadata": { - "sourceName": "Ubuntu", + "sourceName": "Ubuntu Unity", "sourceUrl": "http://www.cheat-sheets.org/saved-copy/ubunturef.pdf" }, + "aliases": [ + "ubuntu unity", "unity ubuntu cheat sheet", "unity ubuntu" + ], "section_order": [ "Privileges", "Display", From ae2db1925dd680d1b398fd8933c2afaf21bba378 Mon Sep 17 00:00:00 2001 From: alohaas Date: Sat, 29 Aug 2015 18:11:50 -0400 Subject: [PATCH 016/379] added new links template type, added new nodejs tutorials cheat sheet. resolves #1476 --- share/goodie/cheat_sheets/cheat_sheets.css | 9 +- .../cheat_sheets/json/nodejs-tutorials.json | 308 ++++++++++++++++++ share/goodie/cheat_sheets/links.handlebars | 7 + 3 files changed, 321 insertions(+), 3 deletions(-) create mode 100644 share/goodie/cheat_sheets/json/nodejs-tutorials.json create mode 100644 share/goodie/cheat_sheets/links.handlebars diff --git a/share/goodie/cheat_sheets/cheat_sheets.css b/share/goodie/cheat_sheets/cheat_sheets.css index 4ba410bb0..532e44b7d 100644 --- a/share/goodie/cheat_sheets/cheat_sheets.css +++ b/share/goodie/cheat_sheets/cheat_sheets.css @@ -78,19 +78,22 @@ /* reference-sheet.handlebars */ -.zci--cheat_sheets .reference ul { +.zci--cheat_sheets .reference ul, +.zci--cheat_sheets .links ul { padding: 0; margin-left: 13px; } -.zci--cheat_sheets .reference li { +.zci--cheat_sheets .reference li, +.zci--cheat_sheets .links li { position: relative; padding-bottom: 12px; padding-left: 7px; line-height: 17px; } -.zci--cheat_sheets .reference li::before { +.zci--cheat_sheets .reference li::before, +.zci--cheat_sheets .links li::before { position: absolute; left: -12px; content: '●'; diff --git a/share/goodie/cheat_sheets/json/nodejs-tutorials.json b/share/goodie/cheat_sheets/json/nodejs-tutorials.json new file mode 100644 index 000000000..07ccba7d6 --- /dev/null +++ b/share/goodie/cheat_sheets/json/nodejs-tutorials.json @@ -0,0 +1,308 @@ +{ + "id": "nodejs_tutorials_cheat_sheet", + "name": "Node.js Tutorials", + "description": "A list of helpful resources for getting started with Node.js", + "metadata": { + "sourceName": "Stack Overflow", + "sourceUrl": "https://stackoverflow.com/questions/2353818/how-do-i-get-started-with-node-js" + }, + "aliases":["nodejs tutorials", "node tutorials", "node.js tutorials"], + "template_type": "links", + "section_order": [ + "Tutorials", + "Developer Sites", + "Videos", + "Screencasts", + "Books", + "Courses", + "Blogs", + "Podcasts", + "JavaScript Resources", + "Node.js Modules", + "Other" + ], + "sections": { + "Tutorials": [ + { + "val": "http://nodeschool.io/", + "key": "NodeSchool.io" + }, + { + "val": "https://github.com/maxogden/art-of-node/#the-art-of-node", + "key": "The Art of Node" + }, + { + "val": "http://node.blog.com/2014/12/29/hello-world-with-node-and-express/", + "key": "Hello World Example" + }, + { + "val": "http://www.nodebeginner.org/#hello-world", + "key": "Hello World" + }, + { + "val": "http://www.nodebeginner.org/#building-the-application-stack", + "key": "Hellow World Web Server" + }, + { + "val": "http://nodeguide.com/", + "key": "Node.js Guide" + }, + { + "val": "http://howtonode.org/express-mongodb", + "key": "Build a blog with Node.js, express and MongoDB" + }, + { + "val": "http://project70.com/", + "key": "Node.Js Tutorials At Project 70" + }, + { + "val": "http://net.tutsplus.com/tutorials/javascript-ajax/node-js-for-beginners/", + "key": "Node.js for Beginners" + }, + { + "val": "http://javascriptissexy.com/learn-node-js-completely-and-with-confidence/", + "key": "Learn Node.js Completely and with Confidence" + }, + { + "val": "http://blog.modulus.io/absolute-beginners-guide-to-nodejs", + "key": "Absolute Beginners Guide To Node.js" + } + ], + "Developer Sites": [ + { + "val": "http://www.joyent.com/developers/node", + "key": "Joyent's developer site for node" + } + ], + "Videos": [ + { + "val": "http://nodetuts.com/", + "key": "Node tuts" + }, + { + "val": "http://www.youtube.com/watch?v=jo_B4LTHi3I", + "key": "Introduction to Node.js with the author of the languag, Ryan Dahl" + }, + { + "val": "http://www.infoq.com/presentations/nodejs", + "key": "Node.js: Asynchronous Purity Leads to Faster Development" + }, + { + "val": "http://www.infoq.com/presentations/Parallel-Programming-with-Nodejs", + "key": "Parallel Programming with Node.js" + }, + { + "val": "http://vimeo.com/18077379", + "key": "Server-side JavaScript with Node, Connect & Express" + }, + { + "val": "http://www.lynda.com/Nodejs-tutorials/Nodejs-First-Look/101554-2.html", + "key": "Node.js First Look" + }, + { + "val": "http://www.youtube.com/watch?v=0_GNHWZHc-o", + "key": "Node.js with MongoDB" + }, + { + "val": "http://www.youtube.com/watch?v=F6k8lTrAE2g", + "key": "Ryan Dahl's Google Tech Talk" + }, + { + "val": "http://node.codeschool.com/levels/1", + "key": "Real Time Web with Node.js" + }, + { + "val": "https://www.youtube.com/playlist?list=PL6gx4Cwl9DGBMdkKFn3HasZnnAqVjzHn_", + "key": "Node.js Tutorials for Beginners" + }, + { + "val": "http://www.pluralsight.com/search/?searchTerm=Node.js", + "key": "Pluralsight courses (paid)" + } + ], + "Screencasts": [ + { + "val": "http://learnallthenodes.com/", + "key": "Learn All the Nodes" + }, + { + "val": "http://nodetuts.com/", + "key": "NodeTuts" + }, + { + "val": "http://nodecasts.net/", + "key": "NodeCasts" + }, + { + "val": "http://www.develop.com/webcasts/watch/5318c4d5d588bf08c461f4b1/create-server-side-mvc-apps-with-node-js-and-express", + "key": "Create server-side MVC apps with Node.js and Express" + } + ], + "Books": [ + { + "val": "http://nodebeginner.org/", + "key": "The Node Beginner Book" + }, + { + "val": "https://github.com/tj/masteringnode", + "key": "Mastering Node.js" + }, + { + "val": "http://chimera.labs.oreilly.com/books/1234000001808/index.html", + "key": "Up and Running with Node.js" + }, + { + "val": "http://www.manning.com/cantelon/", + "key": "Node.js in Action" + }, + { + "val": "http://amzn.com/B008Z5OEUY", + "key": "Smashing Node.js: JavaScript Everywhere" + }, + { + "val": "http://www.amazon.de/dp/389864829X", + "key": "Node.js & Co. (in German)" + }, + { + "val": "http://nodejsbook.io/", + "key": "Sam's Teach Yourself Node.js in 24 Hours" + }, + { + "val": "http://jsbooks.revolunet.com/", + "key": "A detailed list of free JavaScript Books" + }, + { + "val": "http://book.mixu.net/node/index.html", + "key": "Mixu's Node Book" + }, + { + "val": "http://pragprog.com/book/jwnode/node-js-the-right-way", + "key": "Node.js the Right Way: Practical, Server-Side JavaScript That Scale" + }, + { + "val": "https://leanpub.com/webdevelopmentwithnodejs", + "key": "Beginning Web Development with Node.js" + }, + { + "val": "http://www.packtpub.com/node-javascript-web-development/book", + "key": "Node Web Development" + }, + { + "val": "http://nicholasjohnson.com/courses/nodejs/book", + "key": "NodeJS for Righteous Universal Domination!" + } + ], + "Courses": [ + { + "val": "http://node.codeschool.com/", + "key": "Real Time Web with Node.js" + }, + { + "val": "http://www.develop.com/training-course/nodejs-featuring-node-npm-express-mocha-mongodb-with-mongoose", + "key": "Essential Node.js from DevelopMentor" + } + ], + "Blogs": [ + { + "val": "http://blog.nodejs.org/", + "key": "The Node.js blog" + }, + { + "val": "http://howtonode.org/", + "key": "How to Node" + }, + { + "val": "http://dailyjs.com/", + "key": "DailyJS" + }, + { + "val": "http://blog.nodejitsu.com/", + "key": "Nodejitsu blog" + }, + { + "val": "http://www.wilcoxd.com/whitepapers/node_js/", + "key": "Ryan Wilcox's Whitepaper" + }, + { + "val": "http://www.devthought.com/", + "key": "devthought" + } + ], + "Podcasts": [ + { + "val": "http://nodeup.com/", + "key": "NodeUp" + } + ], + "JavaScript Resources": [ + { + "val": "http://yuiblog.com/crockford/", + "key": "Douglas Crockford's videos" + }, + { + "val": "http://www.addyosmani.com/resources/essentialjsdesignpatterns/book/", + "key": "Essential JavaScript Design Patterns For Beginners" + }, + { + "val": "http://bonsaiden.github.com/JavaScript-Garden/", + "key": "JavaScript garden" + }, + { + "val": "http://oreilly.com/catalog/9780596806767", + "key": "Javascript Patterns" + }, + { + "val": "http://oreilly.com/catalog/9780596517748/", + "key": "JavaScript: The Good Parts" + } + ], + "Node.js Modules": [ + { + "val": "http://npmjs.org/", + "key": "Search for registered Node.js modules" + }, + { + "val": "http://www.freshblurbs.com/articles/important-node-js-modules.html", + "key": "Useful, yet biased and incomplete, selection of Node.js modules" + }, + { + "val": "https://github.com/joyent/node/wiki/modules", + "key": "Wiki List on GitHub/Joyent/Node.js " + } + ], + "Other": [ + { + "val": "http://jsapp.us/", + "key": "JSApp.US - like jsfiddle, but for Node.js" + }, + { + "val": "https://www.ebayopensource.org/index.php/VJET/NodeJS", + "key": "Node with VJET JS (for Eclipse IDE)" + }, + { + "val": "http://coding.smashingmagazine.com/2011/09/16/useful-node-js-tools-tutorials-and-resources/", + "key": "Useful Node.js Tools, Tutorials and Resources" + }, + { + "val": "http://runnable.com/", + "key": "Runnable.com - like jsfiddle, but for server side as well" + }, + { + "val": "https://devcenter.heroku.com/categories/nodejs", + "key": "Getting Started with Node.js on Heroku" + }, + { + "val": "https://blog.openshift.com/run-your-nodejs-projects-on-openshift-in-two-simple-steps/", + "key": "Getting Started with Node.js on Open-Shift" + }, + { + "val": "http://passportjs.org/guide/", + "key": "Authentication using the Passport Module" + }, + { + "val": "http://apostrophenow.org/", + "key": "In-Context, Open Source CMS built in Node.js" + } + ] + } + } diff --git a/share/goodie/cheat_sheets/links.handlebars b/share/goodie/cheat_sheets/links.handlebars new file mode 100644 index 000000000..6856916ab --- /dev/null +++ b/share/goodie/cheat_sheets/links.handlebars @@ -0,0 +1,7 @@ +
    + {{#each items}} +
  • + {{key}} +
  • + {{/each}} +
From 45238d0d8e379370b684b326326d7aecdc88049d Mon Sep 17 00:00:00 2001 From: alohaas Date: Sat, 29 Aug 2015 19:01:03 -0400 Subject: [PATCH 017/379] inactive link removed, fixed typo, resolves #1483 --- share/goodie/cheat_sheets/json/nodejs-tutorials.json | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/share/goodie/cheat_sheets/json/nodejs-tutorials.json b/share/goodie/cheat_sheets/json/nodejs-tutorials.json index 07ccba7d6..f702395c6 100644 --- a/share/goodie/cheat_sheets/json/nodejs-tutorials.json +++ b/share/goodie/cheat_sheets/json/nodejs-tutorials.json @@ -24,8 +24,8 @@ "sections": { "Tutorials": [ { - "val": "http://nodeschool.io/", - "key": "NodeSchool.io" + "val": "http://nodeschool.io/", + "key": "NodeSchool.io" }, { "val": "https://github.com/maxogden/art-of-node/#the-art-of-node", @@ -41,7 +41,7 @@ }, { "val": "http://www.nodebeginner.org/#building-the-application-stack", - "key": "Hellow World Web Server" + "key": "Hello World Web Server" }, { "val": "http://nodeguide.com/", @@ -51,10 +51,6 @@ "val": "http://howtonode.org/express-mongodb", "key": "Build a blog with Node.js, express and MongoDB" }, - { - "val": "http://project70.com/", - "key": "Node.Js Tutorials At Project 70" - }, { "val": "http://net.tutsplus.com/tutorials/javascript-ajax/node-js-for-beginners/", "key": "Node.js for Beginners" From b06c78eebc447b371cf254fdbb3700b765339407 Mon Sep 17 00:00:00 2001 From: alohaas Date: Thu, 10 Sep 2015 19:55:17 -0400 Subject: [PATCH 018/379] little refactor --- share/goodie/cheat_sheets/cheat_sheets.css | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/share/goodie/cheat_sheets/cheat_sheets.css b/share/goodie/cheat_sheets/cheat_sheets.css index 09d1385bb..07a855100 100644 --- a/share/goodie/cheat_sheets/cheat_sheets.css +++ b/share/goodie/cheat_sheets/cheat_sheets.css @@ -52,13 +52,14 @@ width: 100%; } - .zci--cheat_sheets .terminal td { padding-bottom: 12px; } .zci--cheat_sheets .terminal code { width: 100%; + white-space: break-all; + word-break: break-all; } .zci--cheat_sheets .terminal td.cheatsheet__key { From c1cfd20fa8f07bc3f115ab7bacf24ab145ffbb39 Mon Sep 17 00:00:00 2001 From: alohaas Date: Thu, 10 Sep 2015 20:01:02 -0400 Subject: [PATCH 019/379] removed link template and node-tutorial cheat sheet --- .../cheat_sheets/json/nodejs-tutorials.json | 304 ------------------ share/goodie/cheat_sheets/links.handlebars | 7 - 2 files changed, 311 deletions(-) delete mode 100644 share/goodie/cheat_sheets/json/nodejs-tutorials.json delete mode 100644 share/goodie/cheat_sheets/links.handlebars diff --git a/share/goodie/cheat_sheets/json/nodejs-tutorials.json b/share/goodie/cheat_sheets/json/nodejs-tutorials.json deleted file mode 100644 index f702395c6..000000000 --- a/share/goodie/cheat_sheets/json/nodejs-tutorials.json +++ /dev/null @@ -1,304 +0,0 @@ -{ - "id": "nodejs_tutorials_cheat_sheet", - "name": "Node.js Tutorials", - "description": "A list of helpful resources for getting started with Node.js", - "metadata": { - "sourceName": "Stack Overflow", - "sourceUrl": "https://stackoverflow.com/questions/2353818/how-do-i-get-started-with-node-js" - }, - "aliases":["nodejs tutorials", "node tutorials", "node.js tutorials"], - "template_type": "links", - "section_order": [ - "Tutorials", - "Developer Sites", - "Videos", - "Screencasts", - "Books", - "Courses", - "Blogs", - "Podcasts", - "JavaScript Resources", - "Node.js Modules", - "Other" - ], - "sections": { - "Tutorials": [ - { - "val": "http://nodeschool.io/", - "key": "NodeSchool.io" - }, - { - "val": "https://github.com/maxogden/art-of-node/#the-art-of-node", - "key": "The Art of Node" - }, - { - "val": "http://node.blog.com/2014/12/29/hello-world-with-node-and-express/", - "key": "Hello World Example" - }, - { - "val": "http://www.nodebeginner.org/#hello-world", - "key": "Hello World" - }, - { - "val": "http://www.nodebeginner.org/#building-the-application-stack", - "key": "Hello World Web Server" - }, - { - "val": "http://nodeguide.com/", - "key": "Node.js Guide" - }, - { - "val": "http://howtonode.org/express-mongodb", - "key": "Build a blog with Node.js, express and MongoDB" - }, - { - "val": "http://net.tutsplus.com/tutorials/javascript-ajax/node-js-for-beginners/", - "key": "Node.js for Beginners" - }, - { - "val": "http://javascriptissexy.com/learn-node-js-completely-and-with-confidence/", - "key": "Learn Node.js Completely and with Confidence" - }, - { - "val": "http://blog.modulus.io/absolute-beginners-guide-to-nodejs", - "key": "Absolute Beginners Guide To Node.js" - } - ], - "Developer Sites": [ - { - "val": "http://www.joyent.com/developers/node", - "key": "Joyent's developer site for node" - } - ], - "Videos": [ - { - "val": "http://nodetuts.com/", - "key": "Node tuts" - }, - { - "val": "http://www.youtube.com/watch?v=jo_B4LTHi3I", - "key": "Introduction to Node.js with the author of the languag, Ryan Dahl" - }, - { - "val": "http://www.infoq.com/presentations/nodejs", - "key": "Node.js: Asynchronous Purity Leads to Faster Development" - }, - { - "val": "http://www.infoq.com/presentations/Parallel-Programming-with-Nodejs", - "key": "Parallel Programming with Node.js" - }, - { - "val": "http://vimeo.com/18077379", - "key": "Server-side JavaScript with Node, Connect & Express" - }, - { - "val": "http://www.lynda.com/Nodejs-tutorials/Nodejs-First-Look/101554-2.html", - "key": "Node.js First Look" - }, - { - "val": "http://www.youtube.com/watch?v=0_GNHWZHc-o", - "key": "Node.js with MongoDB" - }, - { - "val": "http://www.youtube.com/watch?v=F6k8lTrAE2g", - "key": "Ryan Dahl's Google Tech Talk" - }, - { - "val": "http://node.codeschool.com/levels/1", - "key": "Real Time Web with Node.js" - }, - { - "val": "https://www.youtube.com/playlist?list=PL6gx4Cwl9DGBMdkKFn3HasZnnAqVjzHn_", - "key": "Node.js Tutorials for Beginners" - }, - { - "val": "http://www.pluralsight.com/search/?searchTerm=Node.js", - "key": "Pluralsight courses (paid)" - } - ], - "Screencasts": [ - { - "val": "http://learnallthenodes.com/", - "key": "Learn All the Nodes" - }, - { - "val": "http://nodetuts.com/", - "key": "NodeTuts" - }, - { - "val": "http://nodecasts.net/", - "key": "NodeCasts" - }, - { - "val": "http://www.develop.com/webcasts/watch/5318c4d5d588bf08c461f4b1/create-server-side-mvc-apps-with-node-js-and-express", - "key": "Create server-side MVC apps with Node.js and Express" - } - ], - "Books": [ - { - "val": "http://nodebeginner.org/", - "key": "The Node Beginner Book" - }, - { - "val": "https://github.com/tj/masteringnode", - "key": "Mastering Node.js" - }, - { - "val": "http://chimera.labs.oreilly.com/books/1234000001808/index.html", - "key": "Up and Running with Node.js" - }, - { - "val": "http://www.manning.com/cantelon/", - "key": "Node.js in Action" - }, - { - "val": "http://amzn.com/B008Z5OEUY", - "key": "Smashing Node.js: JavaScript Everywhere" - }, - { - "val": "http://www.amazon.de/dp/389864829X", - "key": "Node.js & Co. (in German)" - }, - { - "val": "http://nodejsbook.io/", - "key": "Sam's Teach Yourself Node.js in 24 Hours" - }, - { - "val": "http://jsbooks.revolunet.com/", - "key": "A detailed list of free JavaScript Books" - }, - { - "val": "http://book.mixu.net/node/index.html", - "key": "Mixu's Node Book" - }, - { - "val": "http://pragprog.com/book/jwnode/node-js-the-right-way", - "key": "Node.js the Right Way: Practical, Server-Side JavaScript That Scale" - }, - { - "val": "https://leanpub.com/webdevelopmentwithnodejs", - "key": "Beginning Web Development with Node.js" - }, - { - "val": "http://www.packtpub.com/node-javascript-web-development/book", - "key": "Node Web Development" - }, - { - "val": "http://nicholasjohnson.com/courses/nodejs/book", - "key": "NodeJS for Righteous Universal Domination!" - } - ], - "Courses": [ - { - "val": "http://node.codeschool.com/", - "key": "Real Time Web with Node.js" - }, - { - "val": "http://www.develop.com/training-course/nodejs-featuring-node-npm-express-mocha-mongodb-with-mongoose", - "key": "Essential Node.js from DevelopMentor" - } - ], - "Blogs": [ - { - "val": "http://blog.nodejs.org/", - "key": "The Node.js blog" - }, - { - "val": "http://howtonode.org/", - "key": "How to Node" - }, - { - "val": "http://dailyjs.com/", - "key": "DailyJS" - }, - { - "val": "http://blog.nodejitsu.com/", - "key": "Nodejitsu blog" - }, - { - "val": "http://www.wilcoxd.com/whitepapers/node_js/", - "key": "Ryan Wilcox's Whitepaper" - }, - { - "val": "http://www.devthought.com/", - "key": "devthought" - } - ], - "Podcasts": [ - { - "val": "http://nodeup.com/", - "key": "NodeUp" - } - ], - "JavaScript Resources": [ - { - "val": "http://yuiblog.com/crockford/", - "key": "Douglas Crockford's videos" - }, - { - "val": "http://www.addyosmani.com/resources/essentialjsdesignpatterns/book/", - "key": "Essential JavaScript Design Patterns For Beginners" - }, - { - "val": "http://bonsaiden.github.com/JavaScript-Garden/", - "key": "JavaScript garden" - }, - { - "val": "http://oreilly.com/catalog/9780596806767", - "key": "Javascript Patterns" - }, - { - "val": "http://oreilly.com/catalog/9780596517748/", - "key": "JavaScript: The Good Parts" - } - ], - "Node.js Modules": [ - { - "val": "http://npmjs.org/", - "key": "Search for registered Node.js modules" - }, - { - "val": "http://www.freshblurbs.com/articles/important-node-js-modules.html", - "key": "Useful, yet biased and incomplete, selection of Node.js modules" - }, - { - "val": "https://github.com/joyent/node/wiki/modules", - "key": "Wiki List on GitHub/Joyent/Node.js " - } - ], - "Other": [ - { - "val": "http://jsapp.us/", - "key": "JSApp.US - like jsfiddle, but for Node.js" - }, - { - "val": "https://www.ebayopensource.org/index.php/VJET/NodeJS", - "key": "Node with VJET JS (for Eclipse IDE)" - }, - { - "val": "http://coding.smashingmagazine.com/2011/09/16/useful-node-js-tools-tutorials-and-resources/", - "key": "Useful Node.js Tools, Tutorials and Resources" - }, - { - "val": "http://runnable.com/", - "key": "Runnable.com - like jsfiddle, but for server side as well" - }, - { - "val": "https://devcenter.heroku.com/categories/nodejs", - "key": "Getting Started with Node.js on Heroku" - }, - { - "val": "https://blog.openshift.com/run-your-nodejs-projects-on-openshift-in-two-simple-steps/", - "key": "Getting Started with Node.js on Open-Shift" - }, - { - "val": "http://passportjs.org/guide/", - "key": "Authentication using the Passport Module" - }, - { - "val": "http://apostrophenow.org/", - "key": "In-Context, Open Source CMS built in Node.js" - } - ] - } - } diff --git a/share/goodie/cheat_sheets/links.handlebars b/share/goodie/cheat_sheets/links.handlebars deleted file mode 100644 index 6856916ab..000000000 --- a/share/goodie/cheat_sheets/links.handlebars +++ /dev/null @@ -1,7 +0,0 @@ -
    - {{#each items}} -
  • - {{key}} -
  • - {{/each}} -
From 52d52377204de9fabc10a7089e625c4c803018e0 Mon Sep 17 00:00:00 2001 From: alohaas Date: Mon, 28 Sep 2015 14:00:24 -0400 Subject: [PATCH 020/379] added new links template for cheat sheets --- share/goodie/cheat_sheets/links.handlebars | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 share/goodie/cheat_sheets/links.handlebars diff --git a/share/goodie/cheat_sheets/links.handlebars b/share/goodie/cheat_sheets/links.handlebars new file mode 100644 index 000000000..6856916ab --- /dev/null +++ b/share/goodie/cheat_sheets/links.handlebars @@ -0,0 +1,7 @@ +
    + {{#each items}} +
  • + {{key}} +
  • + {{/each}} +
From ab412fca69395015a5197a816613a9b9077f30d3 Mon Sep 17 00:00:00 2001 From: ilv Date: Thu, 1 Oct 2015 15:11:47 +0000 Subject: [PATCH 021/379] Adapted to new template. Also removed the link to Tor2web. --- lib/DDG/Goodie/OnionAddress.pm | 30 ++++- t/OnionAddress.t | 193 +++++++++++++++++++++++++-------- 2 files changed, 170 insertions(+), 53 deletions(-) diff --git a/lib/DDG/Goodie/OnionAddress.pm b/lib/DDG/Goodie/OnionAddress.pm index 82b91b1a6..db4baa5e5 100644 --- a/lib/DDG/Goodie/OnionAddress.pm +++ b/lib/DDG/Goodie/OnionAddress.pm @@ -1,5 +1,5 @@ package DDG::Goodie::OnionAddress; -# ABSTRACT: Provide quick access to HTTP onion services. +# ABSTRACT: Recognize a web onion service address use strict; use DDG::Goodie; @@ -9,14 +9,14 @@ zci answer_type => "onion_address"; primary_example_queries '3g2upl4pq6kufc4m.onion'; secondary_example_queries 'How do I access https://3g2upl4pq6kufc4m.onion:81/?q=dont+track+us?'; -description 'Provide quick access to HTTP onion services'; +description 'Recognize a web onion service address'; name 'OnionAddress'; code_url 'https://github.com/duckduckgo/zeroclickinfo-goodies/blob/master/lib/DDG/Goodie/OnionAddress.pm'; category 'reference'; topics 'special_interest', 'cryptography'; attribution email => 'ilv@torproject.org'; -# regex to detect an onion address +# regex to detect an onion service address # this cover several cases, including addresses with ports and/or paths # e.g. https://3g2upl4pq6kufc4m.onion:5000/?q=dont+track+us my $onion_address_qr = qr/(\w+:\/\/)?([a-z0-9]{16})\.onion(:\d+)?(\/.*)?/; @@ -29,9 +29,29 @@ handle query_lc => sub { # we only accept queries for web onion services # we also assume that an onion service without protocol:// should be web - return unless !$1 or $1 eq 'https://' or $1 eq 'http://' or $2; - return $2, html => "
Access $2.onion using the Tor Browser or via Tor2web.
"; + return unless !$1 or ($1 eq 'https://' or $1 eq 'http://' and $2); + my $plaintext = $2.'.onion'; + return $plaintext, + structured_answer => { + id => 'onion_address', + name => 'OnionAddress', + data => { + title => $2.'.onion', + subtitle => 'Onion/Hidden service', + description => 'You are trying to reach an onion/hidden service. To access '.$2.'.onion via web you will have to use the Tor Browser.' + }, + meta => { + sourceName => "Tor Project", + sourceUrl => "https://www.torproject.org/projects/torbrowser.html.en#downloads" + }, + templates => { + group => 'text', + options => { + moreAt => 1 + } + } + }; }; 1; diff --git a/t/OnionAddress.t b/t/OnionAddress.t index 88a4032a9..e64c55693 100644 --- a/t/OnionAddress.t +++ b/t/OnionAddress.t @@ -5,69 +5,166 @@ use warnings; use Test::More; use DDG::Test::Goodie; +use URI::Escape; zci answer_type => 'onion_address'; -zci is_cached => 1; +zci is_cached => 1; + ddg_goodie_test( [ 'DDG::Goodie::OnionAddress' ], + 'https://3g2upl4pq6kufc4m.onion' => - test_zci( - '3g2upl4pq6kufc4m', - html => "
Access 3g2upl4pq6kufc4m.onion using the Tor Browser or via Tor2web.
" - ), + test_zci( + '3g2upl4pq6kufc4m.onion', + make_structured_answer( + "3g2upl4pq6kufc4m.onion", + "Onion/Hidden service", + "You are trying to reach an onion/hidden service. To access 3g2upl4pq6kufc4m.onion via web you will have to use the Tor Browser.", + "https://www.torproject.org/projects/torbrowser.html.en#downloads", + ) + ), + 'How to access https://3g2upl4pq6kufc4m.onion?' => - test_zci( - '3g2upl4pq6kufc4m', - html => "
Access 3g2upl4pq6kufc4m.onion using the Tor Browser or via Tor2web.
" - ), - 'How to access 3g2upl4pq6kufc4m.onion/?q=dont+track+us' => - test_zci( - '3g2upl4pq6kufc4m', - html => "
Access 3g2upl4pq6kufc4m.onion using the Tor Browser or via Tor2web.
" - ), + test_zci( + '3g2upl4pq6kufc4m.onion', + make_structured_answer( + "3g2upl4pq6kufc4m.onion", + "Onion/Hidden service", + "You are trying to reach an onion/hidden service. To access 3g2upl4pq6kufc4m.onion via web you will have to use the Tor Browser.", + "https://www.torproject.org/projects/torbrowser.html.en#downloads", + ) + ), + + '3g2upl4pq6kufc4m.onion/?q=dont+track+us' => + test_zci( + '3g2upl4pq6kufc4m.onion', + make_structured_answer( + "3g2upl4pq6kufc4m.onion", + "Onion/Hidden service", + "You are trying to reach an onion/hidden service. To access 3g2upl4pq6kufc4m.onion via web you will have to use the Tor Browser.", + "https://www.torproject.org/projects/torbrowser.html.en#downloads", + ) + ), + 'How to access https://3g2upl4pq6kufc4m.onion/privacy?' => - test_zci( - '3g2upl4pq6kufc4m', - html => "
Access 3g2upl4pq6kufc4m.onion using the Tor Browser or via Tor2web.
" - ), + test_zci( + '3g2upl4pq6kufc4m.onion', + make_structured_answer( + "3g2upl4pq6kufc4m.onion", + "Onion/Hidden service", + "You are trying to reach an onion/hidden service. To access 3g2upl4pq6kufc4m.onion via web you will have to use the Tor Browser.", + "https://www.torproject.org/projects/torbrowser.html.en#downloads", + ) + ), + 'How to access 3g2upl4pq6kufc4m.onion/anti-censorship/?' => - test_zci( - '3g2upl4pq6kufc4m', - html => "
Access 3g2upl4pq6kufc4m.onion using the Tor Browser or via Tor2web.
" - ), + test_zci( + '3g2upl4pq6kufc4m.onion', + make_structured_answer( + "3g2upl4pq6kufc4m.onion", + "Onion/Hidden service", + "You are trying to reach an onion/hidden service. To access 3g2upl4pq6kufc4m.onion via web you will have to use the Tor Browser.", + "https://www.torproject.org/projects/torbrowser.html.en#downloads", + ) + ), + 'http://3g2upl4pq6kufc4m.onion' => - test_zci( - '3g2upl4pq6kufc4m', - html => "
Access 3g2upl4pq6kufc4m.onion using the Tor Browser or via Tor2web.
" - ), - 'https://0123456789abcdef.onion/' => - test_zci( - '0123456789abcdef', - html => "
Access 0123456789abcdef.onion using the Tor Browser or via Tor2web.
" - ), + test_zci( + '3g2upl4pq6kufc4m.onion', + make_structured_answer( + "3g2upl4pq6kufc4m.onion", + "Onion/Hidden service", + "You are trying to reach an onion/hidden service. To access 3g2upl4pq6kufc4m.onion via web you will have to use the Tor Browser.", + "https://www.torproject.org/projects/torbrowser.html.en#downloads", + ) + ), + + 'https://0123456789abcdef.onion' => + test_zci( + '0123456789abcdef.onion', + make_structured_answer( + "0123456789abcdef.onion", + "Onion/Hidden service", + "You are trying to reach an onion/hidden service. To access 0123456789abcdef.onion via web you will have to use the Tor Browser.", + "https://www.torproject.org/projects/torbrowser.html.en#downloads", + ) + ), + '0123456789abcdef.onion:123/' => - test_zci( - '0123456789abcdef', - html => "
Access 0123456789abcdef.onion using the Tor Browser or via Tor2web.
" - ), + test_zci( + '0123456789abcdef.onion', + make_structured_answer( + "0123456789abcdef.onion", + "Onion/Hidden service", + "You are trying to reach an onion/hidden service. To access 0123456789abcdef.onion via web you will have to use the Tor Browser.", + "https://www.torproject.org/projects/torbrowser.html.en#downloads", + ) + ), + 'https://0123456789abcdef.onion:5000/about-us' => - test_zci( - '0123456789abcdef', - html => "
Access 0123456789abcdef.onion using the Tor Browser or via Tor2web.
" - ), + test_zci( + '0123456789abcdef.onion', + make_structured_answer( + "0123456789abcdef.onion", + "Onion/Hidden service", + "You are trying to reach an onion/hidden service. To access 0123456789abcdef.onion via web you will have to use the Tor Browser.", + "https://www.torproject.org/projects/torbrowser.html.en#downloads", + ) + ), + 'http://0000000000000000.onion/' => - test_zci( - '0000000000000000', - html => "
Access 0000000000000000.onion using the Tor Browser or via Tor2web.
" - ), + test_zci( + '0000000000000000.onion', + make_structured_answer( + "0000000000000000.onion", + "Onion/Hidden service", + "You are trying to reach an onion/hidden service. To access 0000000000000000.onion via web you will have to use the Tor Browser.", + "https://www.torproject.org/projects/torbrowser.html.en#downloads", + ) + ), + 'what is aaaaaaaaaaaaaaaa.onion?' => - test_zci( - 'aaaaaaaaaaaaaaaa', - html => "
Access aaaaaaaaaaaaaaaa.onion using the Tor Browser or via Tor2web.
" - ), + test_zci( + 'aaaaaaaaaaaaaaaa.onion', + make_structured_answer( + "aaaaaaaaaaaaaaaa.onion", + "Onion/Hidden service", + "You are trying to reach an onion/hidden service. To access aaaaaaaaaaaaaaaa.onion via web you will have to use the Tor Browser.", + "https://www.torproject.org/projects/torbrowser.html.en#downloads", + ) + ), + + 'ftp://3g2upl4pq6kufc4m.onion' => undef, + 'ssh://3g2upl4pq6kufc4m.onion' => undef, + 'irc://3g2upl4pq6kufc4m.onion' => undef, + ); -done_testing; \ No newline at end of file +sub make_structured_answer { + my ($onion_name) = @_; + + return structured_answer => { + id => 'onion_address', + name => 'OnionAddress', + data => { + title => $onion_name, + subtitle => 'Onion/Hidden service', + description => 'You are trying to reach an onion/hidden service. To access '.$onion_name.' via web you will have to use the Tor Browser.' + }, + meta => { + sourceName => "Tor Project", + sourceUrl => "https://www.torproject.org/projects/torbrowser.html.en#downloads" + }, + templates => { + group => 'text', + options => { + moreAt => 1 + } + } + }; +}; + +done_testing; From 7126613cb2e35b3962ad8c153c4111d2610e1239 Mon Sep 17 00:00:00 2001 From: mohan08p Date: Mon, 5 Oct 2015 14:15:39 +0000 Subject: [PATCH 022/379] MongoDB cheat sheet --- share/goodie/cheat_sheets/json/mongodb.json | 343 ++++++++++++++++++++ 1 file changed, 343 insertions(+) create mode 100644 share/goodie/cheat_sheets/json/mongodb.json diff --git a/share/goodie/cheat_sheets/json/mongodb.json b/share/goodie/cheat_sheets/json/mongodb.json new file mode 100644 index 000000000..1d37d445c --- /dev/null +++ b/share/goodie/cheat_sheets/json/mongodb.json @@ -0,0 +1,343 @@ +{ + "id": "mongodb_cheat_sheet", + "name": "MongoDB", + "templete_type": "terminal", + "description": "Mongo shell", + "metadata": { + "sourceName": "MongoDB - Cheat Sheet", + "sourceUrl": "https://blog.codecentric.de/files/2012/12/MongoDB-CheatSheet-v1_0.pdf" + }, + "section_order": [ + "Basic Conceptes & Shell Commands", + "BSON Types", + "Inserting Documents", + "Finding Documents", + "Finding Documents using Operators", + "Updating Documents", + "Removing Documents", + "Working with Indexes", + "Indexes - Hints & Stats", + "Top & Stats System Commands", + "Pipeline Stages", + "Comparison with SQL", + "Replica Sets", + "Sharding", + "Durability of Writes" + ], + "sections": { + "Basic Conceptes & Shell Commands": [ + { + "key": "db.ships.", + "val": "db – implicit handle to the used database, ships – name of the used collection" + }, + { + "key": "use ", + "val": "Switch to another database" + }, + { + "key": "show collections", + "val": "Lists the available collections" + }, + { + "key": "help", + "val": "Prints available commands and help" + } + ], + "BSON Types": [ + { + "key": "Double", + "val": "1" + }, + { + "key": "String", + "val": "2" + }, + { + "key": "Object", + "val": "3" + }, + { + "key": "Array", + "val": "4" + }, + { + "key": "Binary Data", + "val": "5" + }, + { + "key": "Undefined", + "val": "6(Deprecated)" + }, + { + "key": "Obect Id", + "val": "7" + }, + { + "key": "Boolean", + "val": "8" + }, + { + "key": "Date", + "val": "9" + }, + { + "key": "Null", + "val": "10" + } + ], + "Inserting Documents": [ + { + "key": "db.ships.insert(\\{name:'USS Enterprise-D',operator:'Starfleet',type:'Explorer',class:'Galaxy',crew:750,codes:\\[10,11,12\\]\\})", + "val": "Insert into Ships collection Example 1" + }, + { + "key": "db.ships.insert(\\{name:'IKS Buruk',operator:' Klingon Empire',class:'Warship',crew:40,codes:\\[100,110,120\\]\\})", + "val": "Insert into Ships collection Example 2" + }, + { + "key": "db.ships.insert(\\{name:'Narada',operator:'Romulan Star Empire',type:'Warbird',class:'Warbird',crew:65,codes:\\[251,251,220\\]\\})", + "val": "Insert into Ships collection Example 3" + } + ], + "Finding Documents": [ + { + "key": "db.ships.findOne()", + "val": "Finds one arbitrary document" + }, + { + "key": "db.ships.find().prettyPrint()", + "val": "Finds all documents and using nice formatting" + }, + { + "key": "db.ships.find(\\{\\}, \\{name:true, _id:false\\})", + "val": "Shows only the names of the ships collections" + }, + { + "key": "db.ships.findOne(\\{'name':'USS Defiant'\\})", + "val": "Finds one document by corresponding attribute" + } + ], + "Finding Documents using Operators": [ + { + "key": "$gt \/ $gte", + "val": "(greater than / greater than equals) : db.ships.find(\\{class:\\{$gt:’P'\\}\\})" + }, + { + "key": "$lt \/ $lte", + "val": "(lesser than / lesser than equals) : db.ships.find({class:{$lte:’P'}})" + }, + { + "key": "$exists", + "val": "(does an attribute exist or not) : db.ships.find({type:{$exists:true}})" + }, + { + "key": "$regex", + "val": "(Perl-style pattern matching) : db.ships.find({name:{$regex:’^USS\\sE’}})" + }, + { + "key": "$type", + "val": "(search by type of an element) : db.ships.find({name : {$type:2}})" + } + ], + "Updating Documents": [ + { + "key": "db.ships.update(\\{name : 'USS Prometheus'\\}, \\{name : 'USS Something'\\})", + "val": "Replaces the whole document" + }, + { + "key": "db.ships.update(\\{name : 'USS Something'\\},\\{$set : \\{operator : 'Starfleet', class : 'Prometheus'\\}\\})", + "val": "sets / changes certain attributes of a given document" + }, + { + "key": "db.ships.update(\\{name : 'USS Something'\\},\\{$unset : \\{operator : 1\\}\\})", + "val": "removes an attribute from a given document" + } + ], + "Removing Documents": [ + { + "key": "db.ships.remove(\\{name : 'USS Prometheus'\\})", + "val": "removes the document" + }, + { + "key": "db.ships.remove(\\{name:\\{$regex:’^USS\\sE’\\}\\})", + "val": "removes using operator" + } + ], + "Working with Indexes": [ + { + "key": "db.ships.ensureIndex(\\{name : 1\\})", + "val": "Creating an index" + }, + { + "key": "db.ships.dropIndex(\\{name : 1\\})", + "val": "Dropping an index" + }, + { + "key": "db.ships.ensureIndex(\\{name : 1, operator : 1, class : 0\\})", + "val": "Creating a compound index" + }, + { + "key": "db.ships.dropIndex(\\{name : 1, operator : 1, class : 0\\})", + "val": "Dropping a compound index" + }, + { + "key": "db.ships.ensureIndex(\\{name : 1, operator : 1, class : 0\\}, \\{unique : true\\})", + "val": "Creating a unique compound index" + } + ], + "Indexes - Hints & Stats": [ + { + "key": "db.ships.find (\\{'name':'USS Defiant'\\}).explain()", + "val": "Explains index usage" + }, + { + "key": "db.ships.stats()", + "val": "Index statistics" + }, + { + "key": "db.ships.totalIndexSize()", + "val": "Index size" + } + ], + "Top & Stats System Commands": [ + { + "key": "./mongotop", + "val": "Shows time spent per operations per collection" + }, + { + "key": "./mongostat", + "val": "Shows snapshot on the MongoDB system" + } + ], + "Pipeline Stages": [ + { + "key": "$project", + "val": "Change the set of documents by modifying keys and values. This is a 1:1 mapping." + }, + { + "key": "$match", + "val": "This is a filtering operation and thus this can reduce the amount of documents that are given as input to the next stage. This can be used for example if aggregation should only happen on a subset of the data." + }, + { + "key": "$group", + "val": "This does the actual aggregation and as we are grouping by one or more keys this can have a reducing effect on the amount of documents." + }, + { + "key": "$sort", + "val": "Sorting the documents one way or the other for the next stage. It should be noted that this might use a lot of memory. Thus if possible one should always try to reduce the amount of documents first." + }, + { + "key": "$skip", + "val": "With this it is possible to skip forward in the list of documents for a given amount of documents. This allows for example starting only from the 10th document. Typically this will be used together with “$sort” and especially together with “$limit”." + }, + { + "key": "$limit", + "val": "This limits the amount of documents to look at by the given number starting from the current position." + }, + { + "key": "$unwind", + "val": "This is used to unwind document that are using arrays. When using an array the data is kind of pre-joined and this operation will be undone with this to have individual documents again. Thus with this stage we will increase the amount of documents for the next stage." + } + ], + "Comparison with SQL": [ + { + "key": "$match", + "val": "WHERE" + }, + { + "key": "$group", + "val": "GROUP BY" + }, + { + "key": "$match", + "val": "HAVING" + }, + { + "key": "$project", + "val": "SELECT" + }, + { + "key": "$sort", + "val": "ORDER BY" + }, + { + "key": "$limit", + "val": "LIMIT" + }, + { + "key": "$sum", + "val": "SUM" + }, + { + "key": "$sum", + "val": "COUNT" + }, + { + "key": "$unwind", + "val": "JOIN" + } + ], + "Replica Sets": [ + { + "key": "Regular", + "val": "This is the most typical kind of node. It can act as a primary or secondary node" + }, + { + "key": "Arbiter", + "val": "Arbiter nodes are only there for voting purposes. They can be used to ensure that there is a certain amount of nodes in a replica set even though there are not that many physical servers." + }, + { + "key": "Delayed", + "val": "Often used as a disaster recovery node. The data stored here is usually a few hours behind the real working data." + }, + { + "key": "Hidden", + "val": "Often used for analytics in the replica set." + } + ], + "Sharding": [ + { + "key": "1", + "val": "Every document has to define a shard-key." + }, + { + "key": "2", + "val": "The value of the shard-key is immutable." + }, + { + "key": "3", + "val": "The shard-key must be part of an index and it must be the first field in that index." + }, + { + "key": "4", + "val": "There can be no unique index unless the shard-key is part of it and is then the first field." + }, + { + "key": "5", + "val": "Reads done without specifying the shard-key will lead to requests to all the different shards." + }, + { + "key": "6", + "val": "The shard-key must offer sufficient cardinality to be able to utilize all shards." + } + ], + "Durability of Writes": [ + { + "key": "w=0 && j=0", + "val": "This is “fire and forget”." + }, + { + "key": "w=1 && j=0", + "val": "Waits for an acknowledgement that the write was received and no indexes have been violated. Data can still be lost." + }, + { + "key": "w=1 && j=1", + "val": "The most save configuration by waiting for the write to the journal to be completed" + }, + { + "key": "w=0 && j=1", + "val": "Basically as same as above." + } + ] + } +} \ No newline at end of file From 01d1d6c1608c7b56b35d2e3f502c9e6c3370c75a Mon Sep 17 00:00:00 2001 From: Mohan Pawar Date: Sat, 10 Oct 2015 19:31:38 +0530 Subject: [PATCH 023/379] Remove long text for indexing --- share/goodie/cheat_sheets/json/mongodb.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/share/goodie/cheat_sheets/json/mongodb.json b/share/goodie/cheat_sheets/json/mongodb.json index 1d37d445c..8d340e380 100644 --- a/share/goodie/cheat_sheets/json/mongodb.json +++ b/share/goodie/cheat_sheets/json/mongodb.json @@ -1,7 +1,7 @@ { "id": "mongodb_cheat_sheet", "name": "MongoDB", - "templete_type": "terminal", + "templete_type": "code", "description": "Mongo shell", "metadata": { "sourceName": "MongoDB - Cheat Sheet", @@ -165,23 +165,23 @@ ], "Working with Indexes": [ { - "key": "db.ships.ensureIndex(\\{name : 1\\})", + "key": "db.ships.ensureIndex(keys, options)", "val": "Creating an index" }, { - "key": "db.ships.dropIndex(\\{name : 1\\})", + "key": "db.ships.dropIndex(keys, options)", "val": "Dropping an index" }, { - "key": "db.ships.ensureIndex(\\{name : 1, operator : 1, class : 0\\})", + "key": "db.ships.ensureIndex(keys, options)", "val": "Creating a compound index" }, { - "key": "db.ships.dropIndex(\\{name : 1, operator : 1, class : 0\\})", + "key": "db.ships.dropIndex(\\{keys, options)", "val": "Dropping a compound index" }, { - "key": "db.ships.ensureIndex(\\{name : 1, operator : 1, class : 0\\}, \\{unique : true\\})", + "key": "db.ships.ensureIndex(keys, options, \\{unique : true\\})", "val": "Creating a unique compound index" } ], @@ -340,4 +340,4 @@ } ] } -} \ No newline at end of file +} From de2ce6ef7d47fe53cbbeb4414a2b136d7a6f553e Mon Sep 17 00:00:00 2001 From: Brian Buttrick Date: Mon, 12 Oct 2015 21:09:35 -0400 Subject: [PATCH 024/379] adding pattern cheat sheets --- .../cheat_sheets/json/crochet-pattern.json | 213 ++++++++++++++++ .../cheat_sheets/json/knitting-pattern.json | 234 ++++++++++++++++++ 2 files changed, 447 insertions(+) create mode 100644 share/goodie/cheat_sheets/json/crochet-pattern.json create mode 100644 share/goodie/cheat_sheets/json/knitting-pattern.json diff --git a/share/goodie/cheat_sheets/json/crochet-pattern.json b/share/goodie/cheat_sheets/json/crochet-pattern.json new file mode 100644 index 000000000..a1f0f9d59 --- /dev/null +++ b/share/goodie/cheat_sheets/json/crochet-pattern.json @@ -0,0 +1,213 @@ +{ + "id": "crochet_pattern_cheat_sheet", + "name": "Crochet Cheat Sheet", + "description": "Crochet pattern abbreviations", + "metadata": { + "sourceName": "Craft Yarn Council", + "sourceUrl": "http://craftyarncouncil.com/crochet.html" + }, + "section_order": ["Abbreviations", " ", " "], + "sections": { + "Abbreviations": [{ + "val": "work instructions within brackets as many times as directed", + "key": "[]" + }, { + "val": "work instructions within parentheses in the place directed", + "key": "()" + }, { + "val": "repeat instructions following the asterisks as directed", + "key": "**" + }, { + "val": "inch(es)", + "key": "\"" + }, { + "val": "repeat instructions following the single asterisk as directed", + "key": "*" + }, { + "val": "alternate", + "key": "alt" + }, { + "val": "approximately", + "key": "approx" + }, { + "val": "begin/beginning", + "key": "beg" + }, { + "val": "between", + "key": "bet" + }, { + "val": "back loop(s)", + "key": "BL" + }, { + "val": "bobble", + "key": "bo" + }, { + "val": "back post double crochet", + "key": "BP" + }, { + "val": "back post single crochet", + "key": "BPsc" + }, { + "val": "back post treble crochet", + "key": "BPtr" + }, { + "val": "color A", + "key": "CA" + }, { + "val": "color B", + "key": "CB" + }, { + "val": "contrasting color", + "key": "CC" + }, { + "val": "chain stitch", + "key": "ch" + }, { + "val": "refers to chain or space previously made: e.g., ch-1 space", + "key": "ch-" + }], + " ": [{ + "val": "chain space", + "key": "ch-sp" + }, { + "val": "cluster", + "key": "CL" + }, { + "val": "centimeter(s)", + "key": "cm" + }, { + "val": "continue", + "key": "cont" + }, { + "val": "double crochet", + "key": "dc" + }, { + "val": "double crochet 2 stitches together", + "key": "dc2tog" + }, { + "val": "decrease/decreases/decreasing", + "key": "dec" + }, { + "val": "double treble", + "key": "dtr" + }, { + "val": "front loop(s)", + "key": "FL" + }, { + "val": "follow/follows/following", + "key": "foll" + }, { + "val": "front post", + "key": "FP" + }, { + "val": "front post double crochet", + "key": "FPdc" + }, { + "val": "front post single crochet", + "key": "FPsc" + }, { + "val": "front post treble crochet", + "key": "FPtr" + }, { + "val": "gram", + "key": "g" + }, { + "val": "half double crochet", + "key": "hdc" + }, { + "val": "increase/increases/increasing", + "key": "inc" + }, { + "val": "loops", + "key": "lp(s)" + }, { + "val": "meter(s)", + "key": "m" + }, { + "val": "main color", + "key": "MC" + }, { + "val": "millimeter(s)", + "key": "mm" + }, { + "val": "ounce(s)", + "key": "oz" + }, { + "val": "picot", + "key": "p" + }], + " ": [{ + "val": "pattern(s)", + "key": "pat(s)" + }, { + "val": "popcorn", + "key": "pc" + }, { + "val": "place marker", + "key": "pm" + }, { + "val": "previous", + "key": "prev" + }, { + "val": "remain/remaining", + "key": "rem" + }, { + "val": "repeat(s)", + "key": "rep" + }, { + "val": "round(s)", + "key": "rnd(s)" + }, { + "val": "right side", + "key": "RS" + }, { + "val": "single crochet", + "key": "sc" + }, { + "val": "single crochet 2 stitches together", + "key": "sc2tog" + }, { + "val": "skip", + "key": "sk" + }, { + "val": "slip stitch", + "key": "sL st" + }, { + "val": "space(s)", + "key": "sp(s)" + }, { + "val": "stitch(es)", + "key": "st(s)" + }, { + "val": "turning chain", + "key": "tch" + }, { + "val": "turning chain", + "key": "t-ch" + }, { + "val": "through back loop", + "key": "tbl" + }, { + "val": "together", + "key": "tog" + }, { + "val": "treble crochet", + "key": "tr" + }, { + "val": "triple treble crochet", + "key": "trtr" + }, { + "val": "wrong side", + "key": "WS" + }, { + "val": "yard(s)", + "key": "yd(s)" + }, { + "val": "yarn over", + "key": "yo" + }, { + "val": "yarn over hook", + "key": "yoh" + }] + } +} diff --git a/share/goodie/cheat_sheets/json/knitting-pattern.json b/share/goodie/cheat_sheets/json/knitting-pattern.json new file mode 100644 index 000000000..269311e00 --- /dev/null +++ b/share/goodie/cheat_sheets/json/knitting-pattern.json @@ -0,0 +1,234 @@ +{ + "id": "knitting_pattern_cheat_sheet", + "name": "Knitting Pattern Cheat Sheet", + "description": "Knitting pattern abbreviations", + "metadata": { + "sourceName": "Craft Yarn Council", + "sourceUrl": "http://craftyarncouncil.com/knit.html" + }, + "section_order": ["Abbreviations", " ", " "], + "sections": { + "Abbreviations": [{ + "val": "work instructions within brackets as many times as directed", + "key": "[]" + }, { + "val": "work instructions within parentheses in the place directed", + "key": "()" + }, { + "val": "repeat instructions following the asterisks as directed", + "key": "**" + }, { + "val": "inch(es)", + "key": "\"" + }, { + "val": "repeat instructions following the single asterisk as directed", + "key": "*" + }, { + "val": "alternate", + "key": "alt" + }, { + "val": "approximately", + "key": "approx" + }, { + "val": "begin/beginning", + "key": "beg" + }, { + "val": "between", + "key": "bet" + }, { + "val": "bind off", + "key": "BO" + }, { + "val": "color A", + "key": "CA" + }, { + "val": "color B", + "key": "CB" + }, { + "val": "contrasting color", + "key": "CC" + }, { + "val": "centimeter", + "key": "cm" + }, { + "val": "cable needle", + "key": "cn" + }, { + "val": "cast on", + "key": "CO" + }, { + "val": "continue", + "key": "cont" + }, { + "val": "decrease/decreases/decreasing", + "key": "dec" + }, { + "val": "double pointed needle(s)", + "key": "dpn" + }, { + "val": "front loop(s)", + "key": "fl" + }, { + "val": "follow/follows/following", + "key": "foll" + }, { + "val": "gram", + "key": "g" + }, { + "val": "increase/increases/increasing", + "key": "inc" + }, { + "val": "knit", + "key": "k" + }, { + "val": "knit", + "key": "K" + }], + " ": [{ + "val": "knit 2 stitches together", + "key": "k2tog" + }, { + "val": "knitwise", + "key": "kwise" + }, { + "val": "left hand", + "key": "LH" + }, { + "val": "loop(s)", + "key": "lp(s)" + }, { + "val": "meter(s)", + "key": "m" + }, { + "val": "make one stitch", + "key": "M1" + }, { + "val": "make on purl stitch", + "key": "M1 p-st" + }, { + "val": "main color", + "key": "MC" + }, { + "val": "millimeter(s)", + "key": "mm" + }, { + "val": "ounce(s)", + "key": "oz" + }, { + "val": "purl", + "key": "p" + }, { + "val": "purl", + "key": "P" + }, { + "val": "pattern(s)", + "key": "pat(s)" + }, { + "val": "pattern(s)", + "key": "patt" + }, { + "val": "place marker", + "key": "pm" + }, { + "val": "popcorn", + "key": "pop" + }, { + "val": "purl 2 stitches together", + "key": "p2tog" + }, { + "val": "previous", + "key": "prev" + }, { + "val": "pass slipped stitch over", + "key": "psso" + }, { + "val": "purlwise", + "key": "pwise" + }, { + "val": "remain/remaining", + "key": "rem" + }, { + "val": "repeat(s)", + "key": "rep" + }], + " ": [{ + "val": "reverse stockinette stitch", + "key": "rev St st" + }, { + "val": "right hand", + "key": "RH" + }, { + "val": "round(s)", + "key": "rnd(s)" + }, { + "val": "right side", + "key": "RS" + }, { + "val": "skip", + "key": "sk" + }, { + "val": "slip, knit, pass stitch over—one stitch decreased", + "key": "skp" + }, { + "val": "slip 1, knit 2 together, pass slip stitch over the knit 2 together; 2 stitches have been decreased", + "key": "sk2p" + }, { + "val": "slip", + "key": "sl" + }, { + "val": "slip 1 knitwise", + "key": "sl1k" + }, { + "val": "slip 1 purlwise", + "key": "sl1p" + }, { + "val": "slip stitch(es)", + "key": "sl st" + }, { + "val": "slip stitch (Canadian)", + "key": "ss" + }, { + "val": "slip, slip, knit these 2 stiches together—a decrease", + "key": "ssk" + }, { + "val": "slip, slip, slip, knit 3 stiches together", + "key": "sssk" + }, { + "val": "stitch(es)", + "key": "st(s)" + }, { + "val": "stockinette stitch/stocking stitch", + "key": "St st" + }, { + "val": "through back loop", + "key": "tbl" + }, { + "val": "together", + "key": "tog" + }, { + "val": "wrong side", + "key": "WS" + }, { + "val": "with yarn in back", + "key": "wyib" + }, { + "val": "with yarn in front", + "key": "wyif" + }, { + "val": "yard(s)", + "key": "yd(s)" + }, { + "val": "yarn forward", + "key": "yfwd" + }, { + "val": "yarn over", + "key": "yo" + }, { + "val": "yarn around needle", + "key": "yrn" + }, { + "val": "yarn over needle", + "key": "yon" + }] + } +} From 7a380cdedc6a84d1f9b93c85e4a67761df4d2746 Mon Sep 17 00:00:00 2001 From: Brian Buttrick Date: Mon, 12 Oct 2015 21:18:42 -0400 Subject: [PATCH 025/379] remove crochet --- .../cheat_sheets/json/crochet-pattern.json | 213 ------------------ 1 file changed, 213 deletions(-) delete mode 100644 share/goodie/cheat_sheets/json/crochet-pattern.json diff --git a/share/goodie/cheat_sheets/json/crochet-pattern.json b/share/goodie/cheat_sheets/json/crochet-pattern.json deleted file mode 100644 index a1f0f9d59..000000000 --- a/share/goodie/cheat_sheets/json/crochet-pattern.json +++ /dev/null @@ -1,213 +0,0 @@ -{ - "id": "crochet_pattern_cheat_sheet", - "name": "Crochet Cheat Sheet", - "description": "Crochet pattern abbreviations", - "metadata": { - "sourceName": "Craft Yarn Council", - "sourceUrl": "http://craftyarncouncil.com/crochet.html" - }, - "section_order": ["Abbreviations", " ", " "], - "sections": { - "Abbreviations": [{ - "val": "work instructions within brackets as many times as directed", - "key": "[]" - }, { - "val": "work instructions within parentheses in the place directed", - "key": "()" - }, { - "val": "repeat instructions following the asterisks as directed", - "key": "**" - }, { - "val": "inch(es)", - "key": "\"" - }, { - "val": "repeat instructions following the single asterisk as directed", - "key": "*" - }, { - "val": "alternate", - "key": "alt" - }, { - "val": "approximately", - "key": "approx" - }, { - "val": "begin/beginning", - "key": "beg" - }, { - "val": "between", - "key": "bet" - }, { - "val": "back loop(s)", - "key": "BL" - }, { - "val": "bobble", - "key": "bo" - }, { - "val": "back post double crochet", - "key": "BP" - }, { - "val": "back post single crochet", - "key": "BPsc" - }, { - "val": "back post treble crochet", - "key": "BPtr" - }, { - "val": "color A", - "key": "CA" - }, { - "val": "color B", - "key": "CB" - }, { - "val": "contrasting color", - "key": "CC" - }, { - "val": "chain stitch", - "key": "ch" - }, { - "val": "refers to chain or space previously made: e.g., ch-1 space", - "key": "ch-" - }], - " ": [{ - "val": "chain space", - "key": "ch-sp" - }, { - "val": "cluster", - "key": "CL" - }, { - "val": "centimeter(s)", - "key": "cm" - }, { - "val": "continue", - "key": "cont" - }, { - "val": "double crochet", - "key": "dc" - }, { - "val": "double crochet 2 stitches together", - "key": "dc2tog" - }, { - "val": "decrease/decreases/decreasing", - "key": "dec" - }, { - "val": "double treble", - "key": "dtr" - }, { - "val": "front loop(s)", - "key": "FL" - }, { - "val": "follow/follows/following", - "key": "foll" - }, { - "val": "front post", - "key": "FP" - }, { - "val": "front post double crochet", - "key": "FPdc" - }, { - "val": "front post single crochet", - "key": "FPsc" - }, { - "val": "front post treble crochet", - "key": "FPtr" - }, { - "val": "gram", - "key": "g" - }, { - "val": "half double crochet", - "key": "hdc" - }, { - "val": "increase/increases/increasing", - "key": "inc" - }, { - "val": "loops", - "key": "lp(s)" - }, { - "val": "meter(s)", - "key": "m" - }, { - "val": "main color", - "key": "MC" - }, { - "val": "millimeter(s)", - "key": "mm" - }, { - "val": "ounce(s)", - "key": "oz" - }, { - "val": "picot", - "key": "p" - }], - " ": [{ - "val": "pattern(s)", - "key": "pat(s)" - }, { - "val": "popcorn", - "key": "pc" - }, { - "val": "place marker", - "key": "pm" - }, { - "val": "previous", - "key": "prev" - }, { - "val": "remain/remaining", - "key": "rem" - }, { - "val": "repeat(s)", - "key": "rep" - }, { - "val": "round(s)", - "key": "rnd(s)" - }, { - "val": "right side", - "key": "RS" - }, { - "val": "single crochet", - "key": "sc" - }, { - "val": "single crochet 2 stitches together", - "key": "sc2tog" - }, { - "val": "skip", - "key": "sk" - }, { - "val": "slip stitch", - "key": "sL st" - }, { - "val": "space(s)", - "key": "sp(s)" - }, { - "val": "stitch(es)", - "key": "st(s)" - }, { - "val": "turning chain", - "key": "tch" - }, { - "val": "turning chain", - "key": "t-ch" - }, { - "val": "through back loop", - "key": "tbl" - }, { - "val": "together", - "key": "tog" - }, { - "val": "treble crochet", - "key": "tr" - }, { - "val": "triple treble crochet", - "key": "trtr" - }, { - "val": "wrong side", - "key": "WS" - }, { - "val": "yard(s)", - "key": "yd(s)" - }, { - "val": "yarn over", - "key": "yo" - }, { - "val": "yarn over hook", - "key": "yoh" - }] - } -} From 2805d7dd4d6169684465d5275b5f85313109dfde Mon Sep 17 00:00:00 2001 From: Brian Buttrick Date: Mon, 12 Oct 2015 21:36:55 -0400 Subject: [PATCH 026/379] add crochet pattern cheatsheet --- .../cheat_sheets/json/crochet-pattern.json | 213 ++++++++++++++++++ 1 file changed, 213 insertions(+) create mode 100644 share/goodie/cheat_sheets/json/crochet-pattern.json diff --git a/share/goodie/cheat_sheets/json/crochet-pattern.json b/share/goodie/cheat_sheets/json/crochet-pattern.json new file mode 100644 index 000000000..3f90646f3 --- /dev/null +++ b/share/goodie/cheat_sheets/json/crochet-pattern.json @@ -0,0 +1,213 @@ +{ + "id": "crochet_pattern_cheat_sheet", + "name": "Crochet Pattern Cheat Sheet", + "description": "Crochet pattern abbreviations", + "metadata": { + "sourceName": "Craft Yarn Council", + "sourceUrl": "http://craftyarncouncil.com/crochet.html" + }, + "section_order": ["Abbreviations", " ", " "], + "sections": { + "Abbreviations": [{ + "val": "work instructions within brackets as many times as directed", + "key": "[]" + }, { + "val": "work instructions within parentheses in the place directed", + "key": "()" + }, { + "val": "repeat instructions following the asterisks as directed", + "key": "**" + }, { + "val": "inch(es)", + "key": "\"" + }, { + "val": "repeat instructions following the single asterisk as directed", + "key": "*" + }, { + "val": "alternate", + "key": "alt" + }, { + "val": "approximately", + "key": "approx" + }, { + "val": "begin/beginning", + "key": "beg" + }, { + "val": "between", + "key": "bet" + }, { + "val": "back loop(s)", + "key": "BL" + }, { + "val": "bobble", + "key": "bo" + }, { + "val": "back post double crochet", + "key": "BP" + }, { + "val": "back post single crochet", + "key": "BPsc" + }, { + "val": "back post treble crochet", + "key": "BPtr" + }, { + "val": "color A", + "key": "CA" + }, { + "val": "color B", + "key": "CB" + }, { + "val": "contrasting color", + "key": "CC" + }, { + "val": "chain stitch", + "key": "ch" + }, { + "val": "refers to chain or space previously made: e.g., ch-1 space", + "key": "ch-" + }], + " ": [{ + "val": "chain space", + "key": "ch-sp" + }, { + "val": "cluster", + "key": "CL" + }, { + "val": "centimeter(s)", + "key": "cm" + }, { + "val": "continue", + "key": "cont" + }, { + "val": "double crochet", + "key": "dc" + }, { + "val": "double crochet 2 stitches together", + "key": "dc2tog" + }, { + "val": "decrease/decreases/decreasing", + "key": "dec" + }, { + "val": "double treble", + "key": "dtr" + }, { + "val": "front loop(s)", + "key": "FL" + }, { + "val": "follow/follows/following", + "key": "foll" + }, { + "val": "front post", + "key": "FP" + }, { + "val": "front post double crochet", + "key": "FPdc" + }, { + "val": "front post single crochet", + "key": "FPsc" + }, { + "val": "front post treble crochet", + "key": "FPtr" + }, { + "val": "gram", + "key": "g" + }, { + "val": "half double crochet", + "key": "hdc" + }, { + "val": "increase/increases/increasing", + "key": "inc" + }, { + "val": "loops", + "key": "lp(s)" + }, { + "val": "meter(s)", + "key": "m" + }, { + "val": "main color", + "key": "MC" + }, { + "val": "millimeter(s)", + "key": "mm" + }, { + "val": "ounce(s)", + "key": "oz" + }, { + "val": "picot", + "key": "p" + }], + " ": [{ + "val": "pattern(s)", + "key": "pat(s)" + }, { + "val": "popcorn", + "key": "pc" + }, { + "val": "place marker", + "key": "pm" + }, { + "val": "previous", + "key": "prev" + }, { + "val": "remain/remaining", + "key": "rem" + }, { + "val": "repeat(s)", + "key": "rep" + }, { + "val": "round(s)", + "key": "rnd(s)" + }, { + "val": "right side", + "key": "RS" + }, { + "val": "single crochet", + "key": "sc" + }, { + "val": "single crochet 2 stitches together", + "key": "sc2tog" + }, { + "val": "skip", + "key": "sk" + }, { + "val": "slip stitch", + "key": "sL st" + }, { + "val": "space(s)", + "key": "sp(s)" + }, { + "val": "stitch(es)", + "key": "st(s)" + }, { + "val": "turning chain", + "key": "tch" + }, { + "val": "turning chain", + "key": "t-ch" + }, { + "val": "through back loop", + "key": "tbl" + }, { + "val": "together", + "key": "tog" + }, { + "val": "treble crochet", + "key": "tr" + }, { + "val": "triple treble crochet", + "key": "trtr" + }, { + "val": "wrong side", + "key": "WS" + }, { + "val": "yard(s)", + "key": "yd(s)" + }, { + "val": "yarn over", + "key": "yo" + }, { + "val": "yarn over hook", + "key": "yoh" + }] + } +} From df1a60490811b5ba0826429ed5ddedba1292575e Mon Sep 17 00:00:00 2001 From: mohan08p Date: Fri, 16 Oct 2015 16:19:50 +0000 Subject: [PATCH 027/379] updated --- share/goodie/cheat_sheets/json/mongodb.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/goodie/cheat_sheets/json/mongodb.json b/share/goodie/cheat_sheets/json/mongodb.json index 1d37d445c..7fffc3176 100644 --- a/share/goodie/cheat_sheets/json/mongodb.json +++ b/share/goodie/cheat_sheets/json/mongodb.json @@ -1,7 +1,7 @@ { "id": "mongodb_cheat_sheet", "name": "MongoDB", - "templete_type": "terminal", + "templete_type": "code", "description": "Mongo shell", "metadata": { "sourceName": "MongoDB - Cheat Sheet", @@ -28,7 +28,7 @@ "Basic Conceptes & Shell Commands": [ { "key": "db.ships.", - "val": "db – implicit handle to the used database, ships – name of the used collection" + "val": "db – used for database, ships – used for collection" }, { "key": "use ", From 6b36335786401364778b86ce55ba7ebee8fca0e1 Mon Sep 17 00:00:00 2001 From: Sagar Hani Date: Thu, 22 Oct 2015 11:29:46 +0530 Subject: [PATCH 028/379] Updated the name and moved the file into json directory --- share/goodie/cheat_sheets/{ => json}/ubuntu.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename share/goodie/cheat_sheets/{ => json}/ubuntu.json (99%) diff --git a/share/goodie/cheat_sheets/ubuntu.json b/share/goodie/cheat_sheets/json/ubuntu.json similarity index 99% rename from share/goodie/cheat_sheets/ubuntu.json rename to share/goodie/cheat_sheets/json/ubuntu.json index 668538b86..d476b2725 100644 --- a/share/goodie/cheat_sheets/ubuntu.json +++ b/share/goodie/cheat_sheets/json/ubuntu.json @@ -1,6 +1,6 @@ { "id": "ubuntu_cheat_sheet", - "name": "Ubuntu", + "name": "Linux Ubuntu", "description": "Ubuntu Reference", "metadata": { "sourceName": "Ubuntu", From d7d48f70b9bf91393f51e0c421efeca8903fe35e Mon Sep 17 00:00:00 2001 From: Sagar Hani Date: Thu, 22 Oct 2015 11:54:31 +0530 Subject: [PATCH 029/379] Removed the HEAD section --- share/goodie/cheat_sheets/json/ubuntu.json | 6 ------ 1 file changed, 6 deletions(-) diff --git a/share/goodie/cheat_sheets/json/ubuntu.json b/share/goodie/cheat_sheets/json/ubuntu.json index eed6ec393..136fbf0e0 100644 --- a/share/goodie/cheat_sheets/json/ubuntu.json +++ b/share/goodie/cheat_sheets/json/ubuntu.json @@ -1,13 +1,7 @@ { -<<<<<<< HEAD:share/goodie/cheat_sheets/json/ubuntu.json "id": "ubuntu_cheat_sheet", "name": "Linux Ubuntu", "description": "Ubuntu Reference", -======= - "id": "ubuntu_unity_cheat_sheet", - "name": "Ubuntu Unity Cheat Sheet", - "description": "Ubuntu Unity Reference", ->>>>>>> 53e040940a35f898373295d5a7da63dac441eb79:share/goodie/cheat_sheets/ubuntu.json "metadata": { "sourceName": "Ubuntu Unity", "sourceUrl": "http://www.cheat-sheets.org/saved-copy/ubunturef.pdf" From 85aee9c4efe492db48d5d894ab2d5b368e95c157 Mon Sep 17 00:00:00 2001 From: Sagar Hani Date: Fri, 23 Oct 2015 16:12:19 +0530 Subject: [PATCH 030/379] Added template_type and removed the keyboard keys in display section --- share/goodie/cheat_sheets/json/ubuntu.json | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/share/goodie/cheat_sheets/json/ubuntu.json b/share/goodie/cheat_sheets/json/ubuntu.json index 136fbf0e0..9c893b13e 100644 --- a/share/goodie/cheat_sheets/json/ubuntu.json +++ b/share/goodie/cheat_sheets/json/ubuntu.json @@ -9,6 +9,9 @@ "aliases": [ "ubuntu unity", "unity ubuntu cheat sheet", "unity ubuntu" ], + + "template_type": "keyboard", + "section_order": [ "Privileges", "Display", @@ -64,15 +67,6 @@ }, { "val": "Reset xorg.conf configuration", "key": "sudo dexconf" - }, { - "val": "Restart X display if frozen", - "key": "[Ctrl] [Alt] [Backspace]" - }, { - "val": "Switch to TTY N", - "key": "[Ctrl] [Alt] [Fn]" - }, { - "val": "Switch back to X display", - "key": "[Ctrl] [Alt] [F7]" }], "System Services": [{ "val": "Start job service (Upstart)", From 285431e16a76b9534ceab642c7d6c0946a653197 Mon Sep 17 00:00:00 2001 From: harisphnx Date: Mon, 26 Oct 2015 17:30:36 +0000 Subject: [PATCH 031/379] c cheatsheet added --- share/goodie/cheat_sheets/json/c.json | 160 ++++++++++++++++++++++++++ 1 file changed, 160 insertions(+) create mode 100644 share/goodie/cheat_sheets/json/c.json diff --git a/share/goodie/cheat_sheets/json/c.json b/share/goodie/cheat_sheets/json/c.json new file mode 100644 index 000000000..8cbbddc50 --- /dev/null +++ b/share/goodie/cheat_sheets/json/c.json @@ -0,0 +1,160 @@ +{ + "id": "c_cheat_sheet", + "name": "C Cheat Sheet", + "description": "Computer Programming Language", + "metadata": { + "sourceName": "C for Beginners", + "sourceUrl": "http://www.dummies.com/how-to/content/beginning-c-programming-for-dummies-cheat-sheet.html" + }, + "aliases": [ + "C" + ], + "template_type": "code", + "section_order": [ + "Comparison Operators", + "Conversion Characters", + "Escape Sequences", + "Order of Precedence" + ], + "sections": { + "Comparison Operators": [ + { + "val": "Less than", + "key": "<" + }, { + "val": "Equal to", + "key": "==" + }, { + "val": "Greater than", + "key": ">" + }, { + "val": "Less than equal to", + "key": "<=" + }, { + "val": "Greater than equal to", + "key": ">=" + }, { + "val": "Not equal to", + "key": "!=" + } + ], + "Conversion Characters": [ + { + "val": "Displays single character", + "key": "%c" + }, { + "val": "Displays signed decimal integer", + "key": "%d" + }, { + "val": "Displays signed floating point value in E notation", + "key": "%e" + }, { + "val": "Displays signed floating point value", + "key": "%f" + }, { + "val": "Displays the string corresponding to the specified value of the system errno variable", + "key": "%m" + }, { + "val": "Displays a string", + "key": "%s" + }, { + "val": "Displays an unsigned integer", + "key": "%u" + }, { + "val": "Displays an integer as an unsigned hexadecimal number, using lower-case letters", + "key": "%x" + }, { + "val": "Displays a percent sign", + "key": "%%" + } + + ], + "Escape Sequences": [ + { + "val": "The speaker beeping", + "key": "\\a" + }, { + "val": "Backspace", + "key": "\\b" + }, { + "val": "Form feed", + "key": "\\f" + }, { + "val": "Newline character", + "key": "\\n" + }, { + "val": "Carriage return (moves the cursor to the beginning of the line)", + "key": "\\r" + }, { + "val": "Tab", + "key": "\\t" + }, { + "val": "Vertical tab (moves the cursor down a line)", + "key": "\\v" + }, { + "val": "The backslash character", + "key": "\\\\\\" + }, { + "val": "The apostrophe", + "key": "\\'" + }, { + "val": "The double-quote character", + "key": "\\\"" + }, { + "val": "The question mark", + "key": "\\?" + }, { + "val": "The “null” byte (backslash-zero)", + "key": "\\0" + } + ], + "Order of Precedence": [ + { + "val": "Unary - Logical not; associativity goes right to left", + "key": "!" + }, { + "val": "Unary - Increment, decrement; associativity goes from right to left", + "key": "[++] , [--]" + }, { + "val": "Math - Multiplication, division, modulo", + "key": "[*] , [/] , [%]" + }, { + "val": "Math - Addition, subtraction", + "key": "[+] , [–]" + }, { + "val": "Binary - Shift left, shift right", + "key": "[<<] , [>>]" + }, { + "val": "Comparison - Less than, greater than, less than or equal to, greater than or equal to", + "key": "[<] , [>] , [<=] , [>=]" + }, { + "val": "Comparison - Is equal to, not equal to", + "key": "[==] , [!=]" + }, { + "val": "Binary - And", + "key": "&" + }, { + "val": "Binary - Exclusive or (XOR)", + "key": "^" + }, { + "val": "Binary - Or", + "key": "|" + }, { + "val": "Logical - And", + "key": "&&" + }, { + "val": "Logical - Or", + "key": "||" + }, { + "val": "Ternary - Weird if thing; associativity goes right to left", + "key": "?:" + }, { + "val": "Assignment - Variable assignment operator, including the +=, *=, and all assignment operators", + "key": "=" + }, { + "val": "(None) - The comma separates items in a for statement; precedence from left to right", + "key": "," + } + ] + } +} From a014811da610e64e02e7d15b8ba1621f47d62ee0 Mon Sep 17 00:00:00 2001 From: harisphnx Date: Wed, 28 Oct 2015 15:51:27 +0000 Subject: [PATCH 032/379] c cheatsheet edited and removed extra spaces --- share/goodie/cheat_sheets/json/c.json | 234 +++++++++++++------------- 1 file changed, 117 insertions(+), 117 deletions(-) diff --git a/share/goodie/cheat_sheets/json/c.json b/share/goodie/cheat_sheets/json/c.json index 8cbbddc50..18665be57 100644 --- a/share/goodie/cheat_sheets/json/c.json +++ b/share/goodie/cheat_sheets/json/c.json @@ -1,160 +1,160 @@ -{ - "id": "c_cheat_sheet", +{ + "id": "c_cheat_sheet", "name": "C Cheat Sheet", - "description": "Computer Programming Language", - "metadata": { - "sourceName": "C for Beginners", + "description": "Computer Programming Language", + "metadata": + { + "sourceName": "C for Beginners", "sourceUrl": "http://www.dummies.com/how-to/content/beginning-c-programming-for-dummies-cheat-sheet.html" - }, - "aliases": [ - "C" - ], - "template_type": "code", + }, + "aliases": [ + "C" + ], + "template_type": "code", "section_order": [ - "Comparison Operators", - "Conversion Characters", + "Comparison Operators", + "Conversion Characters", "Escape Sequences", "Order of Precedence" - ], - "sections": { + ], + "sections": { "Comparison Operators": [ - { - "val": "Less than", - "key": "<" - }, { - "val": "Equal to", - "key": "==" - }, { - "val": "Greater than", - "key": ">" - }, { - "val": "Less than equal to", - "key": "<=" - }, { - "val": "Greater than equal to", - "key": ">=" - }, { - "val": "Not equal to", - "key": "!=" - } + { + "val": "Less than", + "key": "<" + }, { + "val": "Equal to", + "key": "==" + }, { + "val": "Greater than", + "key": ">" + }, { + "val": "Less than equal to", + "key": "<=" + }, { + "val": "Greater than equal to", + "key": ">=" + }, { + "val": "Not equal to", + "key": "!=" + } ], "Conversion Characters": [ - { - "val": "Displays single character", - "key": "%c" - }, { - "val": "Displays signed decimal integer", - "key": "%d" - }, { - "val": "Displays signed floating point value in E notation", - "key": "%e" - }, { - "val": "Displays signed floating point value", - "key": "%f" - }, { - "val": "Displays the string corresponding to the specified value of the system errno variable", - "key": "%m" - }, { - "val": "Displays a string", - "key": "%s" - }, { - "val": "Displays an unsigned integer", - "key": "%u" - }, { - "val": "Displays an integer as an unsigned hexadecimal number, using lower-case letters", - "key": "%x" - }, { - "val": "Displays a percent sign", - "key": "%%" - } - + { + "val": "Displays single character", + "key": "%c" + }, { + "val": "Displays signed decimal integer", + "key": "%d" + }, { + "val": "Displays signed floating point value in E notation", + "key": "%e" + }, { + "val": "Displays signed floating point value", + "key": "%f" + }, { + "val": "Displays the string corresponding to the specified value of the system errno variable", + "key": "%m" + }, { + "val": "Displays a string", + "key": "%s" + }, { + "val": "Displays an unsigned integer", + "key": "%u" + }, { + "val": "Displays an integer as an unsigned hexadecimal number, using lower-case letters", + "key": "%x" + }, { + "val": "Displays a percent sign", + "key": "%%" + } ], "Escape Sequences": [ { - "val": "The speaker beeping", - "key": "\\a" + "val": "The speaker beeping", + "key": "\\a" }, { - "val": "Backspace", - "key": "\\b" + "val": "Backspace", + "key": "\\b" }, { - "val": "Form feed", - "key": "\\f" + "val": "Form feed", + "key": "\\f" }, { - "val": "Newline character", - "key": "\\n" + "val": "Newline character", + "key": "\\n" }, { - "val": "Carriage return (moves the cursor to the beginning of the line)", - "key": "\\r" + "val": "Carriage return (moves the cursor to the beginning of the line)", + "key": "\\r" }, { - "val": "Tab", - "key": "\\t" + "val": "Tab", + "key": "\\t" }, { - "val": "Vertical tab (moves the cursor down a line)", - "key": "\\v" + "val": "Vertical tab (moves the cursor down a line)", + "key": "\\v" }, { - "val": "The backslash character", - "key": "\\\\\\" + "val": "The backslash character", + "key": "\\\\\\" }, { - "val": "The apostrophe", - "key": "\\'" + "val": "The apostrophe", + "key": "\\'" }, { - "val": "The double-quote character", - "key": "\\\"" + "val": "The double-quote character", + "key": "\\\"" }, { - "val": "The question mark", - "key": "\\?" + "val": "The question mark", + "key": "\\?" }, { - "val": "The “null” byte (backslash-zero)", - "key": "\\0" + "val": "The “null” byte (backslash-zero)", + "key": "\\0" } ], "Order of Precedence": [ { - "val": "Unary - Logical not; associativity goes right to left", - "key": "!" + "val": "Unary - Logical not; associativity goes right to left", + "key": "!" }, { - "val": "Unary - Increment, decrement; associativity goes from right to left", - "key": "[++] , [--]" + "val": "Unary - Increment, decrement; associativity goes from right to left", + "key": "[++] , [--]" }, { - "val": "Math - Multiplication, division, modulo", - "key": "[*] , [/] , [%]" + "val": "Math - Multiplication, division, modulo", + "key": "[*] , [/] , [%]" }, { - "val": "Math - Addition, subtraction", - "key": "[+] , [–]" + "val": "Math - Addition, subtraction", + "key": "[+] , [–]" }, { - "val": "Binary - Shift left, shift right", - "key": "[<<] , [>>]" + "val": "Binary - Shift left, shift right", + "key": "[<<] , [>>]" }, { - "val": "Comparison - Less than, greater than, less than or equal to, greater than or equal to", - "key": "[<] , [>] , [<=] , [>=]" + "val": "Comparison - Less than, greater than, less than or equal to, greater than or equal to", + "key": "[<] , [>] , [<=] , [>=]" }, { - "val": "Comparison - Is equal to, not equal to", - "key": "[==] , [!=]" + "val": "Comparison - Is equal to, not equal to", + "key": "[==] , [!=]" }, { - "val": "Binary - And", - "key": "&" + "val": "Binary - And", + "key": "&" }, { - "val": "Binary - Exclusive or (XOR)", - "key": "^" + "val": "Binary - Exclusive or (XOR)", + "key": "^" }, { - "val": "Binary - Or", - "key": "|" + "val": "Binary - Or", + "key": "|" }, { - "val": "Logical - And", - "key": "&&" + "val": "Logical - And", + "key": "&&" }, { - "val": "Logical - Or", - "key": "||" + "val": "Logical - Or", + "key": "||" }, { - "val": "Ternary - Weird if thing; associativity goes right to left", - "key": "?:" + "val": "Ternary - Weird if thing; associativity goes right to left", + "key": "?:" }, { - "val": "Assignment - Variable assignment operator, including the +=, *=, and all assignment operators", - "key": "=" + "val": "Assignment - Variable assignment operator, including the +=, *=, and all assignment operators", + "key": "=" }, { - "val": "(None) - The comma separates items in a for statement; precedence from left to right", - "key": "," + "val": "(None) - The comma separates items in a for statement; precedence from left to right", + "key": "," } - ] + ] } } From 940dbc142a4497b915c69cc910a3e074c0aa728e Mon Sep 17 00:00:00 2001 From: preemeijer Date: Wed, 28 Oct 2015 20:25:15 +0000 Subject: [PATCH 033/379] Added scratch cheatsheet --- share/goodie/cheat_sheets/json/scratch.json | 576 ++++++++++++++++++++ 1 file changed, 576 insertions(+) create mode 100644 share/goodie/cheat_sheets/json/scratch.json diff --git a/share/goodie/cheat_sheets/json/scratch.json b/share/goodie/cheat_sheets/json/scratch.json new file mode 100644 index 000000000..174f1a54e --- /dev/null +++ b/share/goodie/cheat_sheets/json/scratch.json @@ -0,0 +1,576 @@ +{ + "id" : "scratch_cheat_sheet", + "name" : "Scratch Cheat Sheet", + "metadata" : { + "sourceName" : "Scratch wiki", + "sourceUrl" : "http://wiki.scratch.mit.edu/wiki/Scratch_Wiki:Table_of_Contents/Block_Types" + }, + "template_type": "terminal", + "section_order" : [ + "Control", + "Data", + "Events", + "Looks", + "Motion", + "Operators", + "Pen", + "Sensing", + "Sound", + "More Blocks" + ], + "description" : "Basic Scratch Blocks. The blocks are grouped into categories, these are color-coded within Scratch.", + "sections" : { + "Motion" : [ + { + "val" : "The block moves its sprite forward the specified amount of steps in the direction it is facing", + "key" : "move _ steps" + }, + { + "val" : "The blocks turn their sprite the specified amount of degrees clockwise or counter-clockwise (depending on which block is used); this changes the direction the sprite is facing", + "key" : "turn right" + }, + { + "val" : "The blocks turn their sprite the specified amount of degrees clockwise or counter-clockwise (depending on which block is used); this changes the direction the sprite is facing", + "key" : "turn left" + }, + { + "val" : "The block points its sprite in the specified direction; this rotates the sprite", + "key" : "point in direction" + }, + { + "val" : "The block points its sprite towards the mouse-pointer or another sprite depending on its costume center; this changes the sprite's direction and rotates the sprite", + "key" : "point towards" + }, + { + "val" : "The block sets its sprite's X and Y position to the specified amounts. This block is related to the Set X to () and the Set Y to () blocks", + "key" : "go to x y" + }, + { + "val" : "The block sets its sprite's X and Y position to that of the mouse-pointer or another sprite", + "key" : "go to" + }, + { + "val" : "The block moves its sprite steadily to the specified X and Y position in the specified amount of seconds", + "key" : "glide _ secs to x y" + }, + { + "val" : "The block moves its sprite costume center's X position by the specified amount", + "key" : "change x by" + }, + { + "val" : "The block changes the selected sprite's X position to a specified value", + "key" : "set x to" + }, + { + "val" : "The block moves its sprite's Y position by the specified amount", + "key" : "change y by" + }, + { + "val" : "The block sets its sprite's Y (up and down) position to the specified amount", + "key" : "set y to" + }, + { + "val" : "The block checks to see if its sprite is touching the edge of the screen with the move steps block; and if it is, the sprite will point in a direction that mirrors the direction from which it is coming", + "key" : "if on edge, bounce" + }, + { + "val" : "The block changes the Rotation Style of the sprite in-project", + "key" : "set rotation style" + }, + { + "val" : " The block holds its sprite's X position", + "key" : "x position" + }, + { + "val" : "The block holds its sprite's Y position", + "key" : "y position" + }, + { + "val" : "The block holds its sprite's direction, measured in degrees", + "key" : "direction" + } + ], + "Looks" : [ + { + "val" : "The block displays a speech bubble with the specified text for the sprite that runs it", + "key" : "say _ for _ secs" + }, + { + "val" : "The block gives its sprite a speech bubble with the specified text — the speech bubble stays until an another speech or thought block is activated, or the stop sign is pressed", + "key" : "say _" + }, + { + "val" : "The block give its sprite a thought bubble with the specified text, which stays for the specified amount of seconds", + "key" : "think _ for _ secs" + }, + { + "val" : "The block gives its sprite a thought bubble with the specified text. The thought bubble stays until a speech or thought block with its text block empty is activated, or the stop sign is pressed", + "key" : "think _" + }, + { + "val" : "If the block's sprite is hidden, it will show the sprite — if the sprite is already showing, nothing will change", + "key" : "show" + }, + { + "val" : "If the block's sprite is shown, it will hide the sprite — if the sprite is already hidden, nothing happens", + "key" : "hide" + }, + { + "val" : "The block changes its sprite's costume to a specified one", + "key" : "switch costume to _" + }, + { + "val" : "The block changes its sprite's costume to the next in the costumes pane, but if the current costume is the last in the list, the block will loop to the first", + "key" : "next costume" + }, + { + "val" : "The block changes the backdrop to the next in the list of backdrops, but if the current backdrop is the last in the list, the block will loop to the first", + "key" : "next backdrop" + }, + { + "val" : "The block changes the Stage's backdrop to the specified one", + "key" : "switch backdrop to _" + }, + { + "val" : "This block waits for scripts under any When Backdrop Switches to () blocks to finish", + "key" : "switch backdrop to _ and wait" + }, + { + "val" : "The block changes the specified effect on its sprite by the specified amount. There are seven different effects to choose from: color, fisheye, whirl, pixelate, mosaic, brightness and ghost", + "key" : "change _ effect by _" + }, + { + "val" : "The block sets the specified effect on its sprite to the specified amount. There are seven different effects to choose from: color, fisheye, whirl, pixelate, mosaic, brightness and ghost", + "key" : "set _ effect to _" + }, + { + "val" : "This block resets all 7 graphic effects (color, fisheye, whirl, pixelate, mosaic, brightness and ghost) on its sprite", + "key" : "clear graphic effects" + }, + { + "val" : "The block changes its sprite's size by the specified amount", + "key" : "change size by _" + }, + { + "val" : "The block sets its sprite's size to the specified amount", + "key" : "set size to _ %" + }, + { + "val" : "The block will place a sprite in front of all other sprites", + "key" : "go to front" + }, + { + "val" : "The block changes its sprite's layer value by the specified amount", + "key" : "go back _ layers" + }, + { + "val" : "The block holds its sprite's current costume number", + "key" : "costume #" + }, + { + "val" : "The block holds the current backdrop name", + "key" : "backdrop name" + }, + { + "val" : "The block hold the current backdrop number", + "key" : "backdrop #" + }, + { + "val" : "The block holds its sprite's size", + "key" : "size" + } + ], + "Sound" : [ + { + "val" : "The block will play the specified sound", + "key" : "play sound _" + }, + { + "val" : "The block will play the specified sound, pausing its script until the sound has finished playing", + "key" : "play sound _ until done" + }, + { + "val" : "The block will stop any sounds currently being played on all sprites and the Stage", + "key" : "stop all sounds" + }, + { + "val" : "The block will play the specified instrument for the specified amount of seconds using a MIDI drumset", + "key" : "play drum _ for _ beats" + }, + { + "val" : "The block pauses its script for the specified amount of beats, which can be a decimal number", + "key" : "rest for _ beats" + }, + { + "val" : "The block will play the specified note with a set MIDI instrument for the specified amount of beats", + "key" : "play note _ for _ beats" + }, + { + "val" : "The block changes the set MIDI instrument that the Play Note () for () Beats block will play", + "key" : "set instrument to _" + }, + { + "val" : "The block changes the volume of a sprite by the specified amount", + "key" : "change volume by _" + }, + { + "val" : "The block sets its sprite's volume to the specified amount", + "key" : "set volume to _ %" + }, + { + "val" : "The block changes the project's tempo by the specified amount", + "key" : "change tempo by _" + }, + { + "val" : "The block sets the Scratch project's tempo, or speed, to the specified amount, using the unit bpm, or beats per minute", + "key" : "set tempo to _ bpm" + }, + { + "val" : "The block holds the Scratch project's tempo", + "key" : "tempo" + }, + { + "val" : "The block holds a sprite's or the Stage's volume", + "key" : "volume" + } + ], + "Pen" : [ + { + "val" : "The block removes all marks made by the pen or stamps", + "key" : "clear" + }, + { + "val" : "When used in a script, the Sprite will produce a bitmap image of itself, which is stamped onto the Stage", + "key" : "stamp" + }, + { + "val" : "The block will make its sprite continuously pen a trail wherever it moves (until the Pen Up block is used)", + "key" : "pen down" + }, + { + "val" : "If a sprite is currently using the pen feature because of the Pen Down block, the block will stop it from continuing", + "key" : "pen up" + }, + { + "val" : "The block sets the pen's color to the color chosen with the block's color-picker (eyedropper tool)", + "key" : "set pen color to \\[color\\]" + }, + { + "val" : "The block sets the pen's color to the color chosen", + "key" : "set pen color to \\[number\\]" + }, + { + "val" : "The block changes the pen's shade by the specified amount", + "key" : "change pen shade by _" + }, + { + "val" : "The block sets the pen's shade to the specified amount", + "key" : "set pen shade to _" + }, + { + "val" : "The block changes the pen's size by the specified amount", + "key" : "change pen size by _" + }, + { + "val" : "The block sets the pen's size to the specified amount", + "key" : "set pen size to _" + } + ], + "Data" : [ + { + "val" : "The block simply holds its variable", + "key" : "variable" + }, + { + "val" : "The block will set the specified variable to the given value: a string or number", + "key" : "set _ to _" + }, + { + "val" : "The block will change the specified variable by a given amount", + "key" : "change _ by _" + }, + { + "val" : "The block shows the specified variable's Stage monitor", + "key" : "show variable _" + }, + { + "val" : "he block hides the specified variable's Stage monitor", + "key" : "hide variable _" + }, + { + "val" : "The block simply reports the items of its list as a string", + "key" : "list" + }, + { + "val" : "The block adds an item onto the end of the specified list, the item containing the given text", + "key" : "add _ to _" + }, + { + "val" : "The block can delete the item inputted, the last item, or all items of the specified list depending on the option selected", + "key" : "delete _ of _" + }, + { + "val" : "The block inserts an item containing the given text into the list, at the given position", + "key" : "insert _ at _ of _" + }, + { + "val" : "The block replaces the specified item; in other words, it changes the item's content to the given text", + "key" : "replace item _ of _ with _" + }, + { + "val" : "The block reports the value of the specified entry in a specified list", + "key" : "item _ of _" + }, + { + "val" : "The block reports how many items a list contains", + "key" : "length of _" + }, + { + "val" : "The block checks if any items in the specified list are equal to the given text", + "key" : "_ contains _" + }, + { + "val" : "The block shows the specified list's Stage monitor", + "key" : "show list _" + }, + { + "val" : "The block hides the specified list's Stage monitor", + "key" : "hide list _" + } + ], + "Events" : [ + { + "val" : "Scripts that wear this block will activate once the Green Flag has been clicked; these scripts can activate other scripts and enable the entire program", + "key" : "when green flag clicked" + }, + { + "val" : "Scripts placed underneath this block will activate when the specified key is pressed", + "key" : "when _ key pressed" + }, + { + "val" : "Scripts that wear the block will activate once its sprite or clone of the sprite is clicked. Contrary to its definite name, the block will also execute the clone's script when the clone is clicked on", + "key" : "when this sprite clicked" + }, + { + "val" : "Scripts that wear this block will be invoked once the specified backdrop has been switched to on the Stage", + "key" : "when backdrop switches to _" + }, + { + "val" : "It starts the script below it when a value (chosen by the dropdown menu) is greater than another value (entered by the number input). The available options are loudness, timer, and video motion", + "key" : "when _ > _" + }, + { + "val" : "Scripts that begin with this block will be invoked once the specified broadcast has been sent by a calling script", + "key" : "when I receive _" + }, + { + "val" : "Any scripts in any sprites that are hatted with the When I Receive () block that is set to a specified broadcast will activate", + "key" : "broadcast _" + }, + { + "val" : "The block sends a broadcast throughout the whole Scratch project — any scripts that are halted with the When I Receive () block and are set to the broadcast will activate", + "key" : "broadcast _ and wait" + } + ], + "Control" : [ + { + "val" : "The block pauses its script for the specified amount of seconds — the wait can also be a decimal number", + "key" : "wait _ secs" + }, + { + "val" : "Blocks held inside this block will loop a given amount of times, before allowing the script to continue", + "key" : "repeat _" + }, + { + "val" : "Blocks held inside this block will be in a loop", + "key" : "forever" + }, + { + "val" : "The block will check its boolean condition. If the condition is true, the blocks held inside it will run, and then the script involved will continue", + "key" : "if _ then" + }, + { + "val" : "The block will check its boolean condition: if the condition is true, the code held inside the first C (space) will activate, and then the script will continue; if the condition is false, the code inside the second C will activate", + "key" : "if _ then else" + }, + { + "val" : "The block pauses its script until the specified boolean condition is true", + "key" : "wait until _" + }, + { + "val" : "It activates in a clone when it gets created", + "key" : "when I start as a clone" + }, + { + "val" : "Blocks held inside this block will loop until the specified boolean statement is true, in which case the code beneath the block (if any) will execute", + "key" : "repeat until _" + }, + { + "val" : "The block would deactivate all scripts in the project, stopping it completely", + "key" : "stop _" + }, + { + "val" : "It creates a clone of the sprite in the argument. It can also clone the sprite it is running in, creating clones of clones, recursively", + "key" : "create clone of _" + }, + { + "val" : "It deletes the clone it runs in", + "key" : "delete this clone" + } + ], + "Sensing" : [ + { + "val" : "The block checks if its sprite is touching the mouse-pointer, edge, or another sprite (a Reporter block holding the sprite's name can be used). If the sprite is touching the selected object, the block returns true; if it is not, it returns false", + "key" : "touching _" + }, + { + "val" : "The block checks if its sprite is touching the specified color", + "key" : "touching color _ ?" + }, + { + "val" : "The block checks if a color on its sprite is touching another color; if the color on its sprite is touching the color, the block returns true; if it is not, it returns false", + "key" : "color _ is touching _ ?" + }, + { + "val" : "The block reports the distance (a measurement of pixels) between it and a specified sprite's costume center, or the mouse-pointer", + "key" : "distance to _" + }, + { + "val" : "The block holds the most recent text imputed with the Ask () and Wait block", + "key" : "answer" + }, + { + "val" : "The block checks if the specified key is pressed. If the key is being pressed, the block returns true; if it is not, it returns false", + "key" : "key _ pressed?" + }, + { + "val" : "The block checks if the computer mouse's primary button is activated (being clicked)", + "key" : "mouse down?" + }, + { + "val" : "he block holds (reports) the mouse-pointer's current Mouse X", + "key" : "mouse x" + }, + { + "val" : "The block holds the mouse-pointer's current Mouse Y", + "key" : "mouse y" + }, + { + "val" : "The block reports how loud the noise is that a microphone receives, on a scale of 0 to 100", + "key" : "loudness" + }, + { + "val" : "It gets values of the video, either motion (on a scale of 1 to 100) or direction (which way the detected motion is going, measured on the same plane as sprite direction), on either the Stage, or the current sprite", + "key" : "video _ on _" + }, + { + "val" : "It can turn the webcam on, off, or on flipped horizontally, depending on the argument", + "key" : "turn video _" + }, + { + "val" : "It sets the transparency of the video stream to a certain value", + "key" : "set video transparency to _ %" + }, + { + "val" : "The block starts at 0 when Scratch is launched and increases gradually; every second it will have increased by 1", + "key" : "timer" + }, + { + "val" : "The block sets the timer's value back to 0.0", + "key" : "reset timer" + }, + { + "val" : "The block will report a specified value of the specified sprite or the Stage", + "key" : "_ of _" + }, + { + "val" : "It reports either the current local year, month, date, day of the week, hour, minutes, or seconds, depending on the argument", + "key" : "current _" + }, + { + "val" : "It reports the amount of days (and fractions of a day) since 00:00:00 1 January 2000 (UTC)", + "key" : "days since 2000" + }, + { + "val" : "It reports the username of the user viewing the project, which can be used for saving progress in a project, either with a variable encoder or cloud lists (once they are released with string-storage capabilities), as well as other purposes", + "key" : "username" + } + ], + "Operators" : [ + { + "val" : "The block adds two values and reports the result", + "key" : "_ add _" + }, + { + "val" : "The block subtracts the second value from the first and reports the result", + "key" : "_ subtract _" + }, + { + "val" : "The block multiplies the two values and reports the result", + "key" : "_ multiply _" + }, + { + "val" : "The block divides the second value from the first and returns the result", + "key" : "_ devide _" + }, + { + "val" : "The block picks a pseudorandom number ranging from the first given number to the second, including both endpoints", + "key" : "pick random _ to _" + }, + { + "val" : "The block checks if the first value is less than the second value", + "key" : "_ less than _" + }, + { + "val" : "The block checks if the first value is equal to the other value", + "key" : "_ equals _" + }, + { + "val" : "The block checks if the first value is greater than the other value", + "key" : "_ greater than _" + }, + { + "val" : "The block joins two boolean blocks so they both have to be true to return true. If they are both true, the block returns true; if they are not all true or none true, it returns false", + "key" : "_ and _" + }, + { + "val" : "The block joins two boolean blocks so any one of them can be true to return true", + "key" : "_ or _" + }, + { + "val" : "This block outputs the opposite boolean value of the condition (true and false)", + "key" : "not _" + }, + { + "val" : "The block concatenates, or links the two values together and reports the result", + "key" : "join _ _" + }, + { + "val" : "The block reports the specified character of the given text", + "key" : "letter _ of _" + }, + { + "val" : "The block reports how many characters the given string contains", + "key" : "length of _" + }, + { + "val" : "The block reports the remainder of the division when the first value is divided by the second", + "key" : "_ mod _" + }, + { + "val" : "The block rounds the given number to the nearest integer", + "key" : "round _" + }, + { + "val" : "The block performs a specified function on a given number and reports the result", + "key" : "_ of _" + } + ], + "More blocks" : [ + { + "val" : "This block is unique among the blocks for several reasons, including its lack of appearance in the Block Palette, its shape and color, and its edit menu when right-clicked", + "key" : "define custom block , custom block" + } + ] + } +} \ No newline at end of file From cd10f5e8168d1800ba927b6657c95348061becc8 Mon Sep 17 00:00:00 2001 From: ethanchewy <17chiue@gmail.com> Date: Wed, 28 Oct 2015 22:58:23 +0000 Subject: [PATCH 034/379] uploaded bootstrap --- share/goodie/cheat_sheets/json/bootstrap.json | 143 ++++++++++++++++++ 1 file changed, 143 insertions(+) create mode 100644 share/goodie/cheat_sheets/json/bootstrap.json diff --git a/share/goodie/cheat_sheets/json/bootstrap.json b/share/goodie/cheat_sheets/json/bootstrap.json new file mode 100644 index 000000000..e1e8105c8 --- /dev/null +++ b/share/goodie/cheat_sheets/json/bootstrap.json @@ -0,0 +1,143 @@ +{ + "id": "bootstrap_cheat_sheet", + "name": "Bootstrap", + "description": "Explanation of Bootstrap Classes", + "metadata": { + "sourceName": "Bootstrap", + "sourceUrl": "http://getbootstrap.com/" + }, + "aliases": [ + "front end framework", "twitter blueprint" + ], + "template_type": "code", + "section_order": [ + "Bootstrap Grid System", + "Navbars", + "Tables", + "Buttons", + "Images" + ], + "sections": { + "Bootstrap Grid System": [{ + "val": "Sets one fixed width for each screen size in bootstrap (xs,sm,md,lg)", + "key": ".container" + }, { + "val": "Expands screen to fill the available widthe", + "key": ".container-fluid" + }, { + "val": "Containers of columns", + "key": ".row" + }, { + "val": "For extra small devices phones (<768px)" , + "key": ".col-xs-" + }, { + "val": "For small devices tablets (≥768px)", + "key": ".col-sm-" + }, { + "val": "For medium devices desktops (≥992px)", + "key": ".col-md-" + }, { + "val": "For large devices desktops (≥1200px)", + "key": ".col-lg-" + }], + "Navbars": [{ + "val": "Standard navigation bar", + "key": ".navbar-default" + }, { + "val": "Black navigation bar", + "key": ".navbar-inverse" + }, { + "val": "Navigation bar fixed at the top", + "key": ".navbar-fixed-top" + }, { + "val": "Navigation bar stay at the bottom", + "key": ".navbar-fixed-bottom" + }, { + "val": "Aligns navigation bar buttons to the right", + "key": ".navbar-right" + }, { + "val": "Creates vertical navigation pills", + "key": ".nav-pills" + }, { + "val": "Creates vertical navigation pills", + "key": ".nav-stacked" + }, { + "val": "Creates navigation tabs", + "key": ".nav-tabs" + }, { + "val": "Makes navigation tabs/pills equal widths of their parent", + "key": ".nav-justified" + }, { + "val": "Indicates a unclickable tab/pill", + "key": ".disabled" + }], + "Tables": [{ + "val": "Adds basic styling to a table", + "key": ".table" + }, { + "val": "Adds zebra-stripes to a table", + "key": ".table-striped" + }, { + "val": "Adds borders on all sides of the table and cells", + "key": ".table-bordered" + }, { + "val": "Enables a hover state on table rows", + "key": ".table-hover" + }, { + "val": "Makes a table more compact by cutting cell padding in half", + "key": ".table-condensed" + }, { + "val": "Creates a responsive table.", + "key": ".table-responsive" + + }], + "Buttons": [{ + "val": "Adds basic styling to any button", + "key": ".btn" + }, { + "val": "Creates large button", + "key": ".btn-lg" + }, { + "val": "Creates medium button", + "key": ".btn-md" + }, { + "val": "Creates small button", + "key": ".btn-sm" + }, { + "val": "Creates medium button", + "key": ".btn-xs" + }, { + "val": "Makes a button appear pressed", + "key": ".active" + }, { + "val": "Makes a button unclickable", + "key": ".disabled" + }, { + "val": "Creates a button group", + "key": ".btn-group" + }, { + "val": "Create a vertical button group", + "key": ".btn-group-vertical" + }, { + "val": "Span buttons to the entire width of the screen", + "key": ".btn-group-justified" + }], + "Images": [{ + "val": "Adds rounded corners to an image", + "key": ".img-rounded" + }, { + "val": "Shapes the image to a circle", + "key": ".img-circle" + }, { + "val": "Shapes the image to a thumbnail", + "key": ".img-thumbnail" + }, { + "val": "Creates responsive images", + "key": ".img-responsive" + }, { + "val": "Creates an image gallery", + "key": ".thumbnail" + }] + + } +} \ No newline at end of file From 402763056833db81388d9a20009dfbe13c7689e6 Mon Sep 17 00:00:00 2001 From: Ethan Chiu Date: Wed, 28 Oct 2015 19:13:07 -0400 Subject: [PATCH 035/379] Update bootstrap.json --- share/goodie/cheat_sheets/json/bootstrap.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/goodie/cheat_sheets/json/bootstrap.json b/share/goodie/cheat_sheets/json/bootstrap.json index e1e8105c8..5bc3c9b7d 100644 --- a/share/goodie/cheat_sheets/json/bootstrap.json +++ b/share/goodie/cheat_sheets/json/bootstrap.json @@ -7,7 +7,7 @@ "sourceUrl": "http://getbootstrap.com/" }, "aliases": [ - "front end framework", "twitter blueprint" + "twitter front end framework", "twitter blueprint" ], "template_type": "code", "section_order": [ @@ -140,4 +140,4 @@ }] } -} \ No newline at end of file +} From dfa2c749df8d5f6bac10a43a16f603ca84425ab5 Mon Sep 17 00:00:00 2001 From: Ethan Chiu Date: Wed, 28 Oct 2015 21:14:17 -0400 Subject: [PATCH 036/379] Added more triggers --- share/goodie/cheat_sheets/json/bootstrap.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/goodie/cheat_sheets/json/bootstrap.json b/share/goodie/cheat_sheets/json/bootstrap.json index 5bc3c9b7d..12340b466 100644 --- a/share/goodie/cheat_sheets/json/bootstrap.json +++ b/share/goodie/cheat_sheets/json/bootstrap.json @@ -7,7 +7,7 @@ "sourceUrl": "http://getbootstrap.com/" }, "aliases": [ - "twitter front end framework", "twitter blueprint" + "twitter front end framework", "twitter blueprint", "twitter bootstrap", "bootstrap framework" ], "template_type": "code", "section_order": [ From e607c4d0ddaee1003b935167ae1b6ac9acf7b377 Mon Sep 17 00:00:00 2001 From: preemeijer Date: Thu, 29 Oct 2015 06:46:59 +0000 Subject: [PATCH 037/379] pointers moollaza done --- share/goodie/cheat_sheets/json/scratch.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/goodie/cheat_sheets/json/scratch.json b/share/goodie/cheat_sheets/json/scratch.json index 174f1a54e..7588c2f11 100644 --- a/share/goodie/cheat_sheets/json/scratch.json +++ b/share/goodie/cheat_sheets/json/scratch.json @@ -1,8 +1,8 @@ { "id" : "scratch_cheat_sheet", - "name" : "Scratch Cheat Sheet", + "name" : "Scratch", "metadata" : { - "sourceName" : "Scratch wiki", + "sourceName" : "Scratch Wiki", "sourceUrl" : "http://wiki.scratch.mit.edu/wiki/Scratch_Wiki:Table_of_Contents/Block_Types" }, "template_type": "terminal", From fb41180acd4e79bba93ebaf5c8602e957888465c Mon Sep 17 00:00:00 2001 From: harisphnx Date: Thu, 29 Oct 2015 19:21:47 +0000 Subject: [PATCH 038/379] made changes suggested --- share/goodie/cheat_sheets/json/c.json | 412 +++++++++++++++++--------- 1 file changed, 267 insertions(+), 145 deletions(-) diff --git a/share/goodie/cheat_sheets/json/c.json b/share/goodie/cheat_sheets/json/c.json index 18665be57..08437945f 100644 --- a/share/goodie/cheat_sheets/json/c.json +++ b/share/goodie/cheat_sheets/json/c.json @@ -2,159 +2,281 @@ "id": "c_cheat_sheet", "name": "C Cheat Sheet", "description": "Computer Programming Language", - "metadata": - { + "metadata": { "sourceName": "C for Beginners", "sourceUrl": "http://www.dummies.com/how-to/content/beginning-c-programming-for-dummies-cheat-sheet.html" }, "aliases": [ - "C" + "c programming", + "c language" ], "template_type": "code", "section_order": [ - "Comparison Operators", - "Conversion Characters", - "Escape Sequences", - "Order of Precedence" - ], + "Arithmetic Operators", + "Comparison Operators", + "Logical Operators", + "Bitwise Operators", + "Other Operators", + "Conversion Characters", + "Escape Sequences", + "Order of Precedence" + ], "sections": { + "Arithmetic Operators": [ + { + "val": "Basic assignment", + "key": "a = b" + }, + { + "val": "Addition", + "key": "a + b" + }, + { + "val": "Subtraction", + "key": "a - b" + }, + { + "val": "Unary plus (integer promotion)", + "key": "+a" + }, + { + "val": "Unary minus (additive inverse)", + "key": "-a" + }, + { + "val": "Multiplication", + "key": "a * b" + }, + { + "val": "Division", + "key": "a / b" + }, + { + "val": "Modulo (integer remainder)", + "key": "a % b" + }, + { + "val": "Increment Prefix", + "key": "++a" + }, + { + "val": "Increment Postfix", + "key": "a++" + }, + { + "val": "Decrement Prefix", + "key": "--a" + }, + { + "val": "Decrement Postfix", + "key": "a--" + } + ], "Comparison Operators": [ - { - "val": "Less than", - "key": "<" - }, { - "val": "Equal to", - "key": "==" - }, { - "val": "Greater than", - "key": ">" - }, { - "val": "Less than equal to", - "key": "<=" - }, { - "val": "Greater than equal to", - "key": ">=" - }, { - "val": "Not equal to", - "key": "!=" - } - ], - "Conversion Characters": [ - { - "val": "Displays single character", - "key": "%c" - }, { - "val": "Displays signed decimal integer", - "key": "%d" - }, { - "val": "Displays signed floating point value in E notation", - "key": "%e" - }, { - "val": "Displays signed floating point value", - "key": "%f" - }, { - "val": "Displays the string corresponding to the specified value of the system errno variable", - "key": "%m" - }, { - "val": "Displays a string", - "key": "%s" - }, { - "val": "Displays an unsigned integer", - "key": "%u" - }, { - "val": "Displays an integer as an unsigned hexadecimal number, using lower-case letters", - "key": "%x" - }, { - "val": "Displays a percent sign", - "key": "%%" - } - ], - "Escape Sequences": [ - { - "val": "The speaker beeping", - "key": "\\a" - }, { - "val": "Backspace", - "key": "\\b" - }, { - "val": "Form feed", - "key": "\\f" - }, { - "val": "Newline character", - "key": "\\n" - }, { - "val": "Carriage return (moves the cursor to the beginning of the line)", - "key": "\\r" - }, { - "val": "Tab", - "key": "\\t" - }, { - "val": "Vertical tab (moves the cursor down a line)", - "key": "\\v" - }, { - "val": "The backslash character", - "key": "\\\\\\" - }, { - "val": "The apostrophe", - "key": "\\'" - }, { - "val": "The double-quote character", - "key": "\\\"" - }, { - "val": "The question mark", - "key": "\\?" - }, { - "val": "The “null” byte (backslash-zero)", - "key": "\\0" - } - ], - "Order of Precedence": [ - { - "val": "Unary - Logical not; associativity goes right to left", - "key": "!" - }, { - "val": "Unary - Increment, decrement; associativity goes from right to left", - "key": "[++] , [--]" - }, { - "val": "Math - Multiplication, division, modulo", - "key": "[*] , [/] , [%]" - }, { - "val": "Math - Addition, subtraction", - "key": "[+] , [–]" - }, { - "val": "Binary - Shift left, shift right", - "key": "[<<] , [>>]" - }, { - "val": "Comparison - Less than, greater than, less than or equal to, greater than or equal to", - "key": "[<] , [>] , [<=] , [>=]" - }, { - "val": "Comparison - Is equal to, not equal to", - "key": "[==] , [!=]" - }, { - "val": "Binary - And", - "key": "&" - }, { - "val": "Binary - Exclusive or (XOR)", - "key": "^" - }, { - "val": "Binary - Or", - "key": "|" - }, { - "val": "Logical - And", - "key": "&&" - }, { - "val": "Logical - Or", - "key": "||" - }, { - "val": "Ternary - Weird if thing; associativity goes right to left", - "key": "?:" - }, { - "val": "Assignment - Variable assignment operator, including the +=, *=, and all assignment operators", - "key": "=" - }, { - "val": "(None) - The comma separates items in a for statement; precedence from left to right", - "key": "," - } - ] + { + "val": "a less than b", + "key": "a < b" + }, + { + "val": "a equal to b", + "key": "a == b" + }, + { + "val": "a greater than b", + "key": "a > b" + }, + { + "val": "a less than equal to b", + "key": "a <= b" + }, + { + "val": "a greater than equal to b", + "key": "a >= b" + }, + { + "val": "a not equal to b", + "key": "a != b" + } + ], + "Logical Operators": [ + { + "val": "Logical negation (NOT)", + "key": "!a" + }, + { + "val": "Logical AND", + "key": "a && b" + }, + { + "val": "Logical OR", + "key": "a || b" + } + ], + "Bitwise Operators": [ + { + "val": "Bitwise NOT", + "key": "~a" + }, + { + "val": "Bitwise AND", + "key": "a & b" + }, + { + "val": "Bitwise OR", + "key": "a | b" + }, + { + "val": "Bitwise XOR", + "key": "a ^ b" + }, + { + "val": "Bitwise left shift", + "key": "a << b" + }, + { + "val": "Bitwise right shift", + "key": "a >> b" + } + ], + "Other Operators": [ + { + "val": "Structure reference (member b of object a)", + "key": "a.b" + }, + { + "val": "Structure dereference (member b of object pointed to by a)", + "key": "a->b" + }, + { + "val": "Conversion (C-style cast)", + "key": "(type) a" + }, + { + "val": "Size-of", + "key": "sizeof (a)" + }, + { + "val": "Ternary conditional", + "key": "a ? b : c" + }, + { + "val": "Comma", + "key": "a, b" + } + ], + "Conversion Characters": [ + { + "val": "Displays single character", + "key": "%c" + }, + { + "val": "Displays signed decimal integer", + "key": "%d" + }, + { + "val": "Displays signed floating point value in E notation", + "key": "%e" + }, + { + "val": "Displays signed floating point value", + "key": "%f" + }, + { + "val": "Displays the string corresponding to the specified value of the system errno variable", + "key": "%m" + }, + { + "val": "Displays a string", + "key": "%s" + }, + { + "val": "Displays an unsigned integer", + "key": "%u" + }, + { + "val": "Displays an integer as an unsigned hexadecimal number, using lower-case letters", + "key": "%x" + }, + { + "val": "Displays a percent sign", + "key": "%%" + } + ], + "Escape Sequences": [ + { + "val": "The speaker beeping", + "key": "\\a" + }, + { + "val": "Backspace", + "key": "\\b" + }, + { + "val": "Form feed", + "key": "\\f" + }, + { + "val": "Newline character", + "key": "\\n" + }, + { + "val": "Carriage return (moves the cursor to the beginning of the line)", + "key": "\\r" + }, + { + "val": "Tab", + "key": "\\t" + }, + { + "val": "Vertical tab (moves the cursor down a line)", + "key": "\\v" + }, + { + "val": "The backslash character", + "key": "\\\\\\" + }, + { + "val": "The apostrophe", + "key": "\\'" + }, + { + "val": "The double-quote character", + "key": "\\\"" + }, + { + "val": "The question mark", + "key": "\\?" + }, + { + "val": "The “null” byte (backslash-zero)", + "key": "\\0" + } + ], + "Order of Precedence": [ + { + "val": "Primary Expression Operators - associativity goes from left to right", + "key": "[()], [\\[\\]], [.], [->], [expr++], [expr--]" + }, + { + "val": "Unary Operators - associativity goes from right to left", + "key": "[*], [&], [+], [-], [!], [~], [++expr], [--expr], [(typecast)], [sizeof]" + }, + { + "val": "Binary Operators - associativity goes from left to right", + "key": "[*], [/], [%], [+], [-], [>>], [<<], [<], [>], [<=], [>=], [==], [!=], [&], [^], [|], [&&], [||]" + }, + { + "val": "Ternary Operator - associativity goes from right to left", + "key": "[?:]" + }, + { + "val": "Assignment Operators - associativity goes from right to left", + "key": "[=], [+=], [-=], [*=], [/=], [%=], [>>=], [<<=], [&=], [^=], [|=]" + }, + { + "val": "Comma - associativity goes from left to right", + "key": "[ , ]" + } + ] } } From c6821c07a7bffa3ee9b9605dd0daeb958632cf0d Mon Sep 17 00:00:00 2001 From: mohan08p Date: Fri, 30 Oct 2015 13:49:28 +0000 Subject: [PATCH 039/379] examples transfrom to generalized form --- share/goodie/cheat_sheets/json/mongodb.json | 158 ++++++++++---------- 1 file changed, 78 insertions(+), 80 deletions(-) diff --git a/share/goodie/cheat_sheets/json/mongodb.json b/share/goodie/cheat_sheets/json/mongodb.json index 7fffc3176..0cc0754d7 100644 --- a/share/goodie/cheat_sheets/json/mongodb.json +++ b/share/goodie/cheat_sheets/json/mongodb.json @@ -1,34 +1,40 @@ { "id": "mongodb_cheat_sheet", "name": "MongoDB", - "templete_type": "code", "description": "Mongo shell", "metadata": { "sourceName": "MongoDB - Cheat Sheet", "sourceUrl": "https://blog.codecentric.de/files/2012/12/MongoDB-CheatSheet-v1_0.pdf" }, + "aliases": [ + "mongodb", + "mongo db", + "mongodb commands", + "mongo db shell" + ], + "template_type": "terminal", "section_order": [ - "Basic Conceptes & Shell Commands", - "BSON Types", + "Basic Conceptes & Shell Commands", + "BSON Types", "Inserting Documents", "Finding Documents", "Finding Documents using Operators", - "Updating Documents", - "Removing Documents", + "Updating Documents", + "Removing Documents", "Working with Indexes", "Indexes - Hints & Stats", "Top & Stats System Commands", "Pipeline Stages", - "Comparison with SQL", - "Replica Sets", + "Comparison with SQL", + "Replica Sets", "Sharding", "Durability of Writes" ], "sections": { "Basic Conceptes & Shell Commands": [ { - "key": "db.ships.", - "val": "db – used for database, ships – used for collection" + "key": "db.collection.", + "val": "db – implicit handle to the used database, collection – name of the used collection" }, { "key": "use ", @@ -48,14 +54,14 @@ "key": "Double", "val": "1" }, - { + { "key": "String", "val": "2" }, - { + { "key": "Object", "val": "3" - }, + }, { "key": "Array", "val": "4" @@ -64,15 +70,15 @@ "key": "Binary Data", "val": "5" }, - { + { "key": "Undefined", - "val": "6(Deprecated)" + "val": "6 (Deprecated)" }, - { + { "key": "Obect Id", "val": "7" }, - { + { "key": "Boolean", "val": "8" }, @@ -85,121 +91,113 @@ "val": "10" } ], - "Inserting Documents": [ + "Inserting Documents": [ { - "key": "db.ships.insert(\\{name:'USS Enterprise-D',operator:'Starfleet',type:'Explorer',class:'Galaxy',crew:750,codes:\\[10,11,12\\]\\})", - "val": "Insert into Ships collection Example 1" - }, - { - "key": "db.ships.insert(\\{name:'IKS Buruk',operator:' Klingon Empire',class:'Warship',crew:40,codes:\\[100,110,120\\]\\})", - "val": "Insert into Ships collection Example 2" - }, - { - "key": "db.ships.insert(\\{name:'Narada',operator:'Romulan Star Empire',type:'Warbird',class:'Warbird',crew:65,codes:\\[251,251,220\\]\\})", - "val": "Insert into Ships collection Example 3" + "key": "db.collection.insert(,\\{keys,options\\})", + "val": "Insert a document or documents into collection" } ], "Finding Documents": [ { - "key": "db.ships.findOne()", + "key": "db.collection.findOne()", "val": "Finds one arbitrary document" }, { - "key": "db.ships.find().prettyPrint()", + "key": "db.collection.find().prettyPrint()", "val": "Finds all documents and using nice formatting" }, { - "key": "db.ships.find(\\{\\}, \\{name:true, _id:false\\})", - "val": "Shows only the names of the ships collections" + "key": "db.collection.find(\\{\\}, \\{key:true, _id:false\\})", + "val": "Shows only the respective key of the collection" }, { - "key": "db.ships.findOne(\\{'name':'USS Defiant'\\})", + "key": "db.collection.findOne(\\{'key':'value'\\})", "val": "Finds one document by corresponding attribute" } ], "Finding Documents using Operators": [ { - "key": "$gt \/ $gte", - "val": "(greater than / greater than equals) : db.ships.find(\\{class:\\{$gt:’P'\\}\\})" + "key": "db.collection.find(\\{class:\\{$gt:’P'\\}\\})", + "val": "Greater than / greater than equals" }, { - "key": "$lt \/ $lte", - "val": "(lesser than / lesser than equals) : db.ships.find({class:{$lte:’P'}})" + "key": "db.collection.find(\\{class:\\{$lte:’P'\\}\\})", + "val": "Lesser than / lesser than equals" }, { - "key": "$exists", - "val": "(does an attribute exist or not) : db.ships.find({type:{$exists:true}})" + "key": "db.collection.find(\\{type:\\{$exists:true\\}\\})", + "val": "Does an attribute exist or not" }, { - "key": "$regex", - "val": "(Perl-style pattern matching) : db.ships.find({name:{$regex:’^USS\\sE’}})" + "key": "db.collection.find(\\{name:\\{$regex:’^USS\\sE’\\}\\})", + "val": "Perl-style pattern matching" }, { - "key": "$type", - "val": "(search by type of an element) : db.ships.find({name : {$type:2}})" + "key": "db.collection.find(\\{name:\\{$type:2\\}\\})", + "val": "Search by type of an element" } ], "Updating Documents": [ { - "key": "db.ships.update(\\{name : 'USS Prometheus'\\}, \\{name : 'USS Something'\\})", + "key": "db.ships.update(\\{key1:value1\\}, \\{key2:value2\\})", "val": "Replaces the whole document" }, { - "key": "db.ships.update(\\{name : 'USS Something'\\},\\{$set : \\{operator : 'Starfleet', class : 'Prometheus'\\}\\})", + "key": "db.collection.update(\\{key:value\\},\\{$set : \\{operator:opt, class:c\\}\\})", "val": "sets / changes certain attributes of a given document" }, { - "key": "db.ships.update(\\{name : 'USS Something'\\},\\{$unset : \\{operator : 1\\}\\})", + "key": "db.collection.update(\\{key:value\\},\\{$unset : \\{operator : 1\\}\\})", "val": "removes an attribute from a given document" } ], "Removing Documents": [ { - "key": "db.ships.remove(\\{name : 'USS Prometheus'\\})", + "key": "db.collection.remove(\\{key:value\\})", "val": "removes the document" }, { - "key": "db.ships.remove(\\{name:\\{$regex:’^USS\\sE’\\}\\})", + "key": "db.collection.remove(\\{key:\\{$regex:’^USS\\sE’\\}\\})", "val": "removes using operator" } ], "Working with Indexes": [ { - "key": "db.ships.ensureIndex(\\{name : 1\\})", + "key": "db.collection.ensureIndex(keys, options)", "val": "Creating an index" }, { - "key": "db.ships.dropIndex(\\{name : 1\\})", + "key": "db.collection.dropIndex(keys, options)", "val": "Dropping an index" }, { - "key": "db.ships.ensureIndex(\\{name : 1, operator : 1, class : 0\\})", + "key": "db.collection.ensureIndex(keys, options)", "val": "Creating a compound index" }, { - "key": "db.ships.dropIndex(\\{name : 1, operator : 1, class : 0\\})", + "key": "db.collection.dropIndex(\\{keys, options)", "val": "Dropping a compound index" }, { - "key": "db.ships.ensureIndex(\\{name : 1, operator : 1, class : 0\\}, \\{unique : true\\})", + "key": "db.collection.ensureIndex(keys, options, \\{unique : true\\})", "val": "Creating a unique compound index" } ], "Indexes - Hints & Stats": [ { - "key": "db.ships.find (\\{'name':'USS Defiant'\\}).explain()", + "key": "db.collection.find (\\{key:value\\}).explain()", "val": "Explains index usage" }, { - "key": "db.ships.stats()", + "key": "db.collection.stats()", "val": "Index statistics" }, { - "key": "db.ships.totalIndexSize()", + "key": "db.collection.totalIndexSize()", "val": "Index size" } ], - "Top & Stats System Commands": [ + "Top & Stats System Commands": [ { "key": "./mongotop", "val": "Shows time spent per operations per collection" @@ -209,7 +207,7 @@ "val": "Shows snapshot on the MongoDB system" } ], - "Pipeline Stages": [ + "Pipeline Stages": [ { "key": "$project", "val": "Change the set of documents by modifying keys and values. This is a 1:1 mapping." @@ -218,15 +216,15 @@ "key": "$match", "val": "This is a filtering operation and thus this can reduce the amount of documents that are given as input to the next stage. This can be used for example if aggregation should only happen on a subset of the data." }, - { + { "key": "$group", "val": "This does the actual aggregation and as we are grouping by one or more keys this can have a reducing effect on the amount of documents." }, - { + { "key": "$sort", "val": "Sorting the documents one way or the other for the next stage. It should be noted that this might use a lot of memory. Thus if possible one should always try to reduce the amount of documents first." }, - { + { "key": "$skip", "val": "With this it is possible to skip forward in the list of documents for a given amount of documents. This allows for example starting only from the 10th document. Typically this will be used together with “$sort” and especially together with “$limit”." }, @@ -234,12 +232,12 @@ "key": "$limit", "val": "This limits the amount of documents to look at by the given number starting from the current position." }, - { + { "key": "$unwind", "val": "This is used to unwind document that are using arrays. When using an array the data is kind of pre-joined and this operation will be undone with this to have individual documents again. Thus with this stage we will increase the amount of documents for the next stage." } ], - "Comparison with SQL": [ + "Comparison with SQL": [ { "key": "$match", "val": "WHERE" @@ -248,15 +246,15 @@ "key": "$group", "val": "GROUP BY" }, - { + { "key": "$match", "val": "HAVING" }, - { + { "key": "$project", "val": "SELECT" }, - { + { "key": "$sort", "val": "ORDER BY" }, @@ -264,20 +262,20 @@ "key": "$limit", "val": "LIMIT" }, - { + { "key": "$sum", "val": "SUM" }, - { + { "key": "$sum", "val": "COUNT" }, - { + { "key": "$unwind", "val": "JOIN" } ], - "Replica Sets": [ + "Replica Sets": [ { "key": "Regular", "val": "This is the most typical kind of node. It can act as a primary or secondary node" @@ -286,16 +284,16 @@ "key": "Arbiter", "val": "Arbiter nodes are only there for voting purposes. They can be used to ensure that there is a certain amount of nodes in a replica set even though there are not that many physical servers." }, - { + { "key": "Delayed", "val": "Often used as a disaster recovery node. The data stored here is usually a few hours behind the real working data." }, - { + { "key": "Hidden", "val": "Often used for analytics in the replica set." } ], - "Sharding": [ + "Sharding": [ { "key": "1", "val": "Every document has to define a shard-key." @@ -304,24 +302,24 @@ "key": "2", "val": "The value of the shard-key is immutable." }, - { + { "key": "3", "val": "The shard-key must be part of an index and it must be the first field in that index." }, - { + { "key": "4", "val": "There can be no unique index unless the shard-key is part of it and is then the first field." }, - { + { "key": "5", "val": "Reads done without specifying the shard-key will lead to requests to all the different shards." }, - { + { "key": "6", "val": "The shard-key must offer sufficient cardinality to be able to utilize all shards." } ], - "Durability of Writes": [ + "Durability of Writes": [ { "key": "w=0 && j=0", "val": "This is “fire and forget”." @@ -330,14 +328,14 @@ "key": "w=1 && j=0", "val": "Waits for an acknowledgement that the write was received and no indexes have been violated. Data can still be lost." }, - { + { "key": "w=1 && j=1", "val": "The most save configuration by waiting for the write to the journal to be completed" }, - { + { "key": "w=0 && j=1", "val": "Basically as same as above." } ] - } + } } \ No newline at end of file From 66ac6467c0347af767cf46233d6fdcd525810a57 Mon Sep 17 00:00:00 2001 From: Mohan Pawar Date: Fri, 30 Oct 2015 19:40:29 +0530 Subject: [PATCH 040/379] transfrom examples into generalized form I convert all the examples of the command into its respective generalized form. --- share/goodie/cheat_sheets/json/mongodb.json | 174 +++++++++++--------- 1 file changed, 95 insertions(+), 79 deletions(-) diff --git a/share/goodie/cheat_sheets/json/mongodb.json b/share/goodie/cheat_sheets/json/mongodb.json index 8d340e380..612fafa7f 100644 --- a/share/goodie/cheat_sheets/json/mongodb.json +++ b/share/goodie/cheat_sheets/json/mongodb.json @@ -7,28 +7,35 @@ "sourceName": "MongoDB - Cheat Sheet", "sourceUrl": "https://blog.codecentric.de/files/2012/12/MongoDB-CheatSheet-v1_0.pdf" }, + "aliases": [ + "mongodb", + "mongo db", + "mongodb commands", + "mongo db shell" + ], + "template_type": "terminal", "section_order": [ - "Basic Conceptes & Shell Commands", - "BSON Types", + "Basic Conceptes & Shell Commands", + "BSON Types", "Inserting Documents", "Finding Documents", "Finding Documents using Operators", - "Updating Documents", - "Removing Documents", + "Updating Documents", + "Removing Documents", "Working with Indexes", "Indexes - Hints & Stats", "Top & Stats System Commands", "Pipeline Stages", - "Comparison with SQL", - "Replica Sets", + "Comparison with SQL", + "Replica Sets", "Sharding", "Durability of Writes" ], "sections": { "Basic Conceptes & Shell Commands": [ { - "key": "db.ships.", - "val": "db – implicit handle to the used database, ships – name of the used collection" + "key": "db.collection.", + "val": "db – implicit handle to the used database, collection – name of the used collection" }, { "key": "use ", @@ -48,14 +55,14 @@ "key": "Double", "val": "1" }, - { + { "key": "String", "val": "2" }, - { + { "key": "Object", "val": "3" - }, + }, { "key": "Array", "val": "4" @@ -64,15 +71,15 @@ "key": "Binary Data", "val": "5" }, - { + { "key": "Undefined", - "val": "6(Deprecated)" + "val": "6 (Deprecated)" }, - { + { "key": "Obect Id", "val": "7" }, - { + { "key": "Boolean", "val": "8" }, @@ -85,121 +92,130 @@ "val": "10" } ], - "Inserting Documents": [ + "Inserting Documents": [ { - "key": "db.ships.insert(\\{name:'USS Enterprise-D',operator:'Starfleet',type:'Explorer',class:'Galaxy',crew:750,codes:\\[10,11,12\\]\\})", - "val": "Insert into Ships collection Example 1" - }, - { - "key": "db.ships.insert(\\{name:'IKS Buruk',operator:' Klingon Empire',class:'Warship',crew:40,codes:\\[100,110,120\\]\\})", - "val": "Insert into Ships collection Example 2" - }, - { - "key": "db.ships.insert(\\{name:'Narada',operator:'Romulan Star Empire',type:'Warbird',class:'Warbird',crew:65,codes:\\[251,251,220\\]\\})", - "val": "Insert into Ships collection Example 3" + "key": "db.collection.insert(,\\{keys,options\\})", + "val": "Insert a document or documents into collection" } ], "Finding Documents": [ { - "key": "db.ships.findOne()", + "key": "db.collection.findOne()", "val": "Finds one arbitrary document" }, { - "key": "db.ships.find().prettyPrint()", + "key": "db.collection.find().prettyPrint()", "val": "Finds all documents and using nice formatting" }, { - "key": "db.ships.find(\\{\\}, \\{name:true, _id:false\\})", - "val": "Shows only the names of the ships collections" + "key": "db.collection.find(\\{\\}, \\{key:true, _id:false\\})", + "val": "Shows only the respective key of the collection" }, { - "key": "db.ships.findOne(\\{'name':'USS Defiant'\\})", + "key": "db.collection.findOne(\\{'key':'value'\\})", "val": "Finds one document by corresponding attribute" } ], "Finding Documents using Operators": [ { - "key": "$gt \/ $gte", - "val": "(greater than / greater than equals) : db.ships.find(\\{class:\\{$gt:’P'\\}\\})" + "key": "db.collection.find(\\{class:\\{$gt:’P'\\}\\})", + "val": "Greater than / greater than equals" }, { - "key": "$lt \/ $lte", - "val": "(lesser than / lesser than equals) : db.ships.find({class:{$lte:’P'}})" + "key": "db.collection.find(\\{class:\\{$lte:’P'\\}\\})", + "val": "Lesser than / lesser than equals" }, { - "key": "$exists", - "val": "(does an attribute exist or not) : db.ships.find({type:{$exists:true}})" + "key": "db.collection.find(\\{type:\\{$exists:true\\}\\})", + "val": "Does an attribute exist or not" }, { - "key": "$regex", - "val": "(Perl-style pattern matching) : db.ships.find({name:{$regex:’^USS\\sE’}})" + "key": "db.collection.find(\\{name:\\{$regex:’^USS\\sE’\\}\\})", + "val": "Perl-style pattern matching" }, { - "key": "$type", - "val": "(search by type of an element) : db.ships.find({name : {$type:2}})" + "key": "db.collection.find(\\{name:\\{$type:2\\}\\})", + "val": "Search by type of an element" } ], "Updating Documents": [ { - "key": "db.ships.update(\\{name : 'USS Prometheus'\\}, \\{name : 'USS Something'\\})", + "key": "db.ships.update(\\{key1:value1\\}, \\{key2:value2\\})", "val": "Replaces the whole document" }, { - "key": "db.ships.update(\\{name : 'USS Something'\\},\\{$set : \\{operator : 'Starfleet', class : 'Prometheus'\\}\\})", + "key": "db.collection.update(\\{key:value\\},\\{$set : \\{operator:opt, class:c\\}\\})", "val": "sets / changes certain attributes of a given document" }, { - "key": "db.ships.update(\\{name : 'USS Something'\\},\\{$unset : \\{operator : 1\\}\\})", + "key": "db.collection.update(\\{key:value\\},\\{$unset : \\{operator : 1\\}\\})", "val": "removes an attribute from a given document" } ], "Removing Documents": [ { - "key": "db.ships.remove(\\{name : 'USS Prometheus'\\})", + "key": "db.collection.remove(\\{key:value\\})", "val": "removes the document" }, { - "key": "db.ships.remove(\\{name:\\{$regex:’^USS\\sE’\\}\\})", + "key": "db.collection.remove(\\{key:\\{$regex:’^USS\\sE’\\}\\})", "val": "removes using operator" } ], "Working with Indexes": [ { - "key": "db.ships.ensureIndex(keys, options)", + "key": "db.collection.ensureIndex(keys, options)", "val": "Creating an index" }, { - "key": "db.ships.dropIndex(keys, options)", + "key": "db.collection.dropIndex(keys, options)", "val": "Dropping an index" }, { - "key": "db.ships.ensureIndex(keys, options)", + "key": "db.collection.ensureIndex(keys, options)", "val": "Creating a compound index" }, { - "key": "db.ships.dropIndex(\\{keys, options)", + "key": "db.collection.dropIndex(\\{keys, options)", "val": "Dropping a compound index" }, { - "key": "db.ships.ensureIndex(keys, options, \\{unique : true\\})", + "key": "db.collection.ensureIndex(keys, options, \\{unique : true\\})", + "key": "db.collection.ensureIndex(keys, options)", + "val": "Creating an index" + }, + { + "key": "db.collection.dropIndex(keys, options)", + "val": "Dropping an index" + }, + { + "key": "db.collection.ensureIndex(keys, options)", + "val": "Creating a compound index" + }, + { + "key": "db.collection.dropIndex(\\{keys, options)", + "val": "Dropping a compound index" + }, + { + "key": "db.collection.ensureIndex(keys, options, \\{unique : true\\})", "val": "Creating a unique compound index" } ], "Indexes - Hints & Stats": [ { - "key": "db.ships.find (\\{'name':'USS Defiant'\\}).explain()", + "key": "db.collection.find (\\{key:value\\}).explain()", "val": "Explains index usage" }, { - "key": "db.ships.stats()", + "key": "db.collection.stats()", "val": "Index statistics" }, { - "key": "db.ships.totalIndexSize()", + "key": "db.collection.totalIndexSize()", "val": "Index size" } ], - "Top & Stats System Commands": [ + "Top & Stats System Commands": [ { "key": "./mongotop", "val": "Shows time spent per operations per collection" @@ -209,7 +225,7 @@ "val": "Shows snapshot on the MongoDB system" } ], - "Pipeline Stages": [ + "Pipeline Stages": [ { "key": "$project", "val": "Change the set of documents by modifying keys and values. This is a 1:1 mapping." @@ -218,15 +234,15 @@ "key": "$match", "val": "This is a filtering operation and thus this can reduce the amount of documents that are given as input to the next stage. This can be used for example if aggregation should only happen on a subset of the data." }, - { + { "key": "$group", "val": "This does the actual aggregation and as we are grouping by one or more keys this can have a reducing effect on the amount of documents." }, - { + { "key": "$sort", "val": "Sorting the documents one way or the other for the next stage. It should be noted that this might use a lot of memory. Thus if possible one should always try to reduce the amount of documents first." }, - { + { "key": "$skip", "val": "With this it is possible to skip forward in the list of documents for a given amount of documents. This allows for example starting only from the 10th document. Typically this will be used together with “$sort” and especially together with “$limit”." }, @@ -234,12 +250,12 @@ "key": "$limit", "val": "This limits the amount of documents to look at by the given number starting from the current position." }, - { + { "key": "$unwind", "val": "This is used to unwind document that are using arrays. When using an array the data is kind of pre-joined and this operation will be undone with this to have individual documents again. Thus with this stage we will increase the amount of documents for the next stage." } ], - "Comparison with SQL": [ + "Comparison with SQL": [ { "key": "$match", "val": "WHERE" @@ -248,15 +264,15 @@ "key": "$group", "val": "GROUP BY" }, - { + { "key": "$match", "val": "HAVING" }, - { + { "key": "$project", "val": "SELECT" }, - { + { "key": "$sort", "val": "ORDER BY" }, @@ -264,20 +280,20 @@ "key": "$limit", "val": "LIMIT" }, - { + { "key": "$sum", "val": "SUM" }, - { + { "key": "$sum", "val": "COUNT" }, - { + { "key": "$unwind", "val": "JOIN" } ], - "Replica Sets": [ + "Replica Sets": [ { "key": "Regular", "val": "This is the most typical kind of node. It can act as a primary or secondary node" @@ -286,16 +302,16 @@ "key": "Arbiter", "val": "Arbiter nodes are only there for voting purposes. They can be used to ensure that there is a certain amount of nodes in a replica set even though there are not that many physical servers." }, - { + { "key": "Delayed", "val": "Often used as a disaster recovery node. The data stored here is usually a few hours behind the real working data." }, - { + { "key": "Hidden", "val": "Often used for analytics in the replica set." } ], - "Sharding": [ + "Sharding": [ { "key": "1", "val": "Every document has to define a shard-key." @@ -304,24 +320,24 @@ "key": "2", "val": "The value of the shard-key is immutable." }, - { + { "key": "3", "val": "The shard-key must be part of an index and it must be the first field in that index." }, - { + { "key": "4", "val": "There can be no unique index unless the shard-key is part of it and is then the first field." }, - { + { "key": "5", "val": "Reads done without specifying the shard-key will lead to requests to all the different shards." }, - { + { "key": "6", "val": "The shard-key must offer sufficient cardinality to be able to utilize all shards." } ], - "Durability of Writes": [ + "Durability of Writes": [ { "key": "w=0 && j=0", "val": "This is “fire and forget”." @@ -330,14 +346,14 @@ "key": "w=1 && j=0", "val": "Waits for an acknowledgement that the write was received and no indexes have been violated. Data can still be lost." }, - { + { "key": "w=1 && j=1", "val": "The most save configuration by waiting for the write to the journal to be completed" }, - { + { "key": "w=0 && j=1", "val": "Basically as same as above." } ] - } + } } From 516ac676bd8fe31175eedc68c4d45f053dffefd1 Mon Sep 17 00:00:00 2001 From: ankushg07 Date: Sat, 31 Oct 2015 13:37:57 +0000 Subject: [PATCH 041/379] Initial Commit --- share/goodie/cheat_sheets/vitamin.json | 78 ++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 share/goodie/cheat_sheets/vitamin.json diff --git a/share/goodie/cheat_sheets/vitamin.json b/share/goodie/cheat_sheets/vitamin.json new file mode 100644 index 000000000..eace4ab92 --- /dev/null +++ b/share/goodie/cheat_sheets/vitamin.json @@ -0,0 +1,78 @@ +{ + "id": "vitamin_cheat_sheet", + "name": "Vitamins", + "description": "benefits and source of each vitamin", + "metadata": { + "sourceName": "Wikipedia", + "sourceUrl": "https://en.wikipedia.org/wiki/Vitamin" + }, + "template_type": "reference", + "section_order":[ + "Source", + "Benefits" + ], + "sections":{ + "Source":[{ + "key":"Vitamin A", + "val":"Liver/fish/Milk/cheese" + },{ + "key":"Vitamin B1", + "val":"Grains/Liver/pork/dried beans/nuts" + },{ + "key":"Vitamin B2", + "val":"Soybeans/meat/poultry/liver/eggs" + },{ + "key":"Vitamin B3", + "val":"Mushrooms/Peanut butter/meat/fish," + },{ + "key":"Vitamin B6", + "val":"Potatoes/bananas" + },{ + "key":"Vitamin B12", + "val":"Milk/cheese/yogurt/fortified soy" + },{ + "key":"Vitamin C", + "val":"Citrus fruits" + },{ + "key":"Vitamin D", + "val":"fish/eggs/organ meats/fish/liver oils" + },{ + "key":"Vitamin E", + "val":"Vegetable oils/Avocados/leafy green vegetables" + },{ + "key":"Vitamin K", + "val":"Broccoli/soybeans/dark green leafy vegetables" + }], + "Benefits":[{ + "key":"Vitamin A", + "val":"Helps you to see in the day and at night." + },{ + "key":"Vitamin B1", + "val":"Helps with energy production in your body." + },{ + "key":"Vitamin B2", + "val":"Helps with energy production in your body." + },{ + "key":"Vitamin B3", + "val":"Helps your body to use protein, fat and carbohydrate to make energy" + },{ + "key":"Vitamin B6", + "val":"Helps form hemoglobin which carries oxygen" + },{ + "key":"Vitamin B12", + "val":"Helps to make healthy blood cells" + },{ + "key":"Vitamin C", + "val":"May help prevent cell damage and reduce risk for certain " + },{ + "key":"Vitamin D", + "val":"Making Bone & Teeth stronger and healthier" + },{ + "key":"Vitamin E", + "val":"Helps to maintain a healthy immune system" + },{ + "key":"Vitamin K", + "val":"Makes proteins that cause our blood to clot" + }] + } +} \ No newline at end of file From 0d60ac670f41706399649300e085a9a07c59ec9d Mon Sep 17 00:00:00 2001 From: ankushg07 Date: Sat, 31 Oct 2015 14:28:52 +0000 Subject: [PATCH 042/379] Initial commit --- share/goodie/cheat_sheets/kde-keyboard.json | 90 +++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 share/goodie/cheat_sheets/kde-keyboard.json diff --git a/share/goodie/cheat_sheets/kde-keyboard.json b/share/goodie/cheat_sheets/kde-keyboard.json new file mode 100644 index 000000000..83354dedd --- /dev/null +++ b/share/goodie/cheat_sheets/kde-keyboard.json @@ -0,0 +1,90 @@ +{ + "id": "kde_keyboard_cheat_sheet", + "name": "KDE Keyboard Shortcuts", + "description": "List of useful keyboard shortcuts for KDE", + "metadata": { + "sourceName": "KDE Help", + "sourceUrl": "http://community.linuxmint.com/tutorial/view/47" + }, + "template_type": "keyboard", + "section_order": ["Desktop Navigation", "Desktop Shortcuts", "ScreenShot" , "Web Browser" , "Tab Management"], + "sections": { + "Desktop Navigation": [{ + "val": "Start menu / Access applications", + "key": "[Alt] + [F1] " + }, { + "val": "Pop up new window", + "key": "[Alt] + [F2] " + }, { + "val": "Lock desktop / Switch active user", + "key": "[Ctrl] + [Alt] + [L] " + }, { + "val": "Show desktop", + "key": "[Ctrl] + [Alt] + [D] " + }, { + "val": "Task manager", + "key": "[Ctrl] + [Esc] " + }, { + "val": "Rename file", + "key": "[F2]" + }], + "Desktop Shortcuts": [{ + "val": "File menu", + "key": "[Alt] + [F] " + }, { + "val": "Edit menu", + "key": "[Alt] + [E] " + }, { + "val": "Copy selected text or items to the clipboard", + "key": "[Ctrl] + [C] " + }, { + "val": "View menu", + "key": "[Ctrl] + [V] " + }, { + "val": "Undo the last action", + "key": "[Ctrl] + [Z] " + }, { + "val": "Paste special", + "key": "[Ctrl] + [Shift] + [V] " + }], + "ScreenShot": [{ + "val": "Take a screenshot", + "key": "[Prnt Scrn]" + },{ + "val": "Take a screenshot of a Window", + "key": "[Shift] + [Prnt Scrn]" + }], + "Web Browser": [{ + "val": "Bookmarks menu", + "key": "[Alt] + [B] " + }, { + "val": "URL Shortcuts (Adds www. + .com)", + "key": "[Ctrl] + [Enter] " + }, { + "val": "URL Shortcuts (Adds www. + .org)", + "key": "[Ctrl] + [Shift] + [Enter]" + }, { + "val": "URL Shortcuts (Adds www. + .net)", + "key": "[Shift] + [Enter]" + }, { + "val": "Add a bookmark for the current location", + "key": "[Ctrl] + [B] " + }, { + "val": "Manage bookmarks", + "key": "[Ctrl] + [Shift] + [R] " + }], + "Tab Management": [{ + "val": "Create new tab", + "key": "[Ctrl] + [Shift] + [N]" + }, { + "val": "Close current tab", + "key": "[Ctrl] + [W] " + }, { + "val": "Go to next tab", + "key": "[Ctrl] + [,] " + }, { + "val": "Go to previous tab", + "key": "[Ctrl] + [.] " + }] + } +} \ No newline at end of file From 25c0fd029ceabd493f59c0200ba21075857980c5 Mon Sep 17 00:00:00 2001 From: abadojack Date: Fri, 6 Nov 2015 20:03:44 +0530 Subject: [PATCH 043/379] add apt-get.json --- share/goodie/cheat_sheets/json/apt-get.json | 90 +++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 share/goodie/cheat_sheets/json/apt-get.json diff --git a/share/goodie/cheat_sheets/json/apt-get.json b/share/goodie/cheat_sheets/json/apt-get.json new file mode 100644 index 000000000..0f36367f4 --- /dev/null +++ b/share/goodie/cheat_sheets/json/apt-get.json @@ -0,0 +1,90 @@ +{ + "id": "apt_get_cheat_sheet", + "name": "AptGet", + "description": "Package manager for Debian-based distros", + "metadata": { + "sourceName": "Ubuntu Wiki", + "sourceUrl": "https://help.ubuntu.com/community/AptGet/Howto" + }, + "template_type": "terminal", + "section_order": [ + "Installation commands", + "Maintenance commands", + "Removal commands", + "Search commands" + ], + "sections": { + "Installation commands": [ + { + "key": "Install a new package", + "val": "apt-get install " + }, + { + "key": "Install mutliple packages", + "val": "apt-get install " + } + ], + "Maintenance commands": [ + { + "key": "Update source list", + "val": "apt-get update" + }, + { + "key": "Upgrade all installed packages", + "val": "apt-get upgrade" + }, + { + "key": "Upgrade all installed packages with a 'smart' conflict resolution system", + "val": "apt-get dist-upgrade" + }, + { + "key": "Update package lists and check for broken dependencies", + "val": "apt-get check" + }, + { + "key": "Fix broken packages", + "val": "apt-get -f install" + }, + { + "key": "Remove all .deb files for packages that are no longer installed on the system", + "val": "apt-get autoclean" + }, + { + "key": "Remove all packages from the package cache", + "val": "apt-get clean" + } + ], + "Removal commands": [ + { + "key": "Remove an installed package, leaving configuration files intact", + "val": "apt-get remove " + }, + { + "key": "Completely remove a package and the associated configuration files", + "val": "apt-get purge " + }, + { + "key": "Remove package1 and install package2 in one step (+operator)", + "val": "apt-get remove +" + }, + { + "key": "Remove packages that were installed by other packages and are no longer needed", + "val": "apt-get autoremove" + }, + { + "key": "Removes an installed package and dependencies", + "val": "apt-get autoremove " + } + ], + "Search commands": [ + { + "key": "Find packages that include ", + "val": "apt-cache search " + }, + { + "key": "Shows the description of package and other relevant information including version, size, dependencies and conflicts", + "val": "apt-cache show " + } + ] + } +} From 1d9fbdef353bec40c14d6d304a8189d7cdec617f Mon Sep 17 00:00:00 2001 From: sublinear Date: Fri, 6 Nov 2015 17:13:37 +0000 Subject: [PATCH 044/379] initial commit --- lib/DDG/Goodie/NoteFrequency.pm | 88 +++++++++++++++++++++++++++++++++ t/NoteFrequency.t | 22 +++++++++ 2 files changed, 110 insertions(+) create mode 100644 lib/DDG/Goodie/NoteFrequency.pm create mode 100644 t/NoteFrequency.t diff --git a/lib/DDG/Goodie/NoteFrequency.pm b/lib/DDG/Goodie/NoteFrequency.pm new file mode 100644 index 000000000..fe26ae123 --- /dev/null +++ b/lib/DDG/Goodie/NoteFrequency.pm @@ -0,0 +1,88 @@ +package DDG::Goodie::NoteFrequency; +# ABSTRACT: Return the frequency (Hz) of the note given in the query + +use DDG::Goodie; +use strict; + +zci answer_type => "note_frequency"; +zci is_cached => 1; + +name "NoteFrequency"; +description "Calculate the frequency of a musical note"; +primary_example_queries "notefreq a4", "notefreq gb5"; +secondary_example_queries "notefreq c3 432"; +category "conversions"; +topics "music"; +code_url "https://github.com/duckduckgo/zeroclickinfo-goodies/blob/master/lib/DDG/Goodie/NoteFrequency.pm"; +attribution github => ["sublinear", "sublinear"]; + +# Triggers +triggers any => "notefreq", "notefrequency", "note frequency", "note frequency of", "frequency of note"; + +# Handle statement +handle remainder => sub { + + return unless $_; + + # must be a note letter, optional sharp or flat, octave number, and optional tuning frequency for A4 + # e.g. "g#3 432" + + if ( $_ =~ /^([A-Ga-g])([b#])?([0-8])(\s+[0-9]{1,5})?$/ ) { + + my( $letter, $accidental, $octave, $tuning, $pitchClass, $midi, $frequency ); + + # regex captures + if (defined $1) { $letter = uc($1); } else { $letter = ""; } + if (defined $2) { $accidental = $2; } else { $accidental = ""; } + if (defined $3) { $octave = $3 + 0; } else { $octave = 0; } + if (defined $4) { $tuning = $4 + 0; } else { $tuning = 0; } + + # assume 440Hz tuning unless otherwise specified + if ( $tuning == 0 ) { $tuning = 440; } + + # convert note letter to pitch class number + if ( $letter eq "C" ) { $pitchClass = 0; } + elsif ( $letter eq "D" ) { $pitchClass = 2; } + elsif ( $letter eq "E" ) { $pitchClass = 4; } + elsif ( $letter eq "F" ) { $pitchClass = 5; } + elsif ( $letter eq "G" ) { $pitchClass = 7; } + elsif ( $letter eq "A" ) { $pitchClass = 9; } + else { $pitchClass = 11; } + + # apply accidental to pitch class number + if ( $accidental eq "b" ) { $pitchClass -= 1; } + elsif ( $accidental eq "#" ) { $pitchClass += 1; } + + # calculate MIDI number + $midi = ( 12 * ($octave + 1) ) + $pitchClass; + + # fix pitch class number + $pitchClass %= 12; + + # validate note is between C0 and B8 + if ( $midi >= 12 && $midi <= 119 ) { + # calculate frequency + $frequency = $tuning * ( 2 ** (($midi-69)/12) ); + + # result + return $frequency, + structured_answer => { + input => [html_enc($letter.$accidental.$octave." in ".$tuning."Hz tuning")], + operation => "Note Frequency", + result => html_enc($frequency." Hz"), + }; + } + + # failed midi range validation + return; + } + + else { + + # failed regular expression + return; + + } +}; + +1; diff --git a/t/NoteFrequency.t b/t/NoteFrequency.t new file mode 100644 index 000000000..197f3b4ca --- /dev/null +++ b/t/NoteFrequency.t @@ -0,0 +1,22 @@ +#!/usr/bin/env perl + +use strict; +use warnings; +use Test::More; +use DDG::Test::Goodie; + +zci answer_type => "note_frequency"; +zci is_cached => 1; + +ddg_goodie_test( + [qw( DDG::Goodie::NoteFrequency )], + "notefreq a4" => test_zci("440"), + "notefreq gb5" => test_zci("739.988845423269"), + "notefreq c3 432" => test_zci("128.434368420294"), + "notefreq a4 100000" => undef, + "notefreq b#8" => undef, + "notefreq cb0" => undef, + "notefreq c9" => undef, +); + +done_testing; From ddd3e068c9c86f4581871b2bece992de7224e79f Mon Sep 17 00:00:00 2001 From: sublinear Date: Fri, 6 Nov 2015 21:41:18 +0000 Subject: [PATCH 045/379] updated structured_answer --- lib/DDG/Goodie/NoteFrequency.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/DDG/Goodie/NoteFrequency.pm b/lib/DDG/Goodie/NoteFrequency.pm index fe26ae123..efe3c9a70 100644 --- a/lib/DDG/Goodie/NoteFrequency.pm +++ b/lib/DDG/Goodie/NoteFrequency.pm @@ -67,7 +67,7 @@ handle remainder => sub { # result return $frequency, structured_answer => { - input => [html_enc($letter.$accidental.$octave." in ".$tuning."Hz tuning")], + input => [html_enc($letter.$accidental.$octave." in A".$tuning." tuning")], operation => "Note Frequency", result => html_enc($frequency." Hz"), }; From ae043a57430c4439ac760dc5bed9f46b91b57922 Mon Sep 17 00:00:00 2001 From: sublinear Date: Fri, 6 Nov 2015 22:43:59 +0000 Subject: [PATCH 046/379] updated test file and ensured all tests passing. --- lib/DDG/Goodie/NoteFrequency.pm | 6 +++--- t/NoteFrequency.t | 24 +++++++++++++++++++++--- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/lib/DDG/Goodie/NoteFrequency.pm b/lib/DDG/Goodie/NoteFrequency.pm index efe3c9a70..da3a024c5 100644 --- a/lib/DDG/Goodie/NoteFrequency.pm +++ b/lib/DDG/Goodie/NoteFrequency.pm @@ -33,9 +33,9 @@ handle remainder => sub { # regex captures if (defined $1) { $letter = uc($1); } else { $letter = ""; } - if (defined $2) { $accidental = $2; } else { $accidental = ""; } - if (defined $3) { $octave = $3 + 0; } else { $octave = 0; } - if (defined $4) { $tuning = $4 + 0; } else { $tuning = 0; } + if (defined $2) { $accidental = $2; } else { $accidental = ""; } + if (defined $3) { $octave = $3 + 0; } else { $octave = 0; } + if (defined $4) { $tuning = $4 + 0; } else { $tuning = 0; } # assume 440Hz tuning unless otherwise specified if ( $tuning == 0 ) { $tuning = 440; } diff --git a/t/NoteFrequency.t b/t/NoteFrequency.t index 197f3b4ca..d2dea6c45 100644 --- a/t/NoteFrequency.t +++ b/t/NoteFrequency.t @@ -10,9 +10,27 @@ zci is_cached => 1; ddg_goodie_test( [qw( DDG::Goodie::NoteFrequency )], - "notefreq a4" => test_zci("440"), - "notefreq gb5" => test_zci("739.988845423269"), - "notefreq c3 432" => test_zci("128.434368420294"), + "notefreq a4" => test_zci( + "440", + structured_answer => { + input => ["A4 in A440 tuning"], + operation => "Note Frequency", + result => "440 Hz" + }), + "notefreq gb5" => test_zci( + "739.988845423269", + structured_answer => { + input => ["Gb5 in A440 tuning"], + operation => "Note Frequency", + result => "739.988845423269 Hz" + }), + "notefreq c3 432" => test_zci( + "128.434368420294", + structured_answer => { + input => ["C3 in A432 tuning"], + operation => "Note Frequency", + result => "128.434368420294 Hz" + }), "notefreq a4 100000" => undef, "notefreq b#8" => undef, "notefreq cb0" => undef, From 57bf4bca5b2580dc1546f1125e23be2ac36e0323 Mon Sep 17 00:00:00 2001 From: abadojack Date: Sat, 7 Nov 2015 08:07:04 +0530 Subject: [PATCH 047/379] swap contents of key and val --- share/goodie/cheat_sheets/json/apt-get.json | 64 ++++++++++----------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/share/goodie/cheat_sheets/json/apt-get.json b/share/goodie/cheat_sheets/json/apt-get.json index 0f36367f4..7e40332a6 100644 --- a/share/goodie/cheat_sheets/json/apt-get.json +++ b/share/goodie/cheat_sheets/json/apt-get.json @@ -16,74 +16,74 @@ "sections": { "Installation commands": [ { - "key": "Install a new package", - "val": "apt-get install " + "val": "Install a new package", + "key": "apt-get install " }, { - "key": "Install mutliple packages", - "val": "apt-get install " + "val": "Install mutliple packages", + "key": "apt-get install " } ], "Maintenance commands": [ { - "key": "Update source list", - "val": "apt-get update" + "val": "Update source list", + "key": "apt-get update" }, { - "key": "Upgrade all installed packages", - "val": "apt-get upgrade" + "val": "Upgrade all installed packages", + "key": "apt-get upgrade" }, { - "key": "Upgrade all installed packages with a 'smart' conflict resolution system", - "val": "apt-get dist-upgrade" + "val": "Upgrade all installed packages with a 'smart' conflict resolution system", + "key": "apt-get dist-upgrade" }, { - "key": "Update package lists and check for broken dependencies", - "val": "apt-get check" + "val": "Update package lists and check for broken dependencies", + "key": "apt-get check" }, { - "key": "Fix broken packages", - "val": "apt-get -f install" + "val": "Fix broken packages", + "key": "apt-get -f install" }, { - "key": "Remove all .deb files for packages that are no longer installed on the system", - "val": "apt-get autoclean" + "val": "Remove all .deb files for packages that are no longer installed on the system", + "key": "apt-get autoclean" }, { - "key": "Remove all packages from the package cache", - "val": "apt-get clean" + "val": "Remove all packages from the package cache", + "key": "apt-get clean" } ], "Removal commands": [ { - "key": "Remove an installed package, leaving configuration files intact", - "val": "apt-get remove " + "val": "Remove an installed package, leaving configuration files intact", + "key": "apt-get remove " }, { - "key": "Completely remove a package and the associated configuration files", - "val": "apt-get purge " + "val": "Completely remove a package and the associated configuration files", + "key": "apt-get purge " }, { - "key": "Remove package1 and install package2 in one step (+operator)", - "val": "apt-get remove +" + "val": "Remove package1 and install package2 in one step (+operator)", + "key": "apt-get remove +" }, { - "key": "Remove packages that were installed by other packages and are no longer needed", - "val": "apt-get autoremove" + "val": "Remove packages that were installed by other packages and are no longer needed", + "key": "apt-get autoremove" }, { - "key": "Removes an installed package and dependencies", - "val": "apt-get autoremove " + "val": "Removes an installed package and dependencies", + "key": "apt-get autoremove " } ], "Search commands": [ { - "key": "Find packages that include ", - "val": "apt-cache search " + "val": "Find packages that include ", + "key": "apt-cache search " }, { - "key": "Shows the description of package and other relevant information including version, size, dependencies and conflicts", - "val": "apt-cache show " + "val": "Shows the description of package and other relevant information including version, size, dependencies and conflicts", + "key": "apt-cache show " } ] } From 3353706cf4f87b1e4b538908b8d1518b1c894077 Mon Sep 17 00:00:00 2001 From: jophab Date: Sat, 7 Nov 2015 10:09:46 +0000 Subject: [PATCH 048/379] Description of your changes --- share/goodie/cheat_sheets/json/c.json | 251 ++++++++ share/goodie/cheat_sheets/json/del.json | 195 ------ share/goodie/cheat_sheets/json/octave.json | 658 +-------------------- 3 files changed, 271 insertions(+), 833 deletions(-) create mode 100644 share/goodie/cheat_sheets/json/c.json delete mode 100644 share/goodie/cheat_sheets/json/del.json diff --git a/share/goodie/cheat_sheets/json/c.json b/share/goodie/cheat_sheets/json/c.json new file mode 100644 index 000000000..2fe276786 --- /dev/null +++ b/share/goodie/cheat_sheets/json/c.json @@ -0,0 +1,251 @@ +{ + "id":"c_cheat_sheet", + "name":"C", + "description":"C is a general-purpose, procedural, imperative computer programming language developed in 1972 by Dennis M. Ritchie at the Bell Laboratories", + "metadata":{ + "sourceName":"utexas", + "sourceUrl":"http://users.ece.utexas.edu/~adnan/c-refcard.pdf" + }, + "template_type":"reference", + "section_order":[ + "C Preprocessor", + "Fundamental Data Types", + "Conversion Characters", + "Storage Classes", + "Initialization", + "Arithmetic Operators", + "Relational Operators", + "Logical Operators", + "Bitwise Operators", + "Pointers" + + ], + "aliases":[ + "c programming" + + ], + "sections":{ + "C Preprocessor":[ + { + "key":"#include ", + "val":"Include library file" + }, + { + "key":"#include \"filename\"", + "val":"Include user file" + }, + { + "key":"#define name text", + "val":"Replacement text" + }, + { + "key":"#define name(var) text", + "val":"Replacement macro" + }, + + { + "key":"#undef name", + "val":"Undefine" + }, + + { + "key":"#if, #else, #elif, #endif", + "val":"Conditional execution" + } + ], + "Fundamental Data Types":[ + + { + "key":"char", + "val":"Character (1 byte)" + }, + + { + "key":"int", + "val":"Integer " + }, + { + "key":"float", + "val":"Float (single precision)" + }, + { + "key":"double", + "val":"Float (double precision)" + }, + { + "key":"void", + "val":"No value" + } + + + ], + "Conversion Characters":[ + { + "key":"%c", + "val":"Single character" + }, + { + "key":"%d", + "val":"Signed decimal integer (int)" + }, + { + "key":"%f", + "val":"Signed floating-point value (float)" + }, + { + "key":"%s", + "val":"String of text" + }, + { + "key":"%o", + "val":"Unsigned octal (base 8) integer" + } + ], + "Storage Classes":[ + { + "key":"auto", + "val":"Default storage class for all local variables" + }, + { + "key":"register", + "val":"Define local variables that should be stored in a register instead of RAM" + }, + { + "key":"static", + "val":"Maintains values of variables between function calls" + }, + { + "key":"extern", + "val":"To give a reference of a global variable that is visible to all the program files" + } + ], + "Arithmetic Operators":[ + { + "key":"+", + "val":"Adds two operands" + }, + { + "key":"−", + "val":"Subtracts second operand from the first" + }, + { + "key":"*", + "val":"Multiplies both operands" + }, + { + "key":"/", + "val":"Divides numerator by de-numerator" + }, + { + "key":"%", + "val":"Modulus Operator" + }, + { + "key":"++", + "val":"Increases the integer value by one" + }, + { + "key":"--", + "val":"Decreases the integer value by one" + } + ], + "Relational Operators":[ + { + "key":"==", + "val":"Checks for equality between operands" + }, + { + "key":"!=", + "val":"Checks for non equality between operands" + }, + { + "key":">", + "val":"Checks if the value of left operand is greater than the value of right operand. If yes, then the condition becomes true." + }, + { + "key":"<", + "val":"Checks if the value of left operand is less than the value of right operand. If yes, then the condition becomes true." + }, + { + "key":">=", + "val":"Checks if the value of left operand is greater than or equal to the value of right operand. If yes, then the condition becomes true." + }, + { + "key":"<=", + "val":"Checks if the value of left operand is less than or equal to the value of right operand. If yes, then the condition becomes true." + } + ], + "Logical Operators":[ + { + "key":"&&", + "val":"Logical AND operator" + }, + { + "key":"||", + "val":"Logical OR Operator" + }, + { + "key":"!", + "val":"Logical NOT Operator" + } + ], + "Bitwise Operators":[ + { + "key":"&", + "val":"Does the logical AND on the bits in the corresponding position of the operands in its binary form" + }, + { + "key":"|", + "val":"Does the logical OR on the bits in the corresponding position of the operands in its binary form" + }, + { + "key":"^", + "val":"Does XOR on the bits in the corresponding position of the operands in its binary form" + }, + { + "key":"~", + "val":"Inverts all the bits of operand" + }, + { + "key":"<<", + "val":"Takes two numbers, left shifts the bits of first operand, the second operand decides the number of places to shift" + }, + { + "key":">>", + "val":"Takes two numbers, right shifts the bits of first operand, the second operand decides the number of places to shift" + } + ], + "Pointers":[ + { + "key":"type *name", + "val":"Declare pointer to type" + }, + { + "key":"type *f()", + "val":"Declare function returning pointer to type" + }, + { + "key":"type (*pf)()", + "val":"Declare pointer to function returning type" + }, + { + "key":"void *", + "val":"Generic pointer type" + } + ], + "Initialization":[ + { + "key":"type name=value", + "val":"Initialize variable" + }, + { + "key":"type name[]={value1,. . . }", + "val":"Initialize array" + }, + { + "key":"char name[]=\"string\"", + "val":"Initialize char string" + } + ] + } +} diff --git a/share/goodie/cheat_sheets/json/del.json b/share/goodie/cheat_sheets/json/del.json deleted file mode 100644 index fa4f5d552..000000000 --- a/share/goodie/cheat_sheets/json/del.json +++ /dev/null @@ -1,195 +0,0 @@ -{ - "id": "sql_statements", - "name": "SQL Statements", - "description": "SQL is a standard language for accessing and manipulating databases.", - "metadata": { - "sourceName": "sql", - "sourceUrl": "http://www.w3schools.com/sql" - }, - - "template_type": "reference", - "section_order": [ - - "Statements - Syntax" - ], - "aliases": [ - "sql syntax", - "sql statements" - ], - - "sections": { - "Statements - Syntax":[ - { - "key": "CREATE TABLE", - "val":{ "CREATE TABLE table_name ( column_name1 data_type,column_name2 data_type,...)","CREATE TABLE table_name ( column_name1 data_type,column_name2 data_type,...)6776"} - - }, - - { - "key": "SELECT", - "val": "SELECT column_name(s) FROM table_name" - }, - - { - "key": "SELECT *", - "val": "SELECT * FROM table_name" - }, - - { - "key": "SELECT DISTINCT", - "val": "SELECT DISTINCT column_name(s) FROM table_name" - }, - - { - "key": "INSERT INTO", - "val": " INSERT INTO table_name VALUES (value1, value2, value3,....), INSERT INTO table_name (column1, column2, column3,...) VALUES (value1, value2, value3,....)" - }, - - { - "key": "WHERE", - "val": "SELECT column_name(s) FROM table_name WHERE column_name operator value" - }, - - { - "key": "UPDATE", - "val": "UPDATE table_name SET column1=value, column2=value,... WHERE some_column=some_value" - }, - - { - "key": "DELETE", - "val": "DELETE FROM table_name WHERE some_column=some_value, DELETE FROM table_name (Note: Deletes the entire table!!) DELETE * FROM table_name (Note: Deletes the entire table!!) " - }, - - { - "key": "AND / OR", - "val": "SELECT column_name(s) FROM table_name WHERE condition AND|OR condition " - }, - - { - "key": "ALTER TABLE", - "val": "ALTER TABLE table_name ADD column_name datatype , ALTER TABLE table_name DROP COLUMN column_name" - }, - - { - "key": "AS (alias)", - "val": "SELECT column_name AS column_alias FROM table_name, SELECT column_name FROM table_name AS table_alias" - }, - - { - "key": "BETWEEN", - "val": "SELECT column_name(s) FROM table_name WHERE column_name BETWEEN value1 AND value2" - }, - - { - "key": "EXISTS", - "val": "IF EXISTS (SELECT * FROM table_name WHERE id = ?) BEGIN --do what needs to be done if exists END ELSE BEGIN --do what needs to be done if not END" - }, - - { - "key": "GROUP BY", - "val": "SELECT column_name, aggregate_function(column_name) FROM table_name WHERE column_name operator value GROUP BY column_name" - }, - - { - "key": "HAVING", - "val": "SELECT column_name, aggregate_function(column_name) FROM table_name WHERE column_name operator value GROUP BY column_name HAVING aggregate_function(column_name) operator value" - }, - - { - "key": "IN", - "val": "SELECT column_name(s) FROM table_name WHERE column_name IN (value1,value2,..)" - }, - - { - "key": "LIKE", - "val": "SELECT column_name(s) FROM table_name WHERE column_name LIKE pattern" - }, - - { - "key": "ORDER BY", - "val": "SELECT column_name(s) FROM table_name ORDER BY column_name [ASC|DESC]" - }, - - { - "key": "CREATE VIEW", - "val": "CREATE VIEW view_name AS SELECT column_name(s) FROM table_name WHERE condition" - }, - - { - "key": "DROP TABLE", - "val": "DROP TABLE table_name" - }, - - { - "key": "SELECT INTO", - "val": "SELECT * INTO new_table_name [IN externaldatabase] FROM old_table_name, SELECT column_name(s) INTO new_table_name [IN externaldatabase] FROM old_table_name" - }, - - { - "key": "SELECT TOP", - "val": "SELECT TOP number|percent column_name(s) FROM table_name" - }, - - { - "key": "CREATE DATABASE", - "val": "CREATE DATABASE database_name" - }, - - { - "key": "CREATE INDEX", - "val": "CREATE INDEX index_name ON table_name (column_name), CREATE UNIQUE INDEX index_name ON table_name (column_name)" - }, - - { - "key": "DROP DATABASE", - "val": "DROP DATABASE database_name" - }, - - { - "key": "DROP INDEX", - "val": "DROP INDEX table_name.index_name (SQL Server),DROP INDEX index_name ON table_name (MS Access),DROP INDEX index_name (DB2/Oracle),ALTER TABLE table_name DROP INDEX index_name (MySQL)" - }, - - { - "key": "INNER JOIN", - "val": "SELECT column_name(s) FROM table_name1 INNER JOIN table_name2 ON table_name1.column_name=table_name2.column_name" - }, - - { - "key": "LEFT JOIN", - "val": "SELECT column_name(s) FROM table_name1 LEFT JOIN table_name2 ON table_name1.column_name=table_name2.column_name" - }, - - { - "key": "RIGHT JOIN", - "val": "SELECT column_name(s) FROM table_name1 RIGHT JOIN table_name2 ON table_name1.column_name=table_name2.column_name" - }, - - { - "key": "FULL JOIN", - "val": "SELECT column_name(s) FROM table_name1 FULL JOIN table_name2 ON table_name1.column_name=table_name2.column_name" - }, - - { - "key": "TRUNCATE TABLE", - "val": "TRUNCATE TABLE table_name" - }, - - { - "key": "UNION", - "val": "SELECT column_name(s) FROM table_name1 UNION SELECT column_name(s) FROM table_name2" - }, - - { - "key": "UNION ALL", - "val": "SELECT column_name(s) FROM table_name1 UNION ALL SELECT column_name(s) FROM table_name2" - } - - - - ] - - - } - -} \ No newline at end of file diff --git a/share/goodie/cheat_sheets/json/octave.json b/share/goodie/cheat_sheets/json/octave.json index 29ec9b70a..bc81db835 100644 --- a/share/goodie/cheat_sheets/json/octave.json +++ b/share/goodie/cheat_sheets/json/octave.json @@ -1,6 +1,6 @@ { - "id": "octave_quick_reference", - "name": "OCTAVE", + "id": "octave_cheat_sheet", + "name": "Octave", "description": "GNU Octave is a high-level interpreted language, primarily intended for numerical computations.", "metadata": { "sourceName": "ntnu", @@ -16,29 +16,14 @@ "Searching in Info", "Command-Line Cursor Motion", "Inserting or Changing Text", - "Arithmetic and Increment Operators", - "Assignment Expressions", - "Comparison and Boolean Operators", - "C-style Input and Output", - "Other Input and Output functions", - "Miscellaneous Functions", - "Polynomials", - "Statistics", "Killing and Yanking", "Shell Commands", - "Basic Matrix Manipulations", - "Basic Plotting", - "Other Plotting Functions", - "Strings and Common Escape Sequences", - "Index Expressions", - "Linear Algebra", - "Signal Processing", - "Image Processing", - "Sets", - "Strings" + "Command Completion and History" ], "aliases": [ "octave language", + "gnu octave", + "gnu octave programming", "octave programming" ], "sections": { @@ -169,7 +154,7 @@ }, { "key": "C-a", - "val": "Move the the start of the line" + "val": "Move the start of the line" }, { "key": "C-e", @@ -214,287 +199,7 @@ "val": "Transpose words at the point" } ], - "Arithmetic and Increment Operators": [ - { - "key": "x + y", - "val": "Addition" - }, - { - "key": "x - y", - "val": "Subtraction" - }, - { - "key": "x * y", - "val": "Matrix multiplication" - }, - { - "key": "x .* y", - "val": "Element by element multiplication" - }, - { - "key": "x / y", - "val": "Right division, conceptually equivalent to (inverse (y’) * x’)’" - }, - { - "key": "x ./ y", - "val": "Element by element right division" - }, - { - "key": "x ^ y", - "val": "Power operator" - }, - { - "key": "x .^ y", - "val": "Element by element power operator" - }, - { - "key": "- x", - "val": "Negation" - }, - { - "key": "x ’", - "val": "Complex conjugate transpose" - }, - { - "key": "x .’", - "val": "Transpose" - }, - { - "key": "++ x (-- x)", - "val": "Increment (decrement) x, return new value" - }, - { - "key": "x ++ (x --)", - "val": "Increment (decrement) x, return old value" - } - ], - "Assignment Expressions": [ - { - "key": "var = expr", - "val": "Assign expression to variable" - }, - { - "key": "var (idx) = expr", - "val": "Assign expression to indexed variable" - } - ], - "Comparison and Boolean Operators": [ - { - "key": "x < y", - "val": "True if x is less than y" - }, - { - "key": "x <= y", - "val": "True if x is less than or equal to y" - }, - { - "key": "x == y", - "val": "True if x is equal to y" - }, - { - "key": "x >= y", - "val": "True if x is greater than or equal to y" - }, - { - "key": "x > y", - "val": "True if x is greater than y" - }, - { - "key": "x != y", - "val": "True if x is not equal to y" - }, - { - "key": "x & y", - "val": "True if both x and y are true" - }, - { - "key": "x | y", - "val": "True if at least one of x or y is true" - }, - { - "key": "! bool", - "val": "True if bool is false" - } - ], - "C-style Input and Output": [ - { - "key": "fopen (name, mode)", - "val": "Open file name" - }, - { - "key": "fclose (file)", - "val": "Close file" - }, - { - "key": "printf (fmt, ...) ", - "val": "Formatted output to stdout" - }, - { - "key": "fprintf (file, fmt, ...)", - "val": "Formatted output to file" - }, - { - "key": "sprintf (fmt, ...)", - "val": "Formatted output to string" - }, - { - "key": "scanf (fmt)", - "val": "Formatted input from stdin" - }, - { - "key": "fscanf (file, fmt)", - "val": "Formatted input from file" - }, - { - "key": "sscanf (str, fmt)", - "val": "Formatted input from string" - }, - { - "key": "fgets (file, len) ", - "val": "Read len characters from file" - }, - { - "key": "fflush (file) ", - "val": "Flush pending output to file" - }, - { - "key": "ftell (file)", - "val": "Return file pointer position" - }, - { - "key": "frewind (file)", - "val": "Move file pointer to beginning" - }, - { - "key": "freport", - "val": "Print a info for open files" - }, - { - "key": "fread (file, size, prec)", - "val": "Read binary data files" - }, - { - "key": "fread (file, size, prec)", - "val": "Read binary data files" - }, - { - "key": "fwrite (file, size, prec)", - "val": "Write binary data files" - }, - { - "key": "feof (file)", - "val": "Determine if pointer is at EOF" - } - ], - "Other Input and Output functions": [ - { - "key": "save file var ...", - "val": "Save variables in file" - }, - { - "key": "load file", - "val": "Load variables from file" - }, - { - "key": "disp (var)", - "val": "Display value of var to screen" - } - ], - "Miscellaneous Functions": [ - { - "key": "eval (str)", - "val": "Evaluate str as a command" - }, - { - "key": "feval (str, ...)", - "val": "Evaluate function named by str, passing remaining args to called function" - }, - { - "key": "error (message)", - "val": "Print message and return to top level" - }, - { - "key": "clear pattern", - "val": "Clear variables matching pattern" - }, - { - "key": "exist (str)", - "val": "Check existence of variable or function" - }, - { - "key": "who", - "val": "List current variables" - } - ], - "Polynomials": [ - { - "key": "compan (p)", - "val": "Companion matrix" - }, - { - "key": "conv (a, b)", - "val": "Convolution" - }, - { - "key": "deconv (a, b)", - "val": "Deconvolve two vectors" - }, - { - "key": "poly (a)", - "val": "Create polynomial from a matrix" - }, - { - "key": "polyderiv (p)", - "val": "Derivative of polynomial" - }, - { - "key": "polyreduce (p)", - "val": "Integral of polynomial" - }, - { - "key": "polyval (p, x)", - "val": "Value of polynomial at x" - }, - { - "key": "polyvalm (p, x)", - "val": "Value of polynomial at x" - }, - { - "key": "roots (p)", - "val": "Polynomial roots" - }, - { - "key": "residue (a, b)", - "val": "Partial fraction expansion of ratio a/b" - } - ], - "Statistics": [ - { - "key": "corrcoef (x, y)", - "val": "Correlation coefficient" - }, - { - "key": "cov (x, y)", - "val": "Covariance" - }, - { - "key": "mean (a)", - "val": "Mean value" - }, - { - "key": "median (a)", - "val": "Median value" - }, - { - "key": "std (a)", - "val": "Standard deviation" - }, - { - "key": "var(a)", - "val": "Variance" - } - ], - "KillingandYanking": [ + "Killing and Yanking": [ { "key": "C-k", "val": "Kill to the end of the line" @@ -538,353 +243,30 @@ "val": "Execute arbitrary shell command string" } ], - "Basic Matrix Manipulations": [ + "Command Completion and History": [ { - "key": "rows (a)", - "val": "Return number of rows of a" + "key": "TAB", + "val": "Complete a command or variable name" }, { - "key": "columns (a)", - "val": "Return number of columns of a" + "key": "M-?", + "val": "List possible completions" }, { - "key": "all (a)", - "val": "Check if all elements of a nonzero" + "key": "C-p", + "val": "Move ‘up’ through the history list" }, { - "key": "any (a)", - "val": "Check if any elements of a nonzero" + "key": "C-n", + "val": "Move ‘down’ through the history list" }, { - "key": "find (a)", - "val": "Return indices of nonzero elements" + "key": "M-<", + "val": "Move to the first line in the history" }, { - "key": "sort (a)", - "val": "Order elements in each column of a" - }, - { - "key": "sum (a)", - "val": "Sum elements in columns of a" - }, - { - "key": "prod (a)", - "val": "Product of elements in columns of a" - }, - { - "key": "min (args)", - "val": "Find minimum values" - }, - { - "key": "max (args)", - "val": "Find maximum values" - }, - { - "key": "rem (x, y)", - "val": "Find remainder of x/y" - }, - { - "key": "reshape (a, m, n)", - "val": "Reformat a to be m by n" - }, - { - "key": "diag (v, k)", - "val": "Create diagonal matrices" - }, - { - "key": "linspace (b, l, n)", - "val": "Create vector of linearly-spaced elements" - }, - { - "key": "logspace (b, l, n)", - "val": "Create vector of log-spaced elements" - }, - { - "key": "eye (n, m)", - "val": "Create n by m identity matrix" - }, - { - "key": "ones (n, m)", - "val": "Create n by m matrix of ones" - }, - { - "key": "zeros (n, m)", - "val": "Create n by m matrix of zeros" - }, - { - "key": "rand (n, m)", - "val": "Create n by m matrix of random values" - } - ], - "Basic Plotting": [ - { - "key": "gplot [ranges] expr [using] [title] [style]", - "val": "2D plotting" - }, - { - "key": "gsplot [ranges] expr [using] [title] [style]", - "val": "3D plotting" - }, - { - "key": "ranges - Specify data ranges" - }, - { - "key": "expr - Expression to plot" - }, - { - "key": "using - Specify columns to plot" - }, - { - "key": "title - Specify line title for legend" - }, - { - "key": "style - Specify line style" - } - ], - "Other Plotting Functions": [ - { - "key": "plot (args)", - "val": "2D plot with linear axes" - }, - { - "key": "semilogx (args)", - "val": "2D plot with logarithmic x-axis" - }, - { - "key": "semilogy (args)", - "val": "2D plot with logarithmic y-axis" - }, - { - "key": "loglog (args)", - "val": "2D plot with logarithmic axes" - }, - { - "key": "bar (args)", - "val": "Plot bar charts" - }, - { - "key": "stairs (x, y)", - "val": "Plot stairsteps" - }, - { - "key": "hist (y, x)", - "val": "Plot histograms" - }, - { - "key": "title (string)", - "val": "Set plot title" - }, - { - "key": "axis (limits)", - "val": "Set axis ranges" - }, - { - "key": "xlabel (string)", - "val": "Set x-axis label" - }, - { - "key": "ylabel (string)", - "val": "Set y-axis label" - }, - { - "key": "grid [on|off]", - "val": "Set grid state" - }, - { - "key": "hold [on|off]", - "val": "Set hold state" - }, - { - "key": "ishold", - "val": "Return 1 if hold is on, 0 otherwise" - }, - { - "key": "mesh (x, y, z)", - "val": "Plot 3D surface" - }, - { - "key": "meshdom (x, y)", - "val": "Create mesh coordinate matrices" - } - ], - "Index Expressions": [ - { - "key": "var (idx)", - "val": "Select elements of a vector" - }, - { - "key": "var (idx1, idx2)", - "val": "Select elements of a matrix" - }, - { - "key": "scalar", - "val": "Select row (column) corresponding to scalar" - }, - { - "key": "vector", - "val": "Select rows (columns) corresponding to the elements of vector" - }, - { - "key": "range", - "val": "Select rows (columns) corresponding to the elements of range" - }, - { - "key": ":", - "val": "Select all rows (columns)" - } - ], - "Linear Algebra": [ - { - "key": "chol (a)", - "val": "Cholesky factorization" - }, - { - "key": "det (a)", - "val": "Compute the determinant of a matrix" - }, - { - "key": "eig (a)", - "val": "Eigenvalues and Eigenvectors" - }, - { - "key": "expm (a)", - "val": "Compute the exponential of a matrix" - }, - { - "key": "hess (a)", - "val": "Compute Hessenberg decomposition" - }, - { - "key": "inverse (a)", - "val": "Invert a square matrix" - }, - { - "key": "norm (a, p)", - "val": "Compute the p-norm of a matrix" - }, - { - "key": "pinv (a)", - "val": "Compute pseudoinverse of a" - }, - { - "key": "qr (a)", - "val": "Compute the QR factorization of a matrix" - }, - { - "key": "rank (a)", - "val": "Matrix rank" - }, - { - "key": "schur (a)", - "val": "Schur decomposition of a matrix" - }, - { - "key": "svd (a)", - "val": "Singular value decomposition" - }, - { - "key": "syl (a, b, c)", - "val": "Solve the Sylvester equation" - } - ], - "Signal Processing": [ - { - "key": "*fsolve", - "val": "Solve nonlinear algebraic equations" - }, - { - "key": "*lsode", - "val": "Integrate nonlinear ODEs" - }, - { - "key": "*dassl", - "val": "Integrate nonlinear DAEs" - }, - { - "key": "*quad", - "val": "Integrate nonlinear functions" - }, - { - "key": "perror (nm, code)", - "val": "for functions that return numeric codes, print error message for named function and given error code" - } - ], - "Image Processing": [ - { - "key": "colormap (map)", - "val": "Set the current colormap" - }, - { - "key": "gray2ind (i, n)", - "val": "Convert gray scale to Octave image" - }, - { - "key": "image (img, zoom)", - "val": "Display an Octave image matrix" - }, - { - "key": "imagesc (img, zoom)", - "val": "Display scaled matrix as image" - }, - { - "key": "imshow (img, map)", - "val": "Display Octave image" - }, - { - "key": "imshow (i, n)", - "val": "Display gray scale image" - }, - { - "key": "imshow (r, g, b)", - "val": "Display RGB image" - }, - { - "key": "ind2gray (img, map)", - "val": "Convert Octave image to gray scale" - }, - { - "key": "ind2rgb (img, map)", - "val": "Convert indexed image to RGB" - }, - { - "key": "loadimage (file)", - "val": "Load an image file" - }, - { - "key": "rgb2ind (r, g, b)", - "val": "Convert RGB to Octave image" - }, - { - "key": "saveimage (file, img, fmt, map)", - "val": "Save a matrix to file" - } - ], - "Sets": [ - { - "key": "create set (a, b)", - "val": "Create row vector of unique values" - }, - { - "key": "complement (a, b)", - "val": "Elements of b not in a" - }, - { - "key": "intersection (a, b)", - "val": "Intersection of sets a and b" - }, - { - "key": "union (a, b)", - "val": "Union of sets a and b" - } - ], - "Strings": [ - { - "key": "strcmp (s, t)", - "val": "Compare strings" - }, - { - "key": "strcat (s, t, ...)", - "val": "Concatenate strings" + "key": "M->", + "val": "Move to the last line in the history" } ] } From 2db9434f8504d5a596b4d7802eb541e0af0825b6 Mon Sep 17 00:00:00 2001 From: JOBIN PHILIP ABRAHAM Date: Sat, 7 Nov 2015 16:26:16 +0530 Subject: [PATCH 049/379] Update c.json --- share/goodie/cheat_sheets/json/c.json | 492 +++++++++++++------------- 1 file changed, 242 insertions(+), 250 deletions(-) diff --git a/share/goodie/cheat_sheets/json/c.json b/share/goodie/cheat_sheets/json/c.json index 2fe276786..951b8d188 100644 --- a/share/goodie/cheat_sheets/json/c.json +++ b/share/goodie/cheat_sheets/json/c.json @@ -1,251 +1,243 @@ -{ - "id":"c_cheat_sheet", - "name":"C", - "description":"C is a general-purpose, procedural, imperative computer programming language developed in 1972 by Dennis M. Ritchie at the Bell Laboratories", - "metadata":{ - "sourceName":"utexas", - "sourceUrl":"http://users.ece.utexas.edu/~adnan/c-refcard.pdf" - }, - "template_type":"reference", - "section_order":[ - "C Preprocessor", - "Fundamental Data Types", - "Conversion Characters", - "Storage Classes", - "Initialization", - "Arithmetic Operators", - "Relational Operators", - "Logical Operators", - "Bitwise Operators", - "Pointers" - - ], - "aliases":[ - "c programming" - - ], - "sections":{ - "C Preprocessor":[ - { - "key":"#include ", - "val":"Include library file" - }, - { - "key":"#include \"filename\"", - "val":"Include user file" - }, - { - "key":"#define name text", - "val":"Replacement text" - }, - { - "key":"#define name(var) text", - "val":"Replacement macro" - }, - - { - "key":"#undef name", - "val":"Undefine" - }, - - { - "key":"#if, #else, #elif, #endif", - "val":"Conditional execution" - } - ], - "Fundamental Data Types":[ - - { - "key":"char", - "val":"Character (1 byte)" - }, - - { - "key":"int", - "val":"Integer " - }, - { - "key":"float", - "val":"Float (single precision)" - }, - { - "key":"double", - "val":"Float (double precision)" - }, - { - "key":"void", - "val":"No value" - } - - - ], - "Conversion Characters":[ - { - "key":"%c", - "val":"Single character" - }, - { - "key":"%d", - "val":"Signed decimal integer (int)" - }, - { - "key":"%f", - "val":"Signed floating-point value (float)" - }, - { - "key":"%s", - "val":"String of text" - }, - { - "key":"%o", - "val":"Unsigned octal (base 8) integer" - } - ], - "Storage Classes":[ - { - "key":"auto", - "val":"Default storage class for all local variables" - }, - { - "key":"register", - "val":"Define local variables that should be stored in a register instead of RAM" - }, - { - "key":"static", - "val":"Maintains values of variables between function calls" - }, - { - "key":"extern", - "val":"To give a reference of a global variable that is visible to all the program files" - } - ], - "Arithmetic Operators":[ - { - "key":"+", - "val":"Adds two operands" - }, - { - "key":"−", - "val":"Subtracts second operand from the first" - }, - { - "key":"*", - "val":"Multiplies both operands" - }, - { - "key":"/", - "val":"Divides numerator by de-numerator" - }, - { - "key":"%", - "val":"Modulus Operator" - }, - { - "key":"++", - "val":"Increases the integer value by one" - }, - { - "key":"--", - "val":"Decreases the integer value by one" - } - ], - "Relational Operators":[ - { - "key":"==", - "val":"Checks for equality between operands" - }, - { - "key":"!=", - "val":"Checks for non equality between operands" - }, - { - "key":">", - "val":"Checks if the value of left operand is greater than the value of right operand. If yes, then the condition becomes true." - }, - { - "key":"<", - "val":"Checks if the value of left operand is less than the value of right operand. If yes, then the condition becomes true." - }, - { - "key":">=", - "val":"Checks if the value of left operand is greater than or equal to the value of right operand. If yes, then the condition becomes true." - }, - { - "key":"<=", - "val":"Checks if the value of left operand is less than or equal to the value of right operand. If yes, then the condition becomes true." - } - ], - "Logical Operators":[ - { - "key":"&&", - "val":"Logical AND operator" - }, - { - "key":"||", - "val":"Logical OR Operator" - }, - { - "key":"!", - "val":"Logical NOT Operator" - } - ], - "Bitwise Operators":[ - { - "key":"&", - "val":"Does the logical AND on the bits in the corresponding position of the operands in its binary form" - }, - { - "key":"|", - "val":"Does the logical OR on the bits in the corresponding position of the operands in its binary form" - }, - { - "key":"^", - "val":"Does XOR on the bits in the corresponding position of the operands in its binary form" - }, - { - "key":"~", - "val":"Inverts all the bits of operand" - }, - { - "key":"<<", - "val":"Takes two numbers, left shifts the bits of first operand, the second operand decides the number of places to shift" - }, - { - "key":">>", - "val":"Takes two numbers, right shifts the bits of first operand, the second operand decides the number of places to shift" - } - ], - "Pointers":[ - { - "key":"type *name", - "val":"Declare pointer to type" - }, - { - "key":"type *f()", - "val":"Declare function returning pointer to type" - }, - { - "key":"type (*pf)()", - "val":"Declare pointer to function returning type" - }, - { - "key":"void *", - "val":"Generic pointer type" - } - ], - "Initialization":[ - { - "key":"type name=value", - "val":"Initialize variable" - }, - { - "key":"type name[]={value1,. . . }", - "val":"Initialize array" - }, - { - "key":"char name[]=\"string\"", - "val":"Initialize char string" - } - ] - } +{ + "id": "c_cheat_sheet", + "name": "C", + "description": "C is a general-purpose, procedural, imperative computer programming language developed in 1972 by Dennis M. Ritchie at the Bell Laboratories", + "metadata": { + "sourceName": "utexas", + "sourceUrl": "http://users.ece.utexas.edu/~adnan/c-refcard.pdf" + }, + "template_type": "reference", + "section_order": [ + "C Preprocessor", + "Fundamental Data Types", + "Conversion Characters", + "Storage Classes", + "Initialization", + "Arithmetic Operators", + "Relational Operators", + "Logical Operators", + "Bitwise Operators", + "Pointers" + ], + "aliases": [ + "c programming" + ], + "sections": { + "C Preprocessor": [ + { + "key": "#include ", + "val": "Include library file" + }, + { + "key": "#include \"filename\"", + "val": "Include user file" + }, + { + "key": "#define name text", + "val": "Replacement text" + }, + { + "key": "#define name(var) text", + "val": "Replacement macro" + }, + { + "key": "#undef name", + "val": "Undefine" + }, + { + "key": "#if, #else, #elif, #endif", + "val": "Conditional execution" + } + ], + "Fundamental Data Types": [ + { + "key": "char", + "val": "Character (1 byte)" + }, + { + "key": "int", + "val": "Integer " + }, + { + "key": "float", + "val": "Float (single precision)" + }, + { + "key": "double", + "val": "Float (double precision)" + }, + { + "key": "void", + "val": "No value" + } + ], + "Conversion Characters": [ + { + "key": "%c", + "val": "Single character" + }, + { + "key": "%d", + "val": "Signed decimal integer (int)" + }, + { + "key": "%f", + "val": "Signed floating-point value (float)" + }, + { + "key": "%s", + "val": "String of text" + }, + { + "key": "%o", + "val": "Unsigned octal (base 8) integer" + } + ], + "Storage Classes": [ + { + "key": "auto", + "val": "Default storage class for all local variables" + }, + { + "key": "register", + "val": "Define local variables that should be stored in a register instead of RAM" + }, + { + "key": "static", + "val": "Maintains values of variables between function calls" + }, + { + "key": "extern", + "val": "To give a reference of a global variable that is visible to all the program files" + } + ], + "Arithmetic Operators": [ + { + "key": "+", + "val": "Adds two operands" + }, + { + "key": "−", + "val": "Subtracts second operand from the first" + }, + { + "key": "*", + "val": "Multiplies both operands" + }, + { + "key": "/", + "val": "Divides numerator by de-numerator" + }, + { + "key": "%", + "val": "Modulus/remainder Operator" + }, + { + "key": "++", + "val": "Increments the integer value by one" + }, + { + "key": "--", + "val": "Decrements the integer value by one" + } + ], + "Relational Operators": [ + { + "key": "==", + "val": "Checks for equality between operands" + }, + { + "key": "!=", + "val": "Checks for non equality between operands" + }, + { + "key": ">", + "val": "If the value of left operand is greater than the value of right operand,then the condition becomes true." + }, + { + "key": "<", + "val": "If the value of left operand is less than the value of right operand,then the condition becomes true." + }, + { + "key": ">=", + "val": "If the value of left operand is greater than or equal to the value of right operand,then the condition becomes true." + }, + { + "key": "<=", + "val": "If the value of left operand is less than or equal to the value of right operand,then the condition becomes true." + } + ], + "Logical Operators": [ + { + "key": "&&", + "val": "Logical AND operator" + }, + { + "key": "||", + "val": "Logical OR Operator" + }, + { + "key": "!", + "val": "Logical NOT Operator" + } + ], + "Bitwise Operators": [ + { + "key": "&", + "val": "Does AND on the bits in the corresponding position of the operands in its binary form" + }, + { + "key": "|", + "val": "Does OR on the bits in the corresponding position of the operands in its binary form" + }, + { + "key": "^", + "val": "Does XOR on the bits in the corresponding position of the operands in its binary form" + }, + { + "key": "~", + "val": "Inverts all the bits of operand(1's complement)" + }, + { + "key": "a<>b", + "val": "shifts a right b number of times" + } + ], + "Pointers": [ + { + "key": "type *name", + "val": "Declare pointer to type" + }, + { + "key": "type *f()", + "val": "Declare function returning pointer to type" + }, + { + "key": "type (*pf)()", + "val": "Declare pointer to function returning type" + }, + { + "key": "void *", + "val": "Generic pointer type" + } + ], + "Initialization": [ + { + "key": "type name=value", + "val": "Initialize variable" + }, + { + "key": "type name[]={value1,. . . }", + "val": "Initialize array" + }, + { + "key": "char name[]=\"string\"", + "val": "Initialize char string" + } + ] + } } From afdc05d09de47709100616f3e86e0bcb6b4bec4a Mon Sep 17 00:00:00 2001 From: Lerna Ekmekcioglu Date: Sun, 8 Nov 2015 08:08:54 -0500 Subject: [PATCH 050/379] Adding Armenian Cheat Sheet --- share/goodie/cheat_sheets/json/armenian.json | 141 +++++++++++++++++++ 1 file changed, 141 insertions(+) create mode 100644 share/goodie/cheat_sheets/json/armenian.json diff --git a/share/goodie/cheat_sheets/json/armenian.json b/share/goodie/cheat_sheets/json/armenian.json new file mode 100644 index 000000000..990cbaf69 --- /dev/null +++ b/share/goodie/cheat_sheets/json/armenian.json @@ -0,0 +1,141 @@ +{ + "id" : "armenian_cheat_sheet", + "name" : "Armenian Cheat Sheet (Western)", + "metadata" : { + "sourceName" : "omniglot", + "sourceUrl" : "http://www.omniglot.com/language/phrases/westernarmenian.htm" + }, + "aliases": [ + "armenian phrases", "english to armenian", "basic armenian phrases", "basic armenian" + ], + "template_type": "reference", + "section_order" : [ + "Basics", + "Etiquette", + "Getting Help", + "Traveling" + ], + "description" : "Basic Armenian words and phrases", + "sections" : { + "Etiquette" : [ + { + "val" : "Բարի լույս: (Pahree looys)", + "key" : "Good morning" + }, + { + "val" : "Բարի կէսօր: (Pahree guess-ore - rarely used)", + "key" : "Good afternoon" + }, + { + "val" : "Բարի իրիկուն: (Pahree Eeree-goon)", + "key" : "Good evening" + }, + { + "val" : "Մնաք բարով: (Muh-nuck parov) - leaving", + "key" : "Goodbye" + }, + { + "val" : "Երթաք բարով: (Yer-tuck parov) - staying", + "key" : "Goodbye" + }, + { + "val" : "Շնորհակալ եմ: (Shnor-ha-gal em)", + "key" : "Thanks" + }, + { + "val" : "Ներողութիւն: (Neh-ro-ghoo-tune)", + "key" : "I am sorry" + } + ], + "Getting Help" : [ + { + "val" : "Օգնութիւն (Oak-noo-tune)", + "key" : "Help" + }, + { + "val" : "Ոստիկան (Vohs-dee-gun)", + "key" : "Police" + }, + { + "val" : "Բժիշկ կանչեցեք: (Puhsheeshk gun-chetzek)", + "key" : "Get a doctor" + }, + { + "val" : "Հիւանդ եմ: (Hee-vunt ehm)", + "key" : "I am sick" + }, + { + "val" : "Մեկը գողցավ իմ ... (Meh-guh khogh-tzahv eem ...)", + "key" : "Somebody has stolen my..." + }, + { + "val" : "Հիւանդանոցը ո՞ւր է: (Heevon-tah-no-tzuh oor eh?)", + "key" : "Where is the hospital?" + } + ], + "Basics" : [ + { + "val" : "Անունս ... է: (Uh-noon-us ... eh)", + "key" : "My name is..." + }, + { + "val" : "Լաւ եմ, շնորհակալ եմ: Եւ դուք ինչպէ՞ս էք: (Laav em shnor-hagal em. Yev took inch bess ek?)", + "key" : "I'm fine, thanks. And you?" + }, + { + "val" : "Ինչպե՞ս եք: (Inch bess ek)", + "key" : "How are you?" + }, + { + "val" : "Բարև (Pahrev)", + "key" : "Hello" + }, + { + "val" : "Բարի՜ եկաք: (Pah-ree yeh-guck)", + "key" : "Welcome" + }, + { + "val" : "Ձեր անունը ի՞նչ է: (Tzer a-noo-nuh inch eh)", + "key" : "What's your name?" + } + ], + "Traveling" : [ + { + "val" : "Անգլիերէն կը խօսի՞ք: (Ahnc-laren guh kho-seek?)", + "key" : "Do you speak English?" + }, + { + "val" : "Հաճիս ինձի կրնա՞ք օգնել: (Huh-jees intzi guhr-nuck ok-nell?)", + "key" : "Would you help me please?" + }, + { + "val" : "Պէտքարանը ո՞ւր է: (Bed-kara-nuh oor eh?)", + "key" : "Where is the toilet?" + }, + { + "val" : "Ասիկա ինչքա՞ն կ'արժէ: (Asee-guh inch-khan gar-zheh?)", + "key" : "How much is this?" + }, + { + "val" : "Ուր կրնամ գտնա՞լ ... (Oor grnum kuhd-null ...?)", + "key" : "Where can I find ..." + }, + { + "val" : "Որ ատէն խանութը կը բացվի՞: (Vor adehn kha-noo-tuh guh patzwee?)", + "key" : "What time does the shop open?" + }, + { + "val" : "Որ ատէն խանութը կը գոցվի՞: (Vor adehn kha-noo-tuh guh kotzvee?)", + "key" : "What time does the shop close?" + }, + { + "val" : "Հաճիս աւելի կամաց կրնա՞ք խօսիլ: (Huhjees ave-lee ga-matz guhr-nock khoseel?", + "key" : "Could you talk a bit slower?" + }, + { + "val" : "Հաճիս կրնա՞ք կրկնել: (Huhjees guhr-nock ghurg-nell?)", + "key" : "Could you repeat that please?" + } + ] + } +} From 2f7d4903c5cd0b27712b7eb0d470230513697835 Mon Sep 17 00:00:00 2001 From: javathunderman Date: Sun, 8 Nov 2015 14:55:23 +0000 Subject: [PATCH 051/379] Microsoft Word CheatSheet --- .../cheat_sheets/json/microsoft-word.json | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 share/goodie/cheat_sheets/json/microsoft-word.json diff --git a/share/goodie/cheat_sheets/json/microsoft-word.json b/share/goodie/cheat_sheets/json/microsoft-word.json new file mode 100644 index 000000000..8db49a41b --- /dev/null +++ b/share/goodie/cheat_sheets/json/microsoft-word.json @@ -0,0 +1,75 @@ +{ + "id": "microsoft_word_cheat_sheet", + "name": "Microsoft Word 2010", + "description": "Word Processor by Microsoft", + "metadata": { + "sourceName": "Dummies", + "sourceUrl": "http://www.dummies.com/how-to/content/word-2010-for-dummies-cheat-sheet.html" + }, + "aliases": [ + "ms word" + ], + "template_type": "keyboard", + "section_order": [ + "Common Tasks" + ], + "sections": { + "Common Tasks": [ { + "val": "Save", + "key": "[Ctrl] [S]" + }, { + "val": "Navigate (Find/Search)", + "key": "[Ctrl] [F]" + }, { + "val": "Cut", + "key": "[Ctrl] [X]" + }, { + "val": "Copy", + "key": "[Ctrl] [C]" + }, { + "val": "Paste", + "key": "[Ctrl] [V]" + }, { + "val": "Select All", + "key": "[Ctrl] [A]" + }, { + "val": "Print", + "key": "[Ctrl] [P]" + }, { + "val": "Undo", + "key": "[Ctrl] [Z]" + }, { + "val": "Redo", + "key": "[Ctrl] [Y]" + }, { + "val": "Make Letters Bold", + "key": "[Ctrl] [B]" + }, { + "val": "Make Letters Italic", + "key": "[Ctrl] [I]" + }, { + "val": "Underline Letters", + "key": "[Ctrl] [U]" + }, { + "val": "Create a Nonbreaking Space", + "key": "[Ctrl] [Shift] [Spacebar]" + }, { + "val": "Create a Nonbreaking Hyphen", + "key": "[Ctrl] [Shift] [Hyphen]" + }, { + "val": "Decrease Font Size by 1 value", + "key": "[Ctrl] [Shift] [<]" + }, { + "val": "Increase Font Size by 1 value", + "key": "[Ctrl] [Shift] [>]" + }, { + "val": "Remove Paragraph or Character Formatting", + "key": "[Ctrl] [Spacebar]" + }, { + "val": "Paste Special", + "key": "[ALT] [Ctrl] [V]" + } + + ]} + +} \ No newline at end of file From 1a1479d7434c314f01bd283e8076e238255c4383 Mon Sep 17 00:00:00 2001 From: Lerna Ekmekcioglu Date: Sun, 8 Nov 2015 11:52:17 -0500 Subject: [PATCH 052/379] New Armenian Cheat Sheet --- share/goodie/cheat_sheets/json/armenian.json | 285 ++++++++++--------- 1 file changed, 146 insertions(+), 139 deletions(-) diff --git a/share/goodie/cheat_sheets/json/armenian.json b/share/goodie/cheat_sheets/json/armenian.json index 990cbaf69..98f8a3c63 100644 --- a/share/goodie/cheat_sheets/json/armenian.json +++ b/share/goodie/cheat_sheets/json/armenian.json @@ -1,141 +1,148 @@ { - "id" : "armenian_cheat_sheet", - "name" : "Armenian Cheat Sheet (Western)", - "metadata" : { - "sourceName" : "omniglot", - "sourceUrl" : "http://www.omniglot.com/language/phrases/westernarmenian.htm" - }, - "aliases": [ - "armenian phrases", "english to armenian", "basic armenian phrases", "basic armenian" - ], - "template_type": "reference", - "section_order" : [ - "Basics", - "Etiquette", - "Getting Help", - "Traveling" - ], - "description" : "Basic Armenian words and phrases", - "sections" : { - "Etiquette" : [ - { - "val" : "Բարի լույս: (Pahree looys)", - "key" : "Good morning" - }, - { - "val" : "Բարի կէսօր: (Pahree guess-ore - rarely used)", - "key" : "Good afternoon" - }, - { - "val" : "Բարի իրիկուն: (Pahree Eeree-goon)", - "key" : "Good evening" - }, - { - "val" : "Մնաք բարով: (Muh-nuck parov) - leaving", - "key" : "Goodbye" - }, - { - "val" : "Երթաք բարով: (Yer-tuck parov) - staying", - "key" : "Goodbye" - }, - { - "val" : "Շնորհակալ եմ: (Shnor-ha-gal em)", - "key" : "Thanks" - }, - { - "val" : "Ներողութիւն: (Neh-ro-ghoo-tune)", - "key" : "I am sorry" - } - ], - "Getting Help" : [ - { - "val" : "Օգնութիւն (Oak-noo-tune)", - "key" : "Help" - }, - { - "val" : "Ոստիկան (Vohs-dee-gun)", - "key" : "Police" - }, - { - "val" : "Բժիշկ կանչեցեք: (Puhsheeshk gun-chetzek)", - "key" : "Get a doctor" - }, - { - "val" : "Հիւանդ եմ: (Hee-vunt ehm)", - "key" : "I am sick" - }, - { - "val" : "Մեկը գողցավ իմ ... (Meh-guh khogh-tzahv eem ...)", - "key" : "Somebody has stolen my..." - }, - { - "val" : "Հիւանդանոցը ո՞ւր է: (Heevon-tah-no-tzuh oor eh?)", - "key" : "Where is the hospital?" - } - ], - "Basics" : [ - { - "val" : "Անունս ... է: (Uh-noon-us ... eh)", - "key" : "My name is..." - }, - { - "val" : "Լաւ եմ, շնորհակալ եմ: Եւ դուք ինչպէ՞ս էք: (Laav em shnor-hagal em. Yev took inch bess ek?)", - "key" : "I'm fine, thanks. And you?" - }, - { - "val" : "Ինչպե՞ս եք: (Inch bess ek)", - "key" : "How are you?" - }, - { - "val" : "Բարև (Pahrev)", - "key" : "Hello" - }, - { - "val" : "Բարի՜ եկաք: (Pah-ree yeh-guck)", - "key" : "Welcome" - }, - { - "val" : "Ձեր անունը ի՞նչ է: (Tzer a-noo-nuh inch eh)", - "key" : "What's your name?" - } - ], - "Traveling" : [ - { - "val" : "Անգլիերէն կը խօսի՞ք: (Ahnc-laren guh kho-seek?)", - "key" : "Do you speak English?" - }, - { - "val" : "Հաճիս ինձի կրնա՞ք օգնել: (Huh-jees intzi guhr-nuck ok-nell?)", - "key" : "Would you help me please?" - }, - { - "val" : "Պէտքարանը ո՞ւր է: (Bed-kara-nuh oor eh?)", - "key" : "Where is the toilet?" - }, - { - "val" : "Ասիկա ինչքա՞ն կ'արժէ: (Asee-guh inch-khan gar-zheh?)", - "key" : "How much is this?" - }, - { - "val" : "Ուր կրնամ գտնա՞լ ... (Oor grnum kuhd-null ...?)", - "key" : "Where can I find ..." - }, - { - "val" : "Որ ատէն խանութը կը բացվի՞: (Vor adehn kha-noo-tuh guh patzwee?)", - "key" : "What time does the shop open?" - }, - { - "val" : "Որ ատէն խանութը կը գոցվի՞: (Vor adehn kha-noo-tuh guh kotzvee?)", - "key" : "What time does the shop close?" - }, - { - "val" : "Հաճիս աւելի կամաց կրնա՞ք խօսիլ: (Huhjees ave-lee ga-matz guhr-nock khoseel?", - "key" : "Could you talk a bit slower?" - }, - { - "val" : "Հաճիս կրնա՞ք կրկնել: (Huhjees guhr-nock ghurg-nell?)", - "key" : "Could you repeat that please?" - } - ] - } + "id" : "armenian_cheat_sheet", + + "name" : "Armenian Cheat Sheet (Western)", + + "metadata" : { + "sourceName" : "omniglot", + "sourceUrl" : "http://www.omniglot.com/language/phrases/westernarmenian.htm" + }, + + "aliases": [ + "armenian phrases", "english to armenian", "basic armenian phrases", "basic armenian" + ], + + "template_type": "reference", + + "section_order" : [ + "Basics", + "Etiquette", + "Getting Help", + "Traveling" + ], + + "description" : "Basic Armenian words and phrases", + + "sections" : { + "Etiquette" : [ + { + "val" : "Բարի լույս: (Pahree looys)", + "key" : "Good morning" + }, + { + "val" : "Բարի կէսօր: (Pahree guess-ore - rarely used)", + "key" : "Good afternoon" + }, + { + "val" : "Բարի իրիկուն: (Pahree Eeree-goon)", + "key" : "Good evening" + }, + { + "val" : "Մնաք բարով: (Muh-nuck parov) - leaving", + "key" : "Goodbye" + }, + { + "val" : "Երթաք բարով: (Yer-tuck parov) - staying", + "key" : "Goodbye" + }, + { + "val" : "Շնորհակալ եմ: (Shnor-ha-gal em)", + "key" : "Thanks" + }, + { + "val" : "Ներողութիւն: (Neh-ro-ghoo-tune)", + "key" : "I am sorry" + } + ], + "Getting Help" : [ + { + "val" : "Օգնութիւն (Oak-noo-tune)", + "key" : "Help" + }, + { + "val" : "Ոստիկան (Vohs-dee-gun)", + "key" : "Police" + }, + { + "val" : "Բժիշկ կանչեցեք: (Puhsheeshk gun-chetzek)", + "key" : "Get a doctor" + }, + { + "val" : "Հիւանդ եմ: (Hee-vunt ehm)", + "key" : "I am sick" + }, + { + "val" : "Մեկը գողցավ իմ ... (Meh-guh khogh-tzahv eem ...)", + "key" : "Somebody has stolen my..." + }, + { + "val" : "Հիւանդանոցը ո՞ւր է: (Heevon-tah-no-tzuh oor eh?)", + "key" : "Where is the hospital?" + } + ], + "Basics" : [ + { + "val" : "Անունս ... է: (Uh-noon-us ... eh)", + "key" : "My name is..." + }, + { + "val" : "Լաւ եմ, շնորհակալ եմ: Եւ դուք ինչպէ՞ս էք: (Laav em shnor-hagal em. Yev took inch bess ek?)", + "key" : "I'm fine, thanks. And you?" + }, + { + "val" : "Ինչպե՞ս եք: (Inch bess ek)", + "key" : "How are you?" + }, + { + "val" : "Բարև (Pahrev)", + "key" : "Hello" + }, + { + "val" : "Բարի՜ եկաք: (Pah-ree yeh-guck)", + "key" : "Welcome" + }, + { + "val" : "Ձեր անունը ի՞նչ է: (Tzer a-noo-nuh inch eh)", + "key" : "What's your name?" + } + ], + "Traveling" : [ + { + "val" : "Անգլիերէն կը խօսի՞ք: (Ahnc-laren guh kho-seek?)", + "key" : "Do you speak English?" + }, + { + "val" : "Հաճիս ինձի կրնա՞ք օգնել: (Huh-jees intzi guhr-nuck ok-nell?)", + "key" : "Would you help me please?" + }, + { + "val" : "Պէտքարանը ո՞ւր է: (Bed-kara-nuh oor eh?)", + "key" : "Where is the toilet?" + }, + { + "val" : "Ասիկա ինչքա՞ն կ'արժէ: (Asee-guh inch-khan gar-zheh?)", + "key" : "How much is this?" + }, + { + "val" : "Ուր կրնամ գտնա՞լ ... (Oor grnum kuhd-null ...?)", + "key" : "Where can I find ..." + }, + { + "val" : "Որ ատէն խանութը կը բացվի՞: (Vor adehn kha-noo-tuh guh patzwee?)", + "key" : "What time does the shop open?" + }, + { + "val" : "Որ ատէն խանութը կը գոցվի՞: (Vor adehn kha-noo-tuh guh kotzvee?)", + "key" : "What time does the shop close?" + }, + { + "val" : "Հաճիս աւելի կամաց կրնա՞ք խօսիլ: (Huhjees ave-lee ga-matz guhr-nock khoseel?", + "key" : "Could you talk a bit slower?" + }, + { + "val" : "Հաճիս կրնա՞ք կրկնել: (Huhjees guhr-nock ghurg-nell?)", + "key" : "Could you repeat that please?" + } + ] + } } From e69d525d067bb2adc73ae2fe20c349a6b1fccc3a Mon Sep 17 00:00:00 2001 From: Thomas Denizou Date: Sun, 8 Nov 2015 13:46:49 -0500 Subject: [PATCH 053/379] Fixing indents --- share/goodie/cheat_sheets/json/microsoft-word.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/goodie/cheat_sheets/json/microsoft-word.json b/share/goodie/cheat_sheets/json/microsoft-word.json index 8db49a41b..7c22fff9c 100644 --- a/share/goodie/cheat_sheets/json/microsoft-word.json +++ b/share/goodie/cheat_sheets/json/microsoft-word.json @@ -70,6 +70,6 @@ "key": "[ALT] [Ctrl] [V]" } - ]} + ]} -} \ No newline at end of file +} From 88b4249798107d641bf65a12b19a18ffbb91d84e Mon Sep 17 00:00:00 2001 From: Thomas Denizou Date: Sun, 8 Nov 2015 17:28:36 -0500 Subject: [PATCH 054/379] Adding an alias --- share/goodie/cheat_sheets/json/microsoft-word.json | 1 + 1 file changed, 1 insertion(+) diff --git a/share/goodie/cheat_sheets/json/microsoft-word.json b/share/goodie/cheat_sheets/json/microsoft-word.json index 7c22fff9c..e82cfec1f 100644 --- a/share/goodie/cheat_sheets/json/microsoft-word.json +++ b/share/goodie/cheat_sheets/json/microsoft-word.json @@ -8,6 +8,7 @@ }, "aliases": [ "ms word" + "winword" ], "template_type": "keyboard", "section_order": [ From 7260fb2e2a4a863749c361a74c30e7c37e0f1eb4 Mon Sep 17 00:00:00 2001 From: jophab Date: Mon, 9 Nov 2015 15:37:08 +0000 Subject: [PATCH 055/379] Description of your changes --- share/goodie/cheat_sheets/json/c.json | 251 ------------------------ share/goodie/cheat_sheets/json/cpp.json | 195 ++++++++++++++++++ 2 files changed, 195 insertions(+), 251 deletions(-) delete mode 100644 share/goodie/cheat_sheets/json/c.json create mode 100644 share/goodie/cheat_sheets/json/cpp.json diff --git a/share/goodie/cheat_sheets/json/c.json b/share/goodie/cheat_sheets/json/c.json deleted file mode 100644 index 2fe276786..000000000 --- a/share/goodie/cheat_sheets/json/c.json +++ /dev/null @@ -1,251 +0,0 @@ -{ - "id":"c_cheat_sheet", - "name":"C", - "description":"C is a general-purpose, procedural, imperative computer programming language developed in 1972 by Dennis M. Ritchie at the Bell Laboratories", - "metadata":{ - "sourceName":"utexas", - "sourceUrl":"http://users.ece.utexas.edu/~adnan/c-refcard.pdf" - }, - "template_type":"reference", - "section_order":[ - "C Preprocessor", - "Fundamental Data Types", - "Conversion Characters", - "Storage Classes", - "Initialization", - "Arithmetic Operators", - "Relational Operators", - "Logical Operators", - "Bitwise Operators", - "Pointers" - - ], - "aliases":[ - "c programming" - - ], - "sections":{ - "C Preprocessor":[ - { - "key":"#include ", - "val":"Include library file" - }, - { - "key":"#include \"filename\"", - "val":"Include user file" - }, - { - "key":"#define name text", - "val":"Replacement text" - }, - { - "key":"#define name(var) text", - "val":"Replacement macro" - }, - - { - "key":"#undef name", - "val":"Undefine" - }, - - { - "key":"#if, #else, #elif, #endif", - "val":"Conditional execution" - } - ], - "Fundamental Data Types":[ - - { - "key":"char", - "val":"Character (1 byte)" - }, - - { - "key":"int", - "val":"Integer " - }, - { - "key":"float", - "val":"Float (single precision)" - }, - { - "key":"double", - "val":"Float (double precision)" - }, - { - "key":"void", - "val":"No value" - } - - - ], - "Conversion Characters":[ - { - "key":"%c", - "val":"Single character" - }, - { - "key":"%d", - "val":"Signed decimal integer (int)" - }, - { - "key":"%f", - "val":"Signed floating-point value (float)" - }, - { - "key":"%s", - "val":"String of text" - }, - { - "key":"%o", - "val":"Unsigned octal (base 8) integer" - } - ], - "Storage Classes":[ - { - "key":"auto", - "val":"Default storage class for all local variables" - }, - { - "key":"register", - "val":"Define local variables that should be stored in a register instead of RAM" - }, - { - "key":"static", - "val":"Maintains values of variables between function calls" - }, - { - "key":"extern", - "val":"To give a reference of a global variable that is visible to all the program files" - } - ], - "Arithmetic Operators":[ - { - "key":"+", - "val":"Adds two operands" - }, - { - "key":"−", - "val":"Subtracts second operand from the first" - }, - { - "key":"*", - "val":"Multiplies both operands" - }, - { - "key":"/", - "val":"Divides numerator by de-numerator" - }, - { - "key":"%", - "val":"Modulus Operator" - }, - { - "key":"++", - "val":"Increases the integer value by one" - }, - { - "key":"--", - "val":"Decreases the integer value by one" - } - ], - "Relational Operators":[ - { - "key":"==", - "val":"Checks for equality between operands" - }, - { - "key":"!=", - "val":"Checks for non equality between operands" - }, - { - "key":">", - "val":"Checks if the value of left operand is greater than the value of right operand. If yes, then the condition becomes true." - }, - { - "key":"<", - "val":"Checks if the value of left operand is less than the value of right operand. If yes, then the condition becomes true." - }, - { - "key":">=", - "val":"Checks if the value of left operand is greater than or equal to the value of right operand. If yes, then the condition becomes true." - }, - { - "key":"<=", - "val":"Checks if the value of left operand is less than or equal to the value of right operand. If yes, then the condition becomes true." - } - ], - "Logical Operators":[ - { - "key":"&&", - "val":"Logical AND operator" - }, - { - "key":"||", - "val":"Logical OR Operator" - }, - { - "key":"!", - "val":"Logical NOT Operator" - } - ], - "Bitwise Operators":[ - { - "key":"&", - "val":"Does the logical AND on the bits in the corresponding position of the operands in its binary form" - }, - { - "key":"|", - "val":"Does the logical OR on the bits in the corresponding position of the operands in its binary form" - }, - { - "key":"^", - "val":"Does XOR on the bits in the corresponding position of the operands in its binary form" - }, - { - "key":"~", - "val":"Inverts all the bits of operand" - }, - { - "key":"<<", - "val":"Takes two numbers, left shifts the bits of first operand, the second operand decides the number of places to shift" - }, - { - "key":">>", - "val":"Takes two numbers, right shifts the bits of first operand, the second operand decides the number of places to shift" - } - ], - "Pointers":[ - { - "key":"type *name", - "val":"Declare pointer to type" - }, - { - "key":"type *f()", - "val":"Declare function returning pointer to type" - }, - { - "key":"type (*pf)()", - "val":"Declare pointer to function returning type" - }, - { - "key":"void *", - "val":"Generic pointer type" - } - ], - "Initialization":[ - { - "key":"type name=value", - "val":"Initialize variable" - }, - { - "key":"type name[]={value1,. . . }", - "val":"Initialize array" - }, - { - "key":"char name[]=\"string\"", - "val":"Initialize char string" - } - ] - } -} diff --git a/share/goodie/cheat_sheets/json/cpp.json b/share/goodie/cheat_sheets/json/cpp.json new file mode 100644 index 000000000..c1675b3ed --- /dev/null +++ b/share/goodie/cheat_sheets/json/cpp.json @@ -0,0 +1,195 @@ +{ + "id": "c++_cheat_sheet", + "name": "C++", + "description": " A popular object-oriented programming language invented in 1979 by Bjarne Stroustrup", + "metadata": { + "sourceName": "cs", + "sourceUrl": "http://www.cs.ccu.edu.tw/~damon/oop/,c++refcard.pdf" + }, + "template_type": "reference", + "section_order": [ + "Fundamental Data Types", + "Preprocessor Directives", + "Arithmetic Operators", + "Relational Operators", + "Logical Operators", + "Bitwise Operators", + "Namespaces", + "Console Input/Output", + "Class Member Protections" + ], + "aliases": [ + "c++", + "c plus plus" + ], + "sections": { + "Fundamental Data Types": [ + { + "key": "char", + "val": "Character (1 byte)" + }, + { + "key": "int", + "val": "Integer " + }, + { + "key": "float", + "val": "Floating point" + }, + { + "key": "bool", + "val": "True or false" + }, + { + "key": "void", + "val": "No value" + } + ], + "Preprocessor Directives": [ + { + "key": "#include ", + "val": "Include library file" + }, + { + "key": "#include \"filename\"", + "val": "Include user file" + }, + { + "key": "#define name text", + "val": "Define a macro" + }, + { + "key": "#define name(var) text", + "val": "Define a parameterized macro" + }, + { + "key": "#undef name", + "val": "Undefine a previously defined macro" + }, + { + "key": "#if, #else, #elif, #endif", + "val": "Conditional execution" + } + ], + "Arithmetic Operators": [ + { + "key": "+", + "val": "Adds two operands" + }, + { + "key": "−", + "val": "Subtracts second operand from the first" + }, + { + "key": "*", + "val": "Multiplies both operands" + }, + { + "key": "/", + "val": "Divides numerator by de-numerator" + }, + { + "key": "%", + "val": "Modulus Operator" + }, + { + "key": "++", + "val": "Increases the integer value by one" + }, + { + "key": "--", + "val": "Decreases the integer value by one" + } + ], + "Relational Operators": [ + { + "key": "==", + "val": "Checks for equality between operands" + }, + { + "key": "!=", + "val": "Checks for non equality between operands" + }, + { + "key": ">", + "val": "Checks if the value of left operand is greater than the value of right operand. If yes, then the condition becomes true." + }, + { + "key": "<", + "val": "Checks if the value of left operand is less than the value of right operand. If yes, then the condition becomes true." + }, + { + "key": ">=", + "val": "Checks if the value of left operand is greater than or equal to the value of right operand. If yes, then the condition becomes true." + }, + { + "key": "<=", + "val": "Checks if the value of left operand is less than or equal to the value of right operand. If yes, then the condition becomes true." + } + ], + "Logical Operators": [ + { + "key": "&&", + "val": "Logical AND operator" + }, + { + "key": "||", + "val": "Logical OR Operator" + }, + { + "key": "!", + "val": "Logical NOT Operator" + } + ], + "Bitwise Operators": [ + { + "key": "&", + "val": "Does the logical AND on the bits in the corresponding position of the operands in its binary form" + }, + { + "key": "|", + "val": "Does the logical OR on the bits in the corresponding position of the operands in its binary form" + }, + { + "key": "^", + "val": "Does XOR on the bits in the corresponding position of the operands in its binary form" + }, + { + "key": "~", + "val": "Inverts all the bits of operand" + }, + { + "key": "<<", + "val": "Takes two numbers, left shifts the bits of first operand, the second operand decides the number of places to shift" + }, + { + "key": ">>", + "val": "Takes two numbers, right shifts the bits of first operand, the second operand decides the number of places to shift" + } + ], + "Namespaces": [ + { + "key": "namespace name {...}", + "val": "Define namespace for the enclosed code" + }, + { + "key": "using name;", + "val": "Import function and variable definition from the given namespace into the current namespace" + } + ], + "Class Member Protections": [ + { + "key": "public", + "val": "Anyone outside the class may access these member functions and variables" + }, + { + "key": "private", + "val": "Only the class's member functions and friends may access the data." + }, + { + "key": "protected", + "val": "Only the class's member functions, friends, and derived classes may access." + } + ] + } +} \ No newline at end of file From ef39c49697c02f2c8ccda6c2dd14f9c78fcd63cf Mon Sep 17 00:00:00 2001 From: harisphnx Date: Mon, 9 Nov 2015 15:38:50 +0000 Subject: [PATCH 056/379] corrected suggestions --- share/goodie/cheat_sheets/json/c.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/goodie/cheat_sheets/json/c.json b/share/goodie/cheat_sheets/json/c.json index 08437945f..c617b25f4 100644 --- a/share/goodie/cheat_sheets/json/c.json +++ b/share/goodie/cheat_sheets/json/c.json @@ -8,7 +8,7 @@ }, "aliases": [ "c programming", - "c language" + "c language" ], "template_type": "code", "section_order": [ From a0ddc4efb8ae1f4761437d71ccefaf4a1a1acbe1 Mon Sep 17 00:00:00 2001 From: jophab Date: Mon, 9 Nov 2015 15:43:04 +0000 Subject: [PATCH 057/379] Description of your changes --- share/goodie/cheat_sheets/json/c.json | 243 -------------------------- 1 file changed, 243 deletions(-) delete mode 100644 share/goodie/cheat_sheets/json/c.json diff --git a/share/goodie/cheat_sheets/json/c.json b/share/goodie/cheat_sheets/json/c.json deleted file mode 100644 index 951b8d188..000000000 --- a/share/goodie/cheat_sheets/json/c.json +++ /dev/null @@ -1,243 +0,0 @@ -{ - "id": "c_cheat_sheet", - "name": "C", - "description": "C is a general-purpose, procedural, imperative computer programming language developed in 1972 by Dennis M. Ritchie at the Bell Laboratories", - "metadata": { - "sourceName": "utexas", - "sourceUrl": "http://users.ece.utexas.edu/~adnan/c-refcard.pdf" - }, - "template_type": "reference", - "section_order": [ - "C Preprocessor", - "Fundamental Data Types", - "Conversion Characters", - "Storage Classes", - "Initialization", - "Arithmetic Operators", - "Relational Operators", - "Logical Operators", - "Bitwise Operators", - "Pointers" - ], - "aliases": [ - "c programming" - ], - "sections": { - "C Preprocessor": [ - { - "key": "#include ", - "val": "Include library file" - }, - { - "key": "#include \"filename\"", - "val": "Include user file" - }, - { - "key": "#define name text", - "val": "Replacement text" - }, - { - "key": "#define name(var) text", - "val": "Replacement macro" - }, - { - "key": "#undef name", - "val": "Undefine" - }, - { - "key": "#if, #else, #elif, #endif", - "val": "Conditional execution" - } - ], - "Fundamental Data Types": [ - { - "key": "char", - "val": "Character (1 byte)" - }, - { - "key": "int", - "val": "Integer " - }, - { - "key": "float", - "val": "Float (single precision)" - }, - { - "key": "double", - "val": "Float (double precision)" - }, - { - "key": "void", - "val": "No value" - } - ], - "Conversion Characters": [ - { - "key": "%c", - "val": "Single character" - }, - { - "key": "%d", - "val": "Signed decimal integer (int)" - }, - { - "key": "%f", - "val": "Signed floating-point value (float)" - }, - { - "key": "%s", - "val": "String of text" - }, - { - "key": "%o", - "val": "Unsigned octal (base 8) integer" - } - ], - "Storage Classes": [ - { - "key": "auto", - "val": "Default storage class for all local variables" - }, - { - "key": "register", - "val": "Define local variables that should be stored in a register instead of RAM" - }, - { - "key": "static", - "val": "Maintains values of variables between function calls" - }, - { - "key": "extern", - "val": "To give a reference of a global variable that is visible to all the program files" - } - ], - "Arithmetic Operators": [ - { - "key": "+", - "val": "Adds two operands" - }, - { - "key": "−", - "val": "Subtracts second operand from the first" - }, - { - "key": "*", - "val": "Multiplies both operands" - }, - { - "key": "/", - "val": "Divides numerator by de-numerator" - }, - { - "key": "%", - "val": "Modulus/remainder Operator" - }, - { - "key": "++", - "val": "Increments the integer value by one" - }, - { - "key": "--", - "val": "Decrements the integer value by one" - } - ], - "Relational Operators": [ - { - "key": "==", - "val": "Checks for equality between operands" - }, - { - "key": "!=", - "val": "Checks for non equality between operands" - }, - { - "key": ">", - "val": "If the value of left operand is greater than the value of right operand,then the condition becomes true." - }, - { - "key": "<", - "val": "If the value of left operand is less than the value of right operand,then the condition becomes true." - }, - { - "key": ">=", - "val": "If the value of left operand is greater than or equal to the value of right operand,then the condition becomes true." - }, - { - "key": "<=", - "val": "If the value of left operand is less than or equal to the value of right operand,then the condition becomes true." - } - ], - "Logical Operators": [ - { - "key": "&&", - "val": "Logical AND operator" - }, - { - "key": "||", - "val": "Logical OR Operator" - }, - { - "key": "!", - "val": "Logical NOT Operator" - } - ], - "Bitwise Operators": [ - { - "key": "&", - "val": "Does AND on the bits in the corresponding position of the operands in its binary form" - }, - { - "key": "|", - "val": "Does OR on the bits in the corresponding position of the operands in its binary form" - }, - { - "key": "^", - "val": "Does XOR on the bits in the corresponding position of the operands in its binary form" - }, - { - "key": "~", - "val": "Inverts all the bits of operand(1's complement)" - }, - { - "key": "a<>b", - "val": "shifts a right b number of times" - } - ], - "Pointers": [ - { - "key": "type *name", - "val": "Declare pointer to type" - }, - { - "key": "type *f()", - "val": "Declare function returning pointer to type" - }, - { - "key": "type (*pf)()", - "val": "Declare pointer to function returning type" - }, - { - "key": "void *", - "val": "Generic pointer type" - } - ], - "Initialization": [ - { - "key": "type name=value", - "val": "Initialize variable" - }, - { - "key": "type name[]={value1,. . . }", - "val": "Initialize array" - }, - { - "key": "char name[]=\"string\"", - "val": "Initialize char string" - } - ] - } -} From 1caa8fe9f4ba74662b804279cd256ef532f045a0 Mon Sep 17 00:00:00 2001 From: JOBIN PHILIP ABRAHAM Date: Mon, 9 Nov 2015 21:54:22 +0530 Subject: [PATCH 058/379] Update cpp.json --- share/goodie/cheat_sheets/json/cpp.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/share/goodie/cheat_sheets/json/cpp.json b/share/goodie/cheat_sheets/json/cpp.json index c1675b3ed..21aac008c 100644 --- a/share/goodie/cheat_sheets/json/cpp.json +++ b/share/goodie/cheat_sheets/json/cpp.json @@ -1,7 +1,7 @@ { - "id": "c++_cheat_sheet", + "id": "cpp_cheat_sheet", "name": "C++", - "description": " A popular object-oriented programming language invented in 1979 by Bjarne Stroustrup", + "description": "A quick reference of c++ language", "metadata": { "sourceName": "cs", "sourceUrl": "http://www.cs.ccu.edu.tw/~damon/oop/,c++refcard.pdf" @@ -192,4 +192,4 @@ } ] } -} \ No newline at end of file +} From 7cefd1b52efcc7231e94da1c56fed97ed1b11533 Mon Sep 17 00:00:00 2001 From: jophab Date: Mon, 9 Nov 2015 17:13:21 +0000 Subject: [PATCH 059/379] Description of your changes --- share/goodie/cheat_sheets/json/jira.json | 166 +++++++++++++++++++++++ 1 file changed, 166 insertions(+) create mode 100644 share/goodie/cheat_sheets/json/jira.json diff --git a/share/goodie/cheat_sheets/json/jira.json b/share/goodie/cheat_sheets/json/jira.json new file mode 100644 index 000000000..1a5cb44b1 --- /dev/null +++ b/share/goodie/cheat_sheets/json/jira.json @@ -0,0 +1,166 @@ +{ + "id": "jira_cheat_sheet", + "name": "JIRA", + "description": "JIRA shortcuts", + "metadata": { + "sourceName": "cheatography", + "sourceUrl": "http://www.cheatography.com/ovi-mihai/cheat-sheets/jira/" + }, + "template_type": "reference", + "section_order": [ + "Global", + "Navigating Issues", + "Agile", + "Issue Actions" + ], + "aliases": [ + "jira shortcuts", + "jira keyboard shortcuts" + ], + "sections": { + "Global": [ + { + "key": "Quick Search", + "val": "/" + }, + { + "key": "Quick Operations", + "val": ". " + }, + { + "key": "Create Issue", + "val": "c" + }, + { + "key": "Next Item", + "val": "j" + }, + { + "key": "Previous Item", + "val": "p" + }, + { + "key": "Dashboard", + "val": "g d" + }, + { + "key": "Browse a Project", + "val": "g p" + }, + { + "key": "Agile", + "val": "g a" + }, + { + "key": "Find Issues", + "val": "g i" + }, + { + "key": "Adm Quick Search", + "val": "g g" + }, + { + "key": "Submit Form", + "val": "Ctrl + s" + }, + { + "key": "Help", + "val": "?" + } + ], + "Navigating Issues": [ + { + "key": "View selected", + "val": "o or Enter" + }, + { + "key": "Next Issue", + "val": "j" + }, + { + "key": "Previous Issue", + "val": "k" + }, + { + "key": "Assign to me", + "val": "i" + }, + { + "key": "Assign", + "val": "a" + }, + { + "key": "Dock/U­ncock Filters", + "val": "[" + }, + { + "key": "Next Activity", + "val": "n" + }, + { + "key": "Previous Activity", + "val": "p" + }, + { + "key": "Switch filter view", + "val": "t" + } + ], + "Agile": [ + { + "key": "Plan", + "val": "1" + }, + { + "key": "Work", + "val": "2" + }, + { + "key": "Report", + "val": "3" + }, + { + "key": "Presen­tation mode", + "val": "z" + }, + { + "key": "Next Column", + "val": "n" + }, + { + "key": "Previous Column", + "val": "p" + }, + { + "key": "Hide/Show Details", + "val": "t" + } + ], + "Issue Actions": [ + { + "key": "Edit Issue", + "val": "e" + }, + { + "key": "Assign issue", + "val": "a" + }, + { + "key": "Comment", + "val": "m" + }, + { + "key": "Edit Labels", + "val": "l" + }, + { + "key": "Jump to fields for editing", + "val": "," + }, + { + "key": "Assign To Me", + "val": "i" + } + ] + } +} \ No newline at end of file From 3cb282831e748adb059ac677834bcdebd04a9731 Mon Sep 17 00:00:00 2001 From: sublinear Date: Mon, 9 Nov 2015 18:44:59 +0000 Subject: [PATCH 060/379] rounding to two decimals places and using return unless instead of nested if statements --- lib/DDG/Goodie/NoteFrequency.pm | 84 +++++++++++++++------------------ t/NoteFrequency.t | 8 ++-- 2 files changed, 42 insertions(+), 50 deletions(-) diff --git a/lib/DDG/Goodie/NoteFrequency.pm b/lib/DDG/Goodie/NoteFrequency.pm index da3a024c5..7e4ffc033 100644 --- a/lib/DDG/Goodie/NoteFrequency.pm +++ b/lib/DDG/Goodie/NoteFrequency.pm @@ -4,6 +4,8 @@ package DDG::Goodie::NoteFrequency; use DDG::Goodie; use strict; +use Math::Round; + zci answer_type => "note_frequency"; zci is_cached => 1; @@ -27,62 +29,52 @@ handle remainder => sub { # must be a note letter, optional sharp or flat, octave number, and optional tuning frequency for A4 # e.g. "g#3 432" - if ( $_ =~ /^([A-Ga-g])([b#])?([0-8])(\s+[0-9]{1,5})?$/ ) { + return unless ($_ =~ /^([A-Ga-g])([b#])?([0-8])(\s+[0-9]{1,4})?$/ ); - my( $letter, $accidental, $octave, $tuning, $pitchClass, $midi, $frequency ); + my( $letter, $accidental, $octave, $tuning, $pitchClass, $midi, $frequency ); - # regex captures - if (defined $1) { $letter = uc($1); } else { $letter = ""; } - if (defined $2) { $accidental = $2; } else { $accidental = ""; } - if (defined $3) { $octave = $3 + 0; } else { $octave = 0; } - if (defined $4) { $tuning = $4 + 0; } else { $tuning = 0; } + # regex captures + if (defined $1) { $letter = uc($1); } else { $letter = ""; } + if (defined $2) { $accidental = $2; } else { $accidental = ""; } + if (defined $3) { $octave = $3 + 0; } else { $octave = 0; } + if (defined $4) { $tuning = $4 + 0; } else { $tuning = 0; } - # assume 440Hz tuning unless otherwise specified - if ( $tuning == 0 ) { $tuning = 440; } + # assume 440Hz tuning unless otherwise specified + if ( $tuning == 0 ) { $tuning = 440; } - # convert note letter to pitch class number - if ( $letter eq "C" ) { $pitchClass = 0; } - elsif ( $letter eq "D" ) { $pitchClass = 2; } - elsif ( $letter eq "E" ) { $pitchClass = 4; } - elsif ( $letter eq "F" ) { $pitchClass = 5; } - elsif ( $letter eq "G" ) { $pitchClass = 7; } - elsif ( $letter eq "A" ) { $pitchClass = 9; } - else { $pitchClass = 11; } + # convert note letter to pitch class number + if ( $letter eq "C" ) { $pitchClass = 0; } + elsif ( $letter eq "D" ) { $pitchClass = 2; } + elsif ( $letter eq "E" ) { $pitchClass = 4; } + elsif ( $letter eq "F" ) { $pitchClass = 5; } + elsif ( $letter eq "G" ) { $pitchClass = 7; } + elsif ( $letter eq "A" ) { $pitchClass = 9; } + else { $pitchClass = 11; } - # apply accidental to pitch class number - if ( $accidental eq "b" ) { $pitchClass -= 1; } - elsif ( $accidental eq "#" ) { $pitchClass += 1; } + # apply accidental to pitch class number + if ( $accidental eq "b" ) { $pitchClass -= 1; } + elsif ( $accidental eq "#" ) { $pitchClass += 1; } - # calculate MIDI number - $midi = ( 12 * ($octave + 1) ) + $pitchClass; + # calculate MIDI number + $midi = ( 12 * ($octave + 1) ) + $pitchClass; - # fix pitch class number - $pitchClass %= 12; + # fix pitch class number + $pitchClass %= 12; - # validate note is between C0 and B8 - if ( $midi >= 12 && $midi <= 119 ) { - # calculate frequency - $frequency = $tuning * ( 2 ** (($midi-69)/12) ); + # validate note is between C0 and B8 + return unless ( $midi >= 12 && $midi <= 119 ); - # result - return $frequency, - structured_answer => { - input => [html_enc($letter.$accidental.$octave." in A".$tuning." tuning")], - operation => "Note Frequency", - result => html_enc($frequency." Hz"), - }; - } + # calculate frequency + $frequency = $tuning * ( 2 ** (($midi-69)/12) ); + $frequency = nearest(0.01, $frequency); - # failed midi range validation - return; - } - - else { - - # failed regular expression - return; - - } + # result + return $frequency, + structured_answer => { + input => [html_enc($letter.$accidental.$octave." in A".$tuning." tuning")], + operation => "Note Frequency", + result => html_enc($frequency." Hz"), + }; }; 1; diff --git a/t/NoteFrequency.t b/t/NoteFrequency.t index d2dea6c45..724b5b92a 100644 --- a/t/NoteFrequency.t +++ b/t/NoteFrequency.t @@ -18,18 +18,18 @@ ddg_goodie_test( result => "440 Hz" }), "notefreq gb5" => test_zci( - "739.988845423269", + "739.99", structured_answer => { input => ["Gb5 in A440 tuning"], operation => "Note Frequency", - result => "739.988845423269 Hz" + result => "739.99 Hz" }), "notefreq c3 432" => test_zci( - "128.434368420294", + "128.43", structured_answer => { input => ["C3 in A432 tuning"], operation => "Note Frequency", - result => "128.434368420294 Hz" + result => "128.43 Hz" }), "notefreq a4 100000" => undef, "notefreq b#8" => undef, From 7d9f9594bdcf5c31bb800575a6c8a62ed9398644 Mon Sep 17 00:00:00 2001 From: Thomas Denizou Date: Mon, 9 Nov 2015 16:24:58 -0500 Subject: [PATCH 061/379] IdiotEdit: Forgot the comma. Wow. 10/10 java. --- share/goodie/cheat_sheets/json/microsoft-word.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/goodie/cheat_sheets/json/microsoft-word.json b/share/goodie/cheat_sheets/json/microsoft-word.json index e82cfec1f..5020bbe5d 100644 --- a/share/goodie/cheat_sheets/json/microsoft-word.json +++ b/share/goodie/cheat_sheets/json/microsoft-word.json @@ -7,7 +7,7 @@ "sourceUrl": "http://www.dummies.com/how-to/content/word-2010-for-dummies-cheat-sheet.html" }, "aliases": [ - "ms word" + "ms word", "winword" ], "template_type": "keyboard", From 30814e454ef9759f036dc6285abf7f5b8fbb5dfd Mon Sep 17 00:00:00 2001 From: sublinear Date: Mon, 9 Nov 2015 21:42:18 +0000 Subject: [PATCH 062/379] added hz to end of regex expression and implemented rounding to two decimal places without libs --- lib/DDG/Goodie/NoteFrequency.pm | 16 +++++++++------- t/NoteFrequency.t | 8 ++++++++ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/lib/DDG/Goodie/NoteFrequency.pm b/lib/DDG/Goodie/NoteFrequency.pm index 7e4ffc033..efdb6681f 100644 --- a/lib/DDG/Goodie/NoteFrequency.pm +++ b/lib/DDG/Goodie/NoteFrequency.pm @@ -4,8 +4,6 @@ package DDG::Goodie::NoteFrequency; use DDG::Goodie; use strict; -use Math::Round; - zci answer_type => "note_frequency"; zci is_cached => 1; @@ -26,10 +24,12 @@ handle remainder => sub { return unless $_; - # must be a note letter, optional sharp or flat, octave number, and optional tuning frequency for A4 - # e.g. "g#3 432" + # must be a note letter, optional sharp or flat, + # octave number, optional tuning frequency for A4, + # and optional case-insensitive "hz" with or without preceding whitespace + # e.g. "g#3 432 hz" or "ab5 435Hz" - return unless ($_ =~ /^([A-Ga-g])([b#])?([0-8])(\s+[0-9]{1,4})?$/ ); + return unless ($_ =~ /^([A-Ga-g])([b#])?([0-8])(\s+[0-9]{1,4})?(\s?[hH][zZ])?$/ ); my( $letter, $accidental, $octave, $tuning, $pitchClass, $midi, $frequency ); @@ -66,13 +66,15 @@ handle remainder => sub { # calculate frequency $frequency = $tuning * ( 2 ** (($midi-69)/12) ); - $frequency = nearest(0.01, $frequency); + + # round to two decimal places (is never negative anyway and avoids libs) + $frequency = int(100 * ($frequency + 0.005)) / 100; # result return $frequency, structured_answer => { input => [html_enc($letter.$accidental.$octave." in A".$tuning." tuning")], - operation => "Note Frequency", + operation => "Note Frequency", result => html_enc($frequency." Hz"), }; }; diff --git a/t/NoteFrequency.t b/t/NoteFrequency.t index 724b5b92a..c7600d3c4 100644 --- a/t/NoteFrequency.t +++ b/t/NoteFrequency.t @@ -31,6 +31,14 @@ ddg_goodie_test( operation => "Note Frequency", result => "128.43 Hz" }), + "notefreq c3 432Hz" => test_zci( + "128.43", + structured_answer => { + input => ["C3 in A432 tuning"], + operation => "Note Frequency", + result => "128.43 Hz" + }), + "notefreq c3 432 Hz" => undef, "notefreq a4 100000" => undef, "notefreq b#8" => undef, "notefreq cb0" => undef, From f95a07e80efe92d86b5928b84e6df63833fc77dd Mon Sep 17 00:00:00 2001 From: JOBIN PHILIP ABRAHAM Date: Tue, 10 Nov 2015 07:14:44 +0530 Subject: [PATCH 063/379] Delete jira.json --- share/goodie/cheat_sheets/json/jira.json | 166 ----------------------- 1 file changed, 166 deletions(-) delete mode 100644 share/goodie/cheat_sheets/json/jira.json diff --git a/share/goodie/cheat_sheets/json/jira.json b/share/goodie/cheat_sheets/json/jira.json deleted file mode 100644 index 1a5cb44b1..000000000 --- a/share/goodie/cheat_sheets/json/jira.json +++ /dev/null @@ -1,166 +0,0 @@ -{ - "id": "jira_cheat_sheet", - "name": "JIRA", - "description": "JIRA shortcuts", - "metadata": { - "sourceName": "cheatography", - "sourceUrl": "http://www.cheatography.com/ovi-mihai/cheat-sheets/jira/" - }, - "template_type": "reference", - "section_order": [ - "Global", - "Navigating Issues", - "Agile", - "Issue Actions" - ], - "aliases": [ - "jira shortcuts", - "jira keyboard shortcuts" - ], - "sections": { - "Global": [ - { - "key": "Quick Search", - "val": "/" - }, - { - "key": "Quick Operations", - "val": ". " - }, - { - "key": "Create Issue", - "val": "c" - }, - { - "key": "Next Item", - "val": "j" - }, - { - "key": "Previous Item", - "val": "p" - }, - { - "key": "Dashboard", - "val": "g d" - }, - { - "key": "Browse a Project", - "val": "g p" - }, - { - "key": "Agile", - "val": "g a" - }, - { - "key": "Find Issues", - "val": "g i" - }, - { - "key": "Adm Quick Search", - "val": "g g" - }, - { - "key": "Submit Form", - "val": "Ctrl + s" - }, - { - "key": "Help", - "val": "?" - } - ], - "Navigating Issues": [ - { - "key": "View selected", - "val": "o or Enter" - }, - { - "key": "Next Issue", - "val": "j" - }, - { - "key": "Previous Issue", - "val": "k" - }, - { - "key": "Assign to me", - "val": "i" - }, - { - "key": "Assign", - "val": "a" - }, - { - "key": "Dock/U­ncock Filters", - "val": "[" - }, - { - "key": "Next Activity", - "val": "n" - }, - { - "key": "Previous Activity", - "val": "p" - }, - { - "key": "Switch filter view", - "val": "t" - } - ], - "Agile": [ - { - "key": "Plan", - "val": "1" - }, - { - "key": "Work", - "val": "2" - }, - { - "key": "Report", - "val": "3" - }, - { - "key": "Presen­tation mode", - "val": "z" - }, - { - "key": "Next Column", - "val": "n" - }, - { - "key": "Previous Column", - "val": "p" - }, - { - "key": "Hide/Show Details", - "val": "t" - } - ], - "Issue Actions": [ - { - "key": "Edit Issue", - "val": "e" - }, - { - "key": "Assign issue", - "val": "a" - }, - { - "key": "Comment", - "val": "m" - }, - { - "key": "Edit Labels", - "val": "l" - }, - { - "key": "Jump to fields for editing", - "val": "," - }, - { - "key": "Assign To Me", - "val": "i" - } - ] - } -} \ No newline at end of file From 326fe0dc8173227656dc6637c5fe93ab7d4b11fb Mon Sep 17 00:00:00 2001 From: JOBIN PHILIP ABRAHAM Date: Fri, 13 Nov 2015 17:36:34 +0530 Subject: [PATCH 064/379] Delete cpp.json --- share/goodie/cheat_sheets/json/cpp.json | 195 ------------------------ 1 file changed, 195 deletions(-) delete mode 100644 share/goodie/cheat_sheets/json/cpp.json diff --git a/share/goodie/cheat_sheets/json/cpp.json b/share/goodie/cheat_sheets/json/cpp.json deleted file mode 100644 index 21aac008c..000000000 --- a/share/goodie/cheat_sheets/json/cpp.json +++ /dev/null @@ -1,195 +0,0 @@ -{ - "id": "cpp_cheat_sheet", - "name": "C++", - "description": "A quick reference of c++ language", - "metadata": { - "sourceName": "cs", - "sourceUrl": "http://www.cs.ccu.edu.tw/~damon/oop/,c++refcard.pdf" - }, - "template_type": "reference", - "section_order": [ - "Fundamental Data Types", - "Preprocessor Directives", - "Arithmetic Operators", - "Relational Operators", - "Logical Operators", - "Bitwise Operators", - "Namespaces", - "Console Input/Output", - "Class Member Protections" - ], - "aliases": [ - "c++", - "c plus plus" - ], - "sections": { - "Fundamental Data Types": [ - { - "key": "char", - "val": "Character (1 byte)" - }, - { - "key": "int", - "val": "Integer " - }, - { - "key": "float", - "val": "Floating point" - }, - { - "key": "bool", - "val": "True or false" - }, - { - "key": "void", - "val": "No value" - } - ], - "Preprocessor Directives": [ - { - "key": "#include ", - "val": "Include library file" - }, - { - "key": "#include \"filename\"", - "val": "Include user file" - }, - { - "key": "#define name text", - "val": "Define a macro" - }, - { - "key": "#define name(var) text", - "val": "Define a parameterized macro" - }, - { - "key": "#undef name", - "val": "Undefine a previously defined macro" - }, - { - "key": "#if, #else, #elif, #endif", - "val": "Conditional execution" - } - ], - "Arithmetic Operators": [ - { - "key": "+", - "val": "Adds two operands" - }, - { - "key": "−", - "val": "Subtracts second operand from the first" - }, - { - "key": "*", - "val": "Multiplies both operands" - }, - { - "key": "/", - "val": "Divides numerator by de-numerator" - }, - { - "key": "%", - "val": "Modulus Operator" - }, - { - "key": "++", - "val": "Increases the integer value by one" - }, - { - "key": "--", - "val": "Decreases the integer value by one" - } - ], - "Relational Operators": [ - { - "key": "==", - "val": "Checks for equality between operands" - }, - { - "key": "!=", - "val": "Checks for non equality between operands" - }, - { - "key": ">", - "val": "Checks if the value of left operand is greater than the value of right operand. If yes, then the condition becomes true." - }, - { - "key": "<", - "val": "Checks if the value of left operand is less than the value of right operand. If yes, then the condition becomes true." - }, - { - "key": ">=", - "val": "Checks if the value of left operand is greater than or equal to the value of right operand. If yes, then the condition becomes true." - }, - { - "key": "<=", - "val": "Checks if the value of left operand is less than or equal to the value of right operand. If yes, then the condition becomes true." - } - ], - "Logical Operators": [ - { - "key": "&&", - "val": "Logical AND operator" - }, - { - "key": "||", - "val": "Logical OR Operator" - }, - { - "key": "!", - "val": "Logical NOT Operator" - } - ], - "Bitwise Operators": [ - { - "key": "&", - "val": "Does the logical AND on the bits in the corresponding position of the operands in its binary form" - }, - { - "key": "|", - "val": "Does the logical OR on the bits in the corresponding position of the operands in its binary form" - }, - { - "key": "^", - "val": "Does XOR on the bits in the corresponding position of the operands in its binary form" - }, - { - "key": "~", - "val": "Inverts all the bits of operand" - }, - { - "key": "<<", - "val": "Takes two numbers, left shifts the bits of first operand, the second operand decides the number of places to shift" - }, - { - "key": ">>", - "val": "Takes two numbers, right shifts the bits of first operand, the second operand decides the number of places to shift" - } - ], - "Namespaces": [ - { - "key": "namespace name {...}", - "val": "Define namespace for the enclosed code" - }, - { - "key": "using name;", - "val": "Import function and variable definition from the given namespace into the current namespace" - } - ], - "Class Member Protections": [ - { - "key": "public", - "val": "Anyone outside the class may access these member functions and variables" - }, - { - "key": "private", - "val": "Only the class's member functions and friends may access the data." - }, - { - "key": "protected", - "val": "Only the class's member functions, friends, and derived classes may access." - } - ] - } -} From 842630707a0dc8771ccfd539eb28f7f35612b13d Mon Sep 17 00:00:00 2001 From: JOBIN PHILIP ABRAHAM Date: Fri, 13 Nov 2015 17:39:11 +0530 Subject: [PATCH 065/379] Create jira.json --- share/goodie/cheat_sheets/json/jira.json | 166 +++++++++++++++++++++++ 1 file changed, 166 insertions(+) create mode 100644 share/goodie/cheat_sheets/json/jira.json diff --git a/share/goodie/cheat_sheets/json/jira.json b/share/goodie/cheat_sheets/json/jira.json new file mode 100644 index 000000000..c3fbb7bcd --- /dev/null +++ b/share/goodie/cheat_sheets/json/jira.json @@ -0,0 +1,166 @@ +{ + "id": "jira_cheat_sheet", + "name": "JIRA", + "description": "JIRA shortcuts", + "metadata": { + "sourceName": "cheatography", + "sourceUrl": "http://www.cheatography.com/ovi-mihai/cheat-sheets/jira/" + }, + "template_type": "reference", + "section_order": [ + "Global", + "Navigating Issues", + "Agile", + "Issue Actions" + ], + "aliases": [ + "jira shortcuts", + "jira keyboard shortcuts" + ], + "sections": { + "Global": [ + { + "key": "Quick Search", + "val": "/" + }, + { + "key": "Quick Operations", + "val": ". " + }, + { + "key": "Create Issue", + "val": "c" + }, + { + "key": "Next Item", + "val": "j" + }, + { + "key": "Previous Item", + "val": "p" + }, + { + "key": "Dashboard", + "val": "g d" + }, + { + "key": "Browse a Project", + "val": "g p" + }, + { + "key": "Agile", + "val": "g a" + }, + { + "key": "Find Issues", + "val": "g i" + }, + { + "key": "Adm Quick Search", + "val": "g g" + }, + { + "key": "Submit Form", + "val": "Ctrl + s" + }, + { + "key": "Help", + "val": "?" + } + ], + "Navigating Issues": [ + { + "key": "View selected", + "val": "o or Enter" + }, + { + "key": "Next Issue", + "val": "j" + }, + { + "key": "Previous Issue", + "val": "k" + }, + { + "key": "Assign to me", + "val": "i" + }, + { + "key": "Assign", + "val": "a" + }, + { + "key": "Dock/U­ncock Filters", + "val": "[" + }, + { + "key": "Next Activity", + "val": "n" + }, + { + "key": "Previous Activity", + "val": "p" + }, + { + "key": "Switch filter view", + "val": "t" + } + ], + "Agile": [ + { + "key": "Plan", + "val": "1" + }, + { + "key": "Work", + "val": "2" + }, + { + "key": "Report", + "val": "3" + }, + { + "key": "Presen­tation mode", + "val": "z" + }, + { + "key": "Next Column", + "val": "n" + }, + { + "key": "Previous Column", + "val": "p" + }, + { + "key": "Hide/Show Details", + "val": "t" + } + ], + "Issue Actions": [ + { + "key": "Edit Issue", + "val": "e" + }, + { + "key": "Assign issue", + "val": "a" + }, + { + "key": "Comment", + "val": "m" + }, + { + "key": "Edit Labels", + "val": "l" + }, + { + "key": "Jump to fields for editing", + "val": "," + }, + { + "key": "Assign To Me", + "val": "i" + } + ] + } +} From cbfa8b62c733aa0b1d770646d032223527659a42 Mon Sep 17 00:00:00 2001 From: JOBIN PHILIP ABRAHAM Date: Sat, 14 Nov 2015 09:35:20 +0530 Subject: [PATCH 066/379] Update jira.json --- share/goodie/cheat_sheets/json/jira.json | 1 - 1 file changed, 1 deletion(-) diff --git a/share/goodie/cheat_sheets/json/jira.json b/share/goodie/cheat_sheets/json/jira.json index c3fbb7bcd..ca1f579ec 100644 --- a/share/goodie/cheat_sheets/json/jira.json +++ b/share/goodie/cheat_sheets/json/jira.json @@ -1,7 +1,6 @@ { "id": "jira_cheat_sheet", "name": "JIRA", - "description": "JIRA shortcuts", "metadata": { "sourceName": "cheatography", "sourceUrl": "http://www.cheatography.com/ovi-mihai/cheat-sheets/jira/" From 684329676c4a5e518c4c8696a1be71644aafbdbf Mon Sep 17 00:00:00 2001 From: Mailkov Date: Sat, 14 Nov 2015 05:47:10 +0000 Subject: [PATCH 067/379] Issue #1646 - Eclipse IDE Cheat Sheet: fix JS Error --- share/goodie/cheat_sheets/cheat_sheets.js | 11 ++++++++++- share/goodie/cheat_sheets/json/eclipse.json | 4 ++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/share/goodie/cheat_sheets/cheat_sheets.js b/share/goodie/cheat_sheets/cheat_sheets.js index 693ce9bfd..1cec842e6 100644 --- a/share/goodie/cheat_sheets/cheat_sheets.js +++ b/share/goodie/cheat_sheets/cheat_sheets.js @@ -19,7 +19,16 @@ DDH.cheat_sheets.build = function(ops) { } else if ( i === 1 && !is_mobile ){ showhide = false; } - + + //replaces * and / fixing issue1646 + var val; + for (var j = 0; j < sections[section].length; j++){ + val = sections[section][j].val; + val = val.replace(/*//g, "*/") + .replace(//*/g, "/*"); + sections[section][j].val = val; + } + result += options.fn({ name: section, items: sections[section], template: template, showhide: showhide }); } }); diff --git a/share/goodie/cheat_sheets/json/eclipse.json b/share/goodie/cheat_sheets/json/eclipse.json index f72efce06..e6d8f5b62 100644 --- a/share/goodie/cheat_sheets/json/eclipse.json +++ b/share/goodie/cheat_sheets/json/eclipse.json @@ -386,7 +386,7 @@ }, { "key": "[Ctrl] [Shift] [/]", - "val": "Add Block Comment around selection ( adds '/... */' )" + "val": "Add Block Comment around selection ( adds '/... */' )" }, { "key": "[Ctrl] [Shift] [\\\\]", @@ -394,7 +394,7 @@ }, { "key": "[Alt] [Shift] [J]", - "val": "Add Element Comment ( adds '/** ... */')" + "val": "Add Element Comment ( adds '/**; ... */')" } ], "Editing Source Code": [ From c14464b8a22013048b7c8c2cf9ecbcf9f715af55 Mon Sep 17 00:00:00 2001 From: Mailkov Date: Sat, 14 Nov 2015 05:53:06 +0000 Subject: [PATCH 068/379] Issue #1646 - fix eclipse --- share/goodie/cheat_sheets/json/eclipse.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/goodie/cheat_sheets/json/eclipse.json b/share/goodie/cheat_sheets/json/eclipse.json index e6d8f5b62..6b7ea02bb 100644 --- a/share/goodie/cheat_sheets/json/eclipse.json +++ b/share/goodie/cheat_sheets/json/eclipse.json @@ -394,7 +394,7 @@ }, { "key": "[Alt] [Shift] [J]", - "val": "Add Element Comment ( adds '/**; ... */')" + "val": "Add Element Comment ( adds '/** ... */')" } ], "Editing Source Code": [ From dacd6ea55ccb610ef1d83ceeceedd71bfaa8a68e Mon Sep 17 00:00:00 2001 From: Mailkov Date: Sat, 14 Nov 2015 06:01:17 +0000 Subject: [PATCH 069/379] Issue #1646 - comment --- share/goodie/cheat_sheets/cheat_sheets.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/goodie/cheat_sheets/cheat_sheets.js b/share/goodie/cheat_sheets/cheat_sheets.js index 1cec842e6..48e8d4043 100644 --- a/share/goodie/cheat_sheets/cheat_sheets.js +++ b/share/goodie/cheat_sheets/cheat_sheets.js @@ -20,7 +20,7 @@ DDH.cheat_sheets.build = function(ops) { showhide = false; } - //replaces * and / fixing issue1646 + //replaces */ and /* to */ and /* fixing issue1646 var val; for (var j = 0; j < sections[section].length; j++){ val = sections[section][j].val; From df11ff62b9821c3377827892b21b7357c5862654 Mon Sep 17 00:00:00 2001 From: ankushg07 Date: Sat, 14 Nov 2015 07:41:07 +0000 Subject: [PATCH 070/379] Branch Updated --- share/goodie/cheat_sheets/safari.json | 65 --------------------------- 1 file changed, 65 deletions(-) delete mode 100644 share/goodie/cheat_sheets/safari.json diff --git a/share/goodie/cheat_sheets/safari.json b/share/goodie/cheat_sheets/safari.json deleted file mode 100644 index e5106db13..000000000 --- a/share/goodie/cheat_sheets/safari.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "id": "safari_cheat_sheet", - "name": "Safari Keyboard Shortcuts", - "description": "List of useful keyboard shortcuts for Safari Browser", - "metadata": { - "sourceName": "safari keyboard shortcuts", - "sourceUrl": "https://support.apple.com/kb/PH17148?locale=en_US" - }, - "template_type": "keyboard", - "section_order" : ["General"], - "sections":{ - "General":[{ - "key":"[⌘] + [T]", - "val":"Open new tab" - },{ - "key":"[⌘] + [Shift+Right Arrow/Left Arrow]", - "val":"Jump to next / jump to previous tab" - },{ - "key":"[⌘] + [W]", - "val":"Close current tab" - },{ - "key":"[⌘] + [Z]", - "val":"Re-open closed tab (undo command)" - },{ - "key":"[⌘] + [Option] + [w]", - "val":"Close all tabs except active tab" - },{ - "key":"[⌘] + [N]", - "val":"Open New Safari Window" - },{ - "key":"[⌘] + [M]", - "val":"Minimize current Window" - },{ - "key":"[⌘] + [H]", - "val":"Hide all Safari Windows" - },{ - "key":"[⌘] + [Shift] + [W]", - "val":"Close Safari Window (current window, all tabs)" - },{ - "key":"[⌘] + [Shift] + [`]", - "val":"Jump to next / jump to previous Safari Windows" - },{ - "key":"[⌘] + [Q]", - "val":"Close Safari (all windows, all tabs)" - },{ - "key":"[Option] + [⌘] + [1]", - "val":"Show Top Sites" - },{ - "key":"[Option] + [⌘] + [2]", - "val":"Show Collections (history, bookmarks, ...)" - },{ - "key":"[⌘] + [D]", - "val":"Bookmark Page" - },{ - "key":"[⌘] + [Shift] + [N]", - "val":"Open New Private Window (equivalent of Incognito mode in Google Chrome)" - },{ - "key":"[⌘] + [1...9]", - "val":"Jump to bookmark #1, #2, … from Bookmark Bar" - },{ - "key":"[⌘] + [Shift] + [L]", - "val":"Show Sidebar (to display Bookmarks, Reading List, and Shared Links pane)" - }] - } -} \ No newline at end of file From d93f792484fd78bffa17b98a4ef87f26704273b8 Mon Sep 17 00:00:00 2001 From: ankushg07 Date: Sat, 14 Nov 2015 07:45:22 +0000 Subject: [PATCH 071/379] Removed vitamin.json --- share/goodie/cheat_sheets/vitamin.json | 78 -------------------------- 1 file changed, 78 deletions(-) delete mode 100644 share/goodie/cheat_sheets/vitamin.json diff --git a/share/goodie/cheat_sheets/vitamin.json b/share/goodie/cheat_sheets/vitamin.json deleted file mode 100644 index eace4ab92..000000000 --- a/share/goodie/cheat_sheets/vitamin.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "id": "vitamin_cheat_sheet", - "name": "Vitamins", - "description": "benefits and source of each vitamin", - "metadata": { - "sourceName": "Wikipedia", - "sourceUrl": "https://en.wikipedia.org/wiki/Vitamin" - }, - "template_type": "reference", - "section_order":[ - "Source", - "Benefits" - ], - "sections":{ - "Source":[{ - "key":"Vitamin A", - "val":"Liver/fish/Milk/cheese" - },{ - "key":"Vitamin B1", - "val":"Grains/Liver/pork/dried beans/nuts" - },{ - "key":"Vitamin B2", - "val":"Soybeans/meat/poultry/liver/eggs" - },{ - "key":"Vitamin B3", - "val":"Mushrooms/Peanut butter/meat/fish," - },{ - "key":"Vitamin B6", - "val":"Potatoes/bananas" - },{ - "key":"Vitamin B12", - "val":"Milk/cheese/yogurt/fortified soy" - },{ - "key":"Vitamin C", - "val":"Citrus fruits" - },{ - "key":"Vitamin D", - "val":"fish/eggs/organ meats/fish/liver oils" - },{ - "key":"Vitamin E", - "val":"Vegetable oils/Avocados/leafy green vegetables" - },{ - "key":"Vitamin K", - "val":"Broccoli/soybeans/dark green leafy vegetables" - }], - "Benefits":[{ - "key":"Vitamin A", - "val":"Helps you to see in the day and at night." - },{ - "key":"Vitamin B1", - "val":"Helps with energy production in your body." - },{ - "key":"Vitamin B2", - "val":"Helps with energy production in your body." - },{ - "key":"Vitamin B3", - "val":"Helps your body to use protein, fat and carbohydrate to make energy" - },{ - "key":"Vitamin B6", - "val":"Helps form hemoglobin which carries oxygen" - },{ - "key":"Vitamin B12", - "val":"Helps to make healthy blood cells" - },{ - "key":"Vitamin C", - "val":"May help prevent cell damage and reduce risk for certain " - },{ - "key":"Vitamin D", - "val":"Making Bone & Teeth stronger and healthier" - },{ - "key":"Vitamin E", - "val":"Helps to maintain a healthy immune system" - },{ - "key":"Vitamin K", - "val":"Makes proteins that cause our blood to clot" - }] - } -} \ No newline at end of file From 6fd9f1114fb89835fb859fb6c6a71780eee9ba50 Mon Sep 17 00:00:00 2001 From: Zaahir Moolla Date: Sat, 14 Nov 2015 11:51:04 -0500 Subject: [PATCH 072/379] Update template Perl, add template JS file --- template/lib/DDG/Goodie/Example.pm | 24 +++++++++- template/share/goodie/example/example.js | 61 ++++++++++++++++++++++++ 2 files changed, 83 insertions(+), 2 deletions(-) create mode 100644 template/share/goodie/example/example.js diff --git a/template/lib/DDG/Goodie/Example.pm b/template/lib/DDG/Goodie/Example.pm index 90f86029b..0df55e483 100644 --- a/template/lib/DDG/Goodie/Example.pm +++ b/template/lib/DDG/Goodie/Example.pm @@ -1,4 +1,5 @@ package DDG::Goodie::<: $ia_package_name :>; + # ABSTRACT: Write an abstract here # Start at https://duck.co/duckduckhack/goodie_overview if you are new # to instant answer development @@ -9,14 +10,33 @@ use strict; zci answer_type => '<: $lia_name :>'; zci is_cached => 1; +name '<: $lia_name :>'; + # Triggers triggers any => 'triggerWord', 'trigger phrase'; # Handle statement handle remainder => sub { - # Query can be accessed in $_ - return $_; + # Optional - Guard against no remainder + # i.e. the query is only 'triggerWord' or 'trigger phrase' + # + # return unless $remainder; + + # Optional - Regular expression guard + # use this approach to ensure the remainder matches a pattern + # i.e. it only contains letters, or numbers, or contains certain words + # + # return unless qr/^\w+/; + + return "plain text response", + structured_answer => { + id => '<: $lia_id :>', # Should be an existing Instant Answer topic + name => 'Answerbar Tab Name', # Should be an existing Instant Answer topic + data => { q => $_ }, + templates => 1 + }; + }; }; 1; diff --git a/template/share/goodie/example/example.js b/template/share/goodie/example/example.js new file mode 100644 index 000000000..219b80a37 --- /dev/null +++ b/template/share/goodie/example/example.js @@ -0,0 +1,61 @@ +DDH.'<: $lia_id :>' = DDH.'<: $lia_id :>' || {}; + + +(function(env) { + + console.log("DDH.'<: $lia_id :>'.build"); + + // define private variables and functions here + + DDH.'<: $lia_id :>'.build = function(ops) { + + return { + id: "life", + + meta: { + sourceName: "Source Domain", + sourceUrl: "https://source.website.com" + }, + + // data: { + // already defined in Perl Package + // you can re-define it here + // or access/modify 'ops.data' + // }, + + // normalize: function(item){ + // use this to map your 'data' + // to the properties required for your chosen template + // + // return { + // title: data.myTitle + // subtitle: data.foo.subtitle + // }; + // }, + + templates: { + group: 'text', + + // options: { + // + // }, + + // variants: { + // + // } + }, + + // Function that executes after template content is displayed + onShow: function() { + + // define any callbacks or event handlers here + // + // var $dom = $(".zci--'<: $lia_id :>'"); + // $dom.find(".my-special-class").click(funtcion(){ + // + // }); + + } + }; + }; +})(DDH); From fb33450f8dd7fc46d587c0eb809ff7bf88b008ca Mon Sep 17 00:00:00 2001 From: Zaahir Moolla Date: Sat, 14 Nov 2015 11:52:21 -0500 Subject: [PATCH 073/379] Convert tabs to spaces --- template/share/goodie/example/example.js | 52 ++++++++++++------------ 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/template/share/goodie/example/example.js b/template/share/goodie/example/example.js index 219b80a37..143eb0b0c 100644 --- a/template/share/goodie/example/example.js +++ b/template/share/goodie/example/example.js @@ -5,7 +5,7 @@ DDH.'<: $lia_id :>' = DDH.'<: $lia_id :>' || {}; console.log("DDH.'<: $lia_id :>'.build"); - // define private variables and functions here + // define private variables and functions here DDH.'<: $lia_id :>'.build = function(ops) { @@ -13,25 +13,25 @@ DDH.'<: $lia_id :>' = DDH.'<: $lia_id :>' || {}; id: "life", meta: { - sourceName: "Source Domain", - sourceUrl: "https://source.website.com" - }, + sourceName: "Source Domain", + sourceUrl: "https://source.website.com" + }, - // data: { - // already defined in Perl Package - // you can re-define it here - // or access/modify 'ops.data' - // }, + // data: { + // already defined in Perl Package + // you can re-define it here + // or access/modify 'ops.data' + // }, - // normalize: function(item){ - // use this to map your 'data' - // to the properties required for your chosen template - // - // return { - // title: data.myTitle - // subtitle: data.foo.subtitle - // }; - // }, + // normalize: function(item){ + // use this to map your 'data' + // to the properties required for your chosen template + // + // return { + // title: data.myTitle + // subtitle: data.foo.subtitle + // }; + // }, templates: { group: 'text', @@ -45,15 +45,15 @@ DDH.'<: $lia_id :>' = DDH.'<: $lia_id :>' || {}; // } }, - // Function that executes after template content is displayed - onShow: function() { + // Function that executes after template content is displayed + onShow: function() { - // define any callbacks or event handlers here - // - // var $dom = $(".zci--'<: $lia_id :>'"); - // $dom.find(".my-special-class").click(funtcion(){ - // - // }); + // define any callbacks or event handlers here + // + // var $dom = $(".zci--'<: $lia_id :>'"); + // $dom.find(".my-special-class").click(funtcion(){ + // + // }); } }; From 843c5ecdf577c70a0f9f30151d2825b407e469f7 Mon Sep 17 00:00:00 2001 From: Lerna Ekmekcioglu Date: Sun, 15 Nov 2015 09:05:23 -0500 Subject: [PATCH 074/379] Add armenian cheat sheet using the new language template --- .../cheat_sheets/json/language/armenian.json | 219 ++++++++++++++++++ 1 file changed, 219 insertions(+) create mode 100644 share/goodie/cheat_sheets/json/language/armenian.json diff --git a/share/goodie/cheat_sheets/json/language/armenian.json b/share/goodie/cheat_sheets/json/language/armenian.json new file mode 100644 index 000000000..2599e8535 --- /dev/null +++ b/share/goodie/cheat_sheets/json/language/armenian.json @@ -0,0 +1,219 @@ +{ + "id" : "armenian_cheat_sheet", + + "name" : "Armenian Cheat Sheet (Western)", + + "metadata" : { + "sourceName" : "omniglot", + "sourceUrl" : "http://www.omniglot.com/language/phrases/westernarmenian.htm" + }, + + "aliases": [ + "armenian phrases", "armo phrases", "english to armenian", "basic armenian phrases", "basic armenian" + ], + + "template_type": "language", + + "section_order" : [ + "Etiquette", + "Basics", + "Getting Help", + "Travelling", + "Going out for dinner" + ], + + "description" : "Basic Armenian words and phrases", + + "sections" : { + "Etiquette" : [ + { + "key" : "Good morning", + "val" : "Բարի լոյս", + "trn" : "Pahree looys" + }, + { + "key" : "Good afternoon", + "val" : "Բարի կէսօր", + "trn": "Pahree guessore" + }, + { + "key" : "Good evening", + "val" : "Բարի իրիկուն", + "trn" : "Pahree eereegoon" + }, + { + "key" : "Goodbye (leaving)", + "val" : "Մնաք բարով", + "trn" : "Muh-nuck parov" + }, + { + "key" : "Goodbye (staying)", + "val" : "Երթաք բարով", + "trn" : "Yer-tuck parov" + }, + { + "key" : "Thanks", + "val" : "Շնորհակալ եմ", + "trn" : "Shnor-ha-gal em" + }, + { + "key" : "I am sorry", + "val" : "Ներողութիւն", + "trn" : "Neh-ro-ghoo-tune" + } + ], + "Getting Help" : [ + { + "key" : "Help", + "val" : "Օգնութիւն", + "trn" : "Oak-noo-tune" + }, + { + "key" : "Police", + "val" : "Ոստիկան", + "trn" : "Vohs-dee-gun" + }, + { + "key" : "Get a doctor", + "val" : "Բժիշկ կանչեցեք", + "trn" : "Puhsheeshk gun-chetzek" + }, + { + "key" : "I am sick", + "val" : "Հիւանդ եմ", + "trn" : "Hee-vunt ehm" + }, + { + "key" : "Somebody has stolen my ...", + "val" : "Մեկը գողցավ իմ ...", + "trn" : "Meh-guh khogh-tzahv eem ..." + }, + { + "key" : "Where is the hospital?", + "val" : "Հիւանդանոցը ո՞ւր է", + "trn" : "Heevon-tah-no-tzuh oor eh?" + } + ], + "Basics" : [ + { + "key" : "My name is ...", + "val" : "Անունս ... է", + "trn" : "Uh-noon-us ... eh" + }, + { + "key" : "I'm fine, thanks. And you?", + "val" : "Լաւ եմ, շնորհակալ եմ: Եւ դուք ինչպէ՞ս էք", + "trn" : "Laav em, shnor-hagal em. Yev took inch bess ek?" + }, + { + "key" : "How are you?", + "val" : "Ինչպէ՞ս էք", + "trn" : "Inch bess ek" + }, + { + "key" : "Hello", + "val" : "Բարև", + "trn" : "Pahrev" + }, + { + "key" : "Welcome", + "val" : "Բարի՜ եկաք", + "trn" : "Pah-ree yeh-guck" + }, + { + "key" : "What's your name?", + "val" : "Ձեր անունը ի՞նչ է", + "trn" : "Tzer a-noo-nuh inch eh" + } + ], + "Travelling" : [ + { + "key" : "Do you speak English?", + "val" : "Անգլիերէն կը խօսի՞ք", + "trn" : "Ahnc-laren guh kho-seek?" + }, + { + "key" : "Would you help me please?", + "val" : "Հաճիս ինծի կրնա՞ք օգնել", + "trn" : "Huh-jees intzi guhr-nuck ok-nell?" + }, + { + "key" : "Where is the toilet?", + "val" : "Պէտքարանը ո՞ւր է", + "trn" : "Bed-kara-nuh oor eh?" + }, + { + "key" : "How much is this?", + "val" : "Ասիկա ինչքա՞ն կ'արժէ", + "trn" : "Asee-guh inch-kun gar-zheh?" + }, + { + "key" : "Where can I find ...", + "val" : "Ո՞ւր կրնամ գտնալ ...", + "trn" : "Oor gr-num kuhd-null ...?" + }, + { + "key" : "What time does the shop open?", + "val" : "Ժամը քանի՞ին խանութը կը բացվի՞", + "trn" : "Shum-uh kun-ee-in kha-noo-tuh guh patzwee?" + }, + { + "key" : "What time does the shop close?", + "val" : "Ժամը քանի՞ին խանութը կը գոցվի՞", + "trn" : "Shum-uh kun-ee-in kha-noo-tuh guh kotzvee?" + }, + { + "key" : "Could you talk a bit slower?", + "val" : "Հաճիս աւելի կամաց կրնա՞ք խօսիլ", + "trn" : "Huhjees ave-lee ga-matz guhr-nock khoseel?" + }, + { + "key" : "Could you repeat that please?", + "val" : "Հաճիս կրնա՞ք կրկնել", + "trn" : "Huhjees guhr-nock gurg-nell?" + } + ], + "Going out for dinner" : [ + { + "key" : "Do you have vegetarian dishes?", + "val" : "Միայն բանջարեղէնով կերակուր ո՞ւնիք", + "trn" : "Mee-uhyn pun-chuh-reh-gheh-nov gue-ruh-goor oo-nik?" + }, + { + "key" : "I am allergic", + "val" : "Ալերժի ունիմ", + "trn" : "Aler-shee oo-neem" + }, + { + "key" : "The check, please", + "val" : "Հաշիւը, խնդրեմ", + "trn" : "Ha-shee-vuh, khuhn-trem" + }, + { + "key" : "A cup of coffee, please", + "val" : "Գաւաթ մը սուրճ, խնդրեմ", + "trn" : "Kuh-vut muh soorj, khuhn-trem" + }, + { + "key" : "A glass of water, please", + "val" : "Գաւաթ մը ջուր, խնդրեմ", + "trn" : "Kuh-vut muh choor, khuhn-trem" + }, + { + "key" : "Where is a good restaurant?", + "val" : "Լաւ ճաշարան մը ուր կը գտնուի", + "trn" : "Lav juh-shu-run muh oor guh kuhd-nuh-vee?" + }, + { + "key" : "A table for two, please", + "val" : "Երկու հոգինօձ սեղան, խնդրեմ", + "trn" : "Yer-goo ho-kee-notz se-ghun, khuhn-trem" + }, + { + "key" : "Can I get a menu, please", + "val" : "Ճաշացուցակ, խնդրեմ", + "trn" : "Juh-sha-tzoo-tzug, khuhn-trem" + } + ] + } +} From 320c168b1120271b02767615d0791ad8e624a287 Mon Sep 17 00:00:00 2001 From: lerna Date: Sun, 15 Nov 2015 09:09:06 -0500 Subject: [PATCH 075/379] Delete armenian.json --- share/goodie/cheat_sheets/json/armenian.json | 148 ------------------- 1 file changed, 148 deletions(-) delete mode 100644 share/goodie/cheat_sheets/json/armenian.json diff --git a/share/goodie/cheat_sheets/json/armenian.json b/share/goodie/cheat_sheets/json/armenian.json deleted file mode 100644 index 98f8a3c63..000000000 --- a/share/goodie/cheat_sheets/json/armenian.json +++ /dev/null @@ -1,148 +0,0 @@ -{ - "id" : "armenian_cheat_sheet", - - "name" : "Armenian Cheat Sheet (Western)", - - "metadata" : { - "sourceName" : "omniglot", - "sourceUrl" : "http://www.omniglot.com/language/phrases/westernarmenian.htm" - }, - - "aliases": [ - "armenian phrases", "english to armenian", "basic armenian phrases", "basic armenian" - ], - - "template_type": "reference", - - "section_order" : [ - "Basics", - "Etiquette", - "Getting Help", - "Traveling" - ], - - "description" : "Basic Armenian words and phrases", - - "sections" : { - "Etiquette" : [ - { - "val" : "Բարի լույս: (Pahree looys)", - "key" : "Good morning" - }, - { - "val" : "Բարի կէսօր: (Pahree guess-ore - rarely used)", - "key" : "Good afternoon" - }, - { - "val" : "Բարի իրիկուն: (Pahree Eeree-goon)", - "key" : "Good evening" - }, - { - "val" : "Մնաք բարով: (Muh-nuck parov) - leaving", - "key" : "Goodbye" - }, - { - "val" : "Երթաք բարով: (Yer-tuck parov) - staying", - "key" : "Goodbye" - }, - { - "val" : "Շնորհակալ եմ: (Shnor-ha-gal em)", - "key" : "Thanks" - }, - { - "val" : "Ներողութիւն: (Neh-ro-ghoo-tune)", - "key" : "I am sorry" - } - ], - "Getting Help" : [ - { - "val" : "Օգնութիւն (Oak-noo-tune)", - "key" : "Help" - }, - { - "val" : "Ոստիկան (Vohs-dee-gun)", - "key" : "Police" - }, - { - "val" : "Բժիշկ կանչեցեք: (Puhsheeshk gun-chetzek)", - "key" : "Get a doctor" - }, - { - "val" : "Հիւանդ եմ: (Hee-vunt ehm)", - "key" : "I am sick" - }, - { - "val" : "Մեկը գողցավ իմ ... (Meh-guh khogh-tzahv eem ...)", - "key" : "Somebody has stolen my..." - }, - { - "val" : "Հիւանդանոցը ո՞ւր է: (Heevon-tah-no-tzuh oor eh?)", - "key" : "Where is the hospital?" - } - ], - "Basics" : [ - { - "val" : "Անունս ... է: (Uh-noon-us ... eh)", - "key" : "My name is..." - }, - { - "val" : "Լաւ եմ, շնորհակալ եմ: Եւ դուք ինչպէ՞ս էք: (Laav em shnor-hagal em. Yev took inch bess ek?)", - "key" : "I'm fine, thanks. And you?" - }, - { - "val" : "Ինչպե՞ս եք: (Inch bess ek)", - "key" : "How are you?" - }, - { - "val" : "Բարև (Pahrev)", - "key" : "Hello" - }, - { - "val" : "Բարի՜ եկաք: (Pah-ree yeh-guck)", - "key" : "Welcome" - }, - { - "val" : "Ձեր անունը ի՞նչ է: (Tzer a-noo-nuh inch eh)", - "key" : "What's your name?" - } - ], - "Traveling" : [ - { - "val" : "Անգլիերէն կը խօսի՞ք: (Ahnc-laren guh kho-seek?)", - "key" : "Do you speak English?" - }, - { - "val" : "Հաճիս ինձի կրնա՞ք օգնել: (Huh-jees intzi guhr-nuck ok-nell?)", - "key" : "Would you help me please?" - }, - { - "val" : "Պէտքարանը ո՞ւր է: (Bed-kara-nuh oor eh?)", - "key" : "Where is the toilet?" - }, - { - "val" : "Ասիկա ինչքա՞ն կ'արժէ: (Asee-guh inch-khan gar-zheh?)", - "key" : "How much is this?" - }, - { - "val" : "Ուր կրնամ գտնա՞լ ... (Oor grnum kuhd-null ...?)", - "key" : "Where can I find ..." - }, - { - "val" : "Որ ատէն խանութը կը բացվի՞: (Vor adehn kha-noo-tuh guh patzwee?)", - "key" : "What time does the shop open?" - }, - { - "val" : "Որ ատէն խանութը կը գոցվի՞: (Vor adehn kha-noo-tuh guh kotzvee?)", - "key" : "What time does the shop close?" - }, - { - "val" : "Հաճիս աւելի կամաց կրնա՞ք խօսիլ: (Huhjees ave-lee ga-matz guhr-nock khoseel?", - "key" : "Could you talk a bit slower?" - }, - { - "val" : "Հաճիս կրնա՞ք կրկնել: (Huhjees guhr-nock ghurg-nell?)", - "key" : "Could you repeat that please?" - } - ] - } -} From afa19d8129b3d7df2b17b18e00597111db3ca448 Mon Sep 17 00:00:00 2001 From: ankushg07 Date: Tue, 17 Nov 2015 13:48:28 +0000 Subject: [PATCH 076/379] Fixed Formatting issues --- share/goodie/cheat_sheets/kde-keyboard.json | 48 ++++++++++----------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/share/goodie/cheat_sheets/kde-keyboard.json b/share/goodie/cheat_sheets/kde-keyboard.json index 83354dedd..89ee62671 100644 --- a/share/goodie/cheat_sheets/kde-keyboard.json +++ b/share/goodie/cheat_sheets/kde-keyboard.json @@ -11,80 +11,80 @@ "sections": { "Desktop Navigation": [{ "val": "Start menu / Access applications", - "key": "[Alt] + [F1] " + "key": "[Alt] [F1]" }, { "val": "Pop up new window", - "key": "[Alt] + [F2] " + "key": "[Alt] [F2]" }, { "val": "Lock desktop / Switch active user", - "key": "[Ctrl] + [Alt] + [L] " + "key": "[Ctrl] [Alt] [L]" }, { "val": "Show desktop", - "key": "[Ctrl] + [Alt] + [D] " + "key": "[Ctrl] [Alt] [D]" }, { "val": "Task manager", - "key": "[Ctrl] + [Esc] " + "key": "[Ctrl] [Esc]" }, { "val": "Rename file", - "key": "[F2]" + "key": "F2" }], "Desktop Shortcuts": [{ "val": "File menu", - "key": "[Alt] + [F] " + "key": "[Alt] [F]" }, { "val": "Edit menu", - "key": "[Alt] + [E] " + "key": "[Alt] [E]" }, { "val": "Copy selected text or items to the clipboard", - "key": "[Ctrl] + [C] " + "key": "[Ctrl] [C]" }, { "val": "View menu", - "key": "[Ctrl] + [V] " + "key": "[Ctrl] [V]" }, { "val": "Undo the last action", - "key": "[Ctrl] + [Z] " + "key": "[Ctrl] [Z]" }, { "val": "Paste special", - "key": "[Ctrl] + [Shift] + [V] " + "key": "[Ctrl] [Shift] [V]" }], "ScreenShot": [{ "val": "Take a screenshot", - "key": "[Prnt Scrn]" + "key": "Prnt Scrn" },{ "val": "Take a screenshot of a Window", - "key": "[Shift] + [Prnt Scrn]" + "key": "[Shift] [Prnt Scrn]" }], "Web Browser": [{ "val": "Bookmarks menu", - "key": "[Alt] + [B] " + "key": "[Alt] [B]" }, { "val": "URL Shortcuts (Adds www. + .com)", - "key": "[Ctrl] + [Enter] " + "key": "[Ctrl] [Enter]" }, { "val": "URL Shortcuts (Adds www. + .org)", - "key": "[Ctrl] + [Shift] + [Enter]" + "key": "[Ctrl] [Shift] [Enter]" }, { "val": "URL Shortcuts (Adds www. + .net)", - "key": "[Shift] + [Enter]" + "key": "[Shift] [Enter]" }, { "val": "Add a bookmark for the current location", - "key": "[Ctrl] + [B] " + "key": "[Ctrl] [B]" }, { "val": "Manage bookmarks", - "key": "[Ctrl] + [Shift] + [R] " + "key": "[Ctrl] [Shift] [R]" }], "Tab Management": [{ "val": "Create new tab", - "key": "[Ctrl] + [Shift] + [N]" + "key": "[Ctrl] [Shift] [N]" }, { "val": "Close current tab", - "key": "[Ctrl] + [W] " + "key": "[Ctrl] [W]" }, { "val": "Go to next tab", - "key": "[Ctrl] + [,] " + "key": "[Ctrl] [,]" }, { "val": "Go to previous tab", - "key": "[Ctrl] + [.] " + "key": "[Ctrl] [.]" }] } } \ No newline at end of file From d6aeaaf682e9c64c0b1ae668451b04cf03215c5c Mon Sep 17 00:00:00 2001 From: mohan08p Date: Tue, 17 Nov 2015 17:03:57 +0000 Subject: [PATCH 077/379] Mainframe cheat sheet added --- share/goodie/cheat_sheets/json/mainframe.json | 248 ++++++++++++++++++ 1 file changed, 248 insertions(+) create mode 100644 share/goodie/cheat_sheets/json/mainframe.json diff --git a/share/goodie/cheat_sheets/json/mainframe.json b/share/goodie/cheat_sheets/json/mainframe.json new file mode 100644 index 000000000..78776fb3a --- /dev/null +++ b/share/goodie/cheat_sheets/json/mainframe.json @@ -0,0 +1,248 @@ +{ + "id": "mainframe_cheat_sheet", + "name": "Mainframe", + "templete_type": "terminal", + "description": "Command Line Interface", + "metadata": { + "sourceName": "MainFrames", + "sourceUrl": "http://www.mainframes.com/Commands.html" + }, + "aliases": [ + "main frame", + "Mainframe cli", + "Main Frame commands" + ], + "section_order": [ + "JES2", + "MVS", + "DFSMS", + "TSO/E", + "VTAM", + "VLF", + "SDSF" + ], + "sections": { + "JES2": [ + { + "key": "$DSPL,JOBS=5", + "val": "Display all jobs using 5% or more of the spool" + }, + { + "key": "$A A", + "val": "To release all jobs" + }, + { + "key": "$ACTIVATE", + "val": "To activate new functions at the current release level of JES2" + }, + { + "key": "$ADD APPL", + "val": "To dynamically define a VTAM application to JES2 at the specified JES2 node." + }, + { + "key": "$ADD DESTID", + "val": "To dynamically define a symbolic name for a JES2 route code. " + }, + { + "key": "$ADD FSS", + "val": "To dynamically define a functional subsystem (FSS) to JES2" + }, + { + "key": "$ADD LINE(nnnn)", + "val": "TO dynamically add a line" + }, + { + "key": "$ADD LOGON(nn)", + "val": "Creates a new LOGON pseudo-device, which defines JES2 as an application program to VTAM" + }, + { + "key": "$ADD PRT", + "val": "To dynamically add a local printer" + }, + { + "key": "$ADD REDIRECT", + "val": "To specify redirection for commands entered at the entry console" + }, + { + "key": "$ADD RMT(nnnn)", + "val": "To add one or more RJE workstations" + }, + { + "key": "$C A", + "val": "To cancel the processing of all or specified automatic command entries and delete those entries" + }, + { + "key": "$C A 3", + "val": "To cancel auto job id=3" + }, + { + "key": "$C job", + "val": "Immediately cancel jobs or TSU sessions currently executing on any member of the MAS and, if desired, provide a storage dump." + }, + { + "key": "$D A,L", + "val": "Display information about currently active jobs" + }, + { + "key": "$D BUFDEF", + "val": "To display the current values of all parameters defined on the BUFDEF initialization statement or command" + }, + { + "key": "$D SPOOL", + "val": "Display the Status of Spool Volumes" + }, + { + "key": "$TA,I=900,T=11.15,'$VS,\\[\\]D A,L\\[\\]'", + "val": "Displays active list every 15 minutes" + }, + { + "key": "$TA,I=86400,T=04.15,'$VS,''S TMSDAILY\\[\\]'", + "val": "Starts job TMSDAILY every 24 hours starting at 0415 hours" + }, + { + "key": "$TA,I=86400,T=01.15,'$VS,\\[\\]S BACKUP\\[\\]'", + "val": "Starts job BACKUP every 24 hours starting at 0115 hours" + }, + { + "key": "$vs, 'v (234,235,236),offline','d a' ", + "val": "Varys offline devices 234,235,236 and dispalys all at JES2 startup" + } + ], + "MVS": [ + { + "key": "DS QT,483,1", + "val": "Display Status information on device" + }, + { + "key": "D IOS,MIH,DEV=484", + "val": "Displaying IOS control unit group information" + }, + { + "key": "D ASM", + "val": "Displaying Page Data Set Information" + }, + { + "key": "D IPLINFO", + "val": "Displaying IPL information" + }, + { + "key": "D LOGREC", + "val": "Displaying the Logrec Recording Medium" + }, + { + "key": "D M", + "val": "Displaying all the resouces" + }, + { + "key": "D PARMLIB", + "val": "Displaying PARMLIB data sets and volumes Information" + }, + { + "key":"D PROD,REGISTERED", + "val":"Displaying Registered Products" + }, + { + "key":"D PROG,LNKLST", + "val":"Displaying LNKLST Information" + }, + { + "key":"D PROG,APF", + "val":"Displaying Entries in the List of APF-Authorized Libraries" + }, + { + "key":"D SMF", + "val":"Displaying System Management Facilities" + }, + { + "key":"D SMF,O", + "val":"Displaying SMF Data" + }, + { + "key":"D SMS,STORGRP(storgrp)", + "val":"Displaying storage group status using the DISPLAY SMS command" + }, + { + "key":"D SYMBOLS", + "val":"Displaying assigned name of the systems" + }, + { + "key":"D U,IPLVOL", + "val":"Displaying Device Status and Allocation" + }, + { + "key":"F TSO,USERMAX=1", + "val":"Sets TSO user to max of one user" + }, + { + "key":"D XCF,COUPLE", + "val":"Displays info on the couple data sets, which used at IPL, names, DASD, etc" + }, + { + "key":"VARY CN(*),ACTIVATE", + "val":"Activate the console you are on" + }, + { + "key":"D C,HCONLY", + "val":"Display hard copy consoles" + } + ], + "DFSMS": [ + { + "key": "F CATALOG,REPORT,CACHE", + "val": "Reports caching statistics for both caching approaches of catalog management to cache catalog information" + }, + { + "key": "F CATALOG,REPORT,PERFORMANCE", + "val": "This new modify catalog command reports counts for various events and the average elapsed time for these events" + }, + { + "key": "F CATALOG,LIST(id|yyyyyy)|LISTJ(jobname)", + "val": "Detail information and used in real-time diagnosis when problems arise" + } + ], + "TSO/E": [ + { + "key": "SYNC", + "val": "command to initialize SYS1.BRODCAST data set and to synchronize it with the RACF data set, SYS1.UADS, or both" + }, + { + "key": "SHOWMVS", + "val": "To list all kinds of info on your system(by using ISPF)." + } + ], + "VTAM": [ + { + "key": "D NET,MAJNODES", + "val": "Display the all active nodes in the domain" + }, + { + "key": "Z NET", + "val": "Take down VTAM normally but not allowing LU sessions to end normally" + }, + { + "key": "Z NET,CANCEL", + "val": "Take down VTAM when the above 2 options fail. Cancel will kill everything whether they are in Pending states" + }, + { + "key": "D NET,BFRUSE,BUFFER=SHORT", + "val": "Display information about VTAM buffer used" + } + ], + "VLF": [ + { + "key": "F CATALOG,REPORT,CACHE", + "val": "Determining Catalogs in VLF" + }, + { + "key": "F CATALOG,NOVLF(your.catname)", + "val": "Removing Catalogs from VLF" + } + ], + "SDSF": [ + { + "key": "XDC", + "val": "Typing this command on the line of the job you want to save as a data set. It displays a self explaining menu. Your job is NOT remove for the output queue" + } + ] + } +} \ No newline at end of file From 2d083c15432b487bc799f909a7aadcb5ed9c14a8 Mon Sep 17 00:00:00 2001 From: Thomas Denizou Date: Tue, 17 Nov 2015 13:26:57 -0500 Subject: [PATCH 078/379] Added "Formatting" section --- .../cheat_sheets/json/microsoft-word.json | 71 +++++++++---------- 1 file changed, 33 insertions(+), 38 deletions(-) diff --git a/share/goodie/cheat_sheets/json/microsoft-word.json b/share/goodie/cheat_sheets/json/microsoft-word.json index 5020bbe5d..ce48e8d98 100644 --- a/share/goodie/cheat_sheets/json/microsoft-word.json +++ b/share/goodie/cheat_sheets/json/microsoft-word.json @@ -6,16 +6,11 @@ "sourceName": "Dummies", "sourceUrl": "http://www.dummies.com/how-to/content/word-2010-for-dummies-cheat-sheet.html" }, - "aliases": [ - "ms word", - "winword" - ], + "aliases": ["ms word"], "template_type": "keyboard", - "section_order": [ - "Common Tasks" - ], + "section_order": ["Common Tasks", "Formatting"], "sections": { - "Common Tasks": [ { + "Common Tasks": [{ "val": "Save", "key": "[Ctrl] [S]" }, { @@ -42,35 +37,35 @@ }, { "val": "Redo", "key": "[Ctrl] [Y]" - }, { - "val": "Make Letters Bold", - "key": "[Ctrl] [B]" - }, { - "val": "Make Letters Italic", - "key": "[Ctrl] [I]" - }, { - "val": "Underline Letters", - "key": "[Ctrl] [U]" - }, { - "val": "Create a Nonbreaking Space", - "key": "[Ctrl] [Shift] [Spacebar]" - }, { - "val": "Create a Nonbreaking Hyphen", - "key": "[Ctrl] [Shift] [Hyphen]" - }, { - "val": "Decrease Font Size by 1 value", - "key": "[Ctrl] [Shift] [<]" - }, { - "val": "Increase Font Size by 1 value", - "key": "[Ctrl] [Shift] [>]" - }, { - "val": "Remove Paragraph or Character Formatting", - "key": "[Ctrl] [Spacebar]" - }, { - "val": "Paste Special", - "key": "[ALT] [Ctrl] [V]" - } - - ]} + }], + "Formatting": [{ + "val": "Make Letters Bold", + "key": "[Ctrl] [B]" + }, { + "val": "Make Letters Italic", + "key": "[Ctrl] [I]" + }, { + "val": "Underline Letters", + "key": "[Ctrl] [U]" + }, { + "val": "Create a Nonbreaking Space", + "key": "[Ctrl] [Shift] [Spacebar]" + }, { + "val": "Create a Nonbreaking Hyphen", + "key": "[Ctrl] [Shift] [Hyphen]" + }, { + "val": "Decrease Font Size by 1 value", + "key": "[Ctrl] [Shift] [<]" + }, { + "val": "Increase Font Size by 1 value", + "key": "[Ctrl] [Shift] [>]" + }, { + "val": "Remove Paragraph or Character Formatting", + "key": "[Ctrl] [Spacebar]" + }, { + "val": "Paste Special", + "key": "[ALT] [Ctrl] [V]" + }] +} } From 99b193755c935b4ceb58b2cccabbe197390540ef Mon Sep 17 00:00:00 2001 From: javathunderman Date: Tue, 17 Nov 2015 18:42:27 +0000 Subject: [PATCH 079/379] Put winword as an alias again --- share/goodie/cheat_sheets/json/microsoft-word.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/share/goodie/cheat_sheets/json/microsoft-word.json b/share/goodie/cheat_sheets/json/microsoft-word.json index ce48e8d98..7ea961955 100644 --- a/share/goodie/cheat_sheets/json/microsoft-word.json +++ b/share/goodie/cheat_sheets/json/microsoft-word.json @@ -6,7 +6,8 @@ "sourceName": "Dummies", "sourceUrl": "http://www.dummies.com/how-to/content/word-2010-for-dummies-cheat-sheet.html" }, - "aliases": ["ms word"], + "aliases": ["ms word", + "winword"], "template_type": "keyboard", "section_order": ["Common Tasks", "Formatting"], "sections": { From f2ffe39f553b0b85667c00b7022da59430747190 Mon Sep 17 00:00:00 2001 From: Zaahir Moolla Date: Tue, 17 Nov 2015 14:58:31 -0500 Subject: [PATCH 080/379] Update template further --- template/lib/DDG/Goodie/Example.pm | 44 +++++++++++++++++------- template/share/goodie/example/example.js | 29 ++++++++++------ 2 files changed, 50 insertions(+), 23 deletions(-) diff --git a/template/lib/DDG/Goodie/Example.pm b/template/lib/DDG/Goodie/Example.pm index 0df55e483..76a9335b4 100644 --- a/template/lib/DDG/Goodie/Example.pm +++ b/template/lib/DDG/Goodie/Example.pm @@ -8,34 +8,54 @@ use DDG::Goodie; use strict; zci answer_type => '<: $lia_name :>'; + +# Caching - https://duck.co/duckduckhack/spice_advanced_backend#caching-api-responses zci is_cached => 1; -name '<: $lia_name :>'; - -# Triggers +# Triggers - https://duck.co/duckduckhack/goodie_triggers triggers any => 'triggerWord', 'trigger phrase'; # Handle statement handle remainder => sub { + my $remainder = $_; + # Optional - Guard against no remainder - # i.e. the query is only 'triggerWord' or 'trigger phrase' + # I.E. the query is only 'triggerWord' or 'trigger phrase' # # return unless $remainder; # Optional - Regular expression guard - # use this approach to ensure the remainder matches a pattern - # i.e. it only contains letters, or numbers, or contains certain words + # Use this approach to ensure the remainder matches a pattern + # I.E. it only contains letters, or numbers, or contains certain words # - # return unless qr/^\w+/; + # return unless qr/^\w+|\d{5}$/; return "plain text response", structured_answer => { - id => '<: $lia_id :>', # Should be an existing Instant Answer topic - name => 'Answerbar Tab Name', # Should be an existing Instant Answer topic - data => { q => $_ }, - templates => 1 - }; + + # ID - Must be unique and match Instant Answer page + # E.g. https://duck.co/ia/view/calculator has `id => 'calculator'`` + id => '<: $lia_id :>', + + # Name - Used for Answer Bar Tab + # Value should be chosen from existing Instant Answer topics + # see https://duck.co/duckduckhack/display_reference#codenamecode-emstringem-required + name => 'Answer', + + data => { + title => "My Instant Answer Title", + subtitle => "My Subtitle", + # image => "http://website.com/image.png" + }, + + templates => { + group => "text", + # options => { + # + # } + } + }; }; }; diff --git a/template/share/goodie/example/example.js b/template/share/goodie/example/example.js index 143eb0b0c..3a114c126 100644 --- a/template/share/goodie/example/example.js +++ b/template/share/goodie/example/example.js @@ -1,16 +1,23 @@ DDH.'<: $lia_id :>' = DDH.'<: $lia_id :>' || {}; +(function(DDH) { + "use strict"; -(function(env) { - - console.log("DDH.'<: $lia_id :>'.build"); + console.log("DDH.'<: $lia_id :>'.build"); // remove this before submitting pull request // define private variables and functions here + // + // fuction helper () { ... } + // + // var a = '', + // b = '', + // c = ''; DDH.'<: $lia_id :>'.build = function(ops) { return { - id: "life", + + id: '<: $lia_id :>', meta: { sourceName: "Source Domain", @@ -18,18 +25,18 @@ DDH.'<: $lia_id :>' = DDH.'<: $lia_id :>' || {}; }, // data: { - // already defined in Perl Package - // you can re-define it here - // or access/modify 'ops.data' + // already defined in Perl Package + // you can re-define it here + // or access/modify 'ops.data' // }, // normalize: function(item){ - // use this to map your 'data' - // to the properties required for your chosen template + // use this to map your 'data' + // to the properties required for your chosen template // // return { - // title: data.myTitle - // subtitle: data.foo.subtitle + // title: item.myTitle + // subtitle: item.foo.subtitle // }; // }, From e03411dc76b843bb0e1a702c625911c06b62f5c2 Mon Sep 17 00:00:00 2001 From: direwolf-424 Date: Tue, 17 Nov 2015 20:06:53 +0000 Subject: [PATCH 081/379] basic commands for pacman and yaourt and some linux commands --- .../goodie/cheat_sheets/json/arch-linux.json | 148 ++++++++++++++++++ 1 file changed, 148 insertions(+) create mode 100644 share/goodie/cheat_sheets/json/arch-linux.json diff --git a/share/goodie/cheat_sheets/json/arch-linux.json b/share/goodie/cheat_sheets/json/arch-linux.json new file mode 100644 index 000000000..3963ad861 --- /dev/null +++ b/share/goodie/cheat_sheets/json/arch-linux.json @@ -0,0 +1,148 @@ +{ + "id": "arch_linux_cheat_sheet", + "name": "Arch Linux", + "description": "Arch Basic Command", + "metadata": { + "sourceName": "ArchWiki", + "sourceUrl": "https://wiki.archlinux.org/index.php/Pacman" + }, + "aliases": [ + "arch", "arch distro", "linux arch" , "pacman" , "yaourt" + ], + "template_type" : "terminal", + "section_order": [ + "Pacman - Arch Package manager", + "Yaourt - A Pacman Frontend" , + "Linux Command" + ], + "sections": { + "Pacman - Arch Package manager": [ + { + "key": "pacman -S xyz", + "val": "Install package xyz" + }, + { + "key": "pacman -Syy", + "val": "Force synchronization of repository databases" + }, + { + "key": "pacman -Ss xyz", + "val": "Search repository database for packages for xyz" + }, + { + "key": "pacman -Sy xyz", + "val": "Really synchronize repo and install xyz" + }, + { + "key": "pacman -R xyz", + "val": "Remove package xyz but keep its dependencies installed" + }, + { + "key": "pacman -Rs xyz", + "val": "Remove package xyz and all its dependencies (if they are not required by any other package)" + }, + { + "key": "pacman -Rsc xyz", + "val": "Remove package xyz, all its dependencies and packages that depend on the target package" + }, + { + "key": "pacman -Ql xyz", + "val": "Show all files installed by the package xyz" + }, + { + "key": "pacman -Qo /path", + "val": "Find the package which installed the file at /pat" + }, + { + "key": "pacman -Syu", + "val": "Sync and Upgrade" + }, + { + "key": "pacman -Sc", + "val": "Remove all cached packages that are not currently installed" + }, + { + "key": "pacman -U /path/to/package/package_name-version.pkg.tar.xz", + "val": "Install a 'local' package that is not from a remote repository (e.g. the package is from the AUR)" + }, + { + "key": "pacman -Sw package_name", + "val": "Download a package without installing it" + } + ], + "Yaourt - A Pacman Frontend": [ + { + "key": "yaourt -Syu --devel --aur", + "val": "Sync database, upgrade packages, search aur and devel (all packages based on dev version) upgrades" + }, + { + "key": "yaourt -Sb", + "val": "Build package from source" + }, + { + "key": "yaourt -C", + "val": "Check, edit, merge or remove *.pac* files" + }, + { + "key": "yaourt -G", + "val": "Get a PKGBUILD (support splitted package)" + }, + { + "key": "yaourt -Sb --export", + "val": "Build and export package, its sources to a directory" + }, + { + "key": "yaourt -B", + "val": "Backup database" + }, + { + "key": "yaourt -Q --backupfile", + "val": "Query backup file" + } + + ], + "Linux Command": [ + { + "key": "man xyz", + "val": "Show manual page for xyz" + }, + { + "key": "cd /etc/pacman.d", + "val": "Change directory to pacman.d" + }, + { + "key": "mkdir xyz", + "val": "Make a new directory xyz" + }, + { + "key": "rmdir xyz", + "val": "Remove directory xyz" + }, + { + "key": "cat xyz", + "val": "Show file contents of xyz" + }, + { + "key": "find xyz", + "val": "Search for a file xyx" + }, + { + "key": "mount /dev/sdx /media/xyz", + "val": "Mount the partition sdx to xyz directory" + }, + { + "key": "killall xyz", + "val": "kill all running instances of a process xyz" + }, + { + "key": "chmod +x xyz", + "val": "make the file xyz executable" + }, + { + "key": "ls -a", + "val": "list hidden files" + } + ] + } +} + From 4d49c340d97c6f5d34a8f407278de6e58e6c9850 Mon Sep 17 00:00:00 2001 From: direwolf-424 Date: Tue, 17 Nov 2015 21:03:33 +0000 Subject: [PATCH 082/379] minor changes --- share/goodie/cheat_sheets/json/arch-linux.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/share/goodie/cheat_sheets/json/arch-linux.json b/share/goodie/cheat_sheets/json/arch-linux.json index 3963ad861..79283db88 100644 --- a/share/goodie/cheat_sheets/json/arch-linux.json +++ b/share/goodie/cheat_sheets/json/arch-linux.json @@ -1,7 +1,7 @@ { "id": "arch_linux_cheat_sheet", "name": "Arch Linux", - "description": "Arch Basic Command", + "description": "Arch Linux Commands For Pacman , Yaourt and Some Basic Linux Commands", "metadata": { "sourceName": "ArchWiki", "sourceUrl": "https://wiki.archlinux.org/index.php/Pacman" @@ -11,12 +11,12 @@ ], "template_type" : "terminal", "section_order": [ - "Pacman - Arch Package manager", + "Pacman - Arch Package Manager", "Yaourt - A Pacman Frontend" , "Linux Command" ], "sections": { - "Pacman - Arch Package manager": [ + "Pacman - Arch Package Manager": [ { "key": "pacman -S xyz", "val": "Install package xyz" From 65ab1cf08ef8108f8bb6a1efec7d98560370cbfe Mon Sep 17 00:00:00 2001 From: Zaahir Moolla Date: Tue, 17 Nov 2015 17:00:18 -0500 Subject: [PATCH 083/379] remove extra closing bracket --- template/lib/DDG/Goodie/Example.pm | 1 - 1 file changed, 1 deletion(-) diff --git a/template/lib/DDG/Goodie/Example.pm b/template/lib/DDG/Goodie/Example.pm index 76a9335b4..0b9aa546a 100644 --- a/template/lib/DDG/Goodie/Example.pm +++ b/template/lib/DDG/Goodie/Example.pm @@ -56,7 +56,6 @@ handle remainder => sub { # } } }; - }; }; 1; From a6d7e4516af15f716ee22a8a95fc6ac4e7cf90fb Mon Sep 17 00:00:00 2001 From: mohan08p Date: Wed, 18 Nov 2015 14:41:54 +0000 Subject: [PATCH 084/379] accordingly changes made --- share/goodie/cheat_sheets/json/mainframe.json | 96 +++++++++---------- 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/share/goodie/cheat_sheets/json/mainframe.json b/share/goodie/cheat_sheets/json/mainframe.json index 78776fb3a..92ec5ab28 100644 --- a/share/goodie/cheat_sheets/json/mainframe.json +++ b/share/goodie/cheat_sheets/json/mainframe.json @@ -1,8 +1,8 @@ { "id": "mainframe_cheat_sheet", "name": "Mainframe", - "templete_type": "terminal", - "description": "Command Line Interface", + "template_type": "terminal", + "description": "Basic commands for the Mainframe cli subsystem layers", "metadata": { "sourceName": "MainFrames", "sourceUrl": "http://www.mainframes.com/Commands.html" @@ -13,43 +13,43 @@ "Main Frame commands" ], "section_order": [ - "JES2", - "MVS", - "DFSMS", - "TSO/E", - "VTAM", - "VLF", - "SDSF" + "Job Entry Subsystem 2(JES2)", + "Multiple Virtual Storage(MVS)", + "Data Facility System Managed Storage(DFSMS)", + "Time Sharing Option/Extensions(TSO/E)", + "Virtual Telecommunications Access Method(VTAM)", + "Virtual Lookaside Facility(VLF)", + "System Display and Search Facility(SDSF)" ], "sections": { - "JES2": [ + "Job Entry Subsystem 2(JES2)": [ { "key": "$DSPL,JOBS=5", "val": "Display all jobs using 5% or more of the spool" }, { "key": "$A A", - "val": "To release all jobs" + "val": "Release all jobs" }, { "key": "$ACTIVATE", - "val": "To activate new functions at the current release level of JES2" + "val": "Activate new functions at the current release level of JES2" }, { "key": "$ADD APPL", - "val": "To dynamically define a VTAM application to JES2 at the specified JES2 node." + "val": "Dynamically define a VTAM application to JES2 at the specified JES2 node." }, { "key": "$ADD DESTID", - "val": "To dynamically define a symbolic name for a JES2 route code. " + "val": "Dynamically define a symbolic name for a JES2 route code. " }, { "key": "$ADD FSS", - "val": "To dynamically define a functional subsystem (FSS) to JES2" + "val": "Dynamically define a functional subsystem (FSS) to JES2" }, { "key": "$ADD LINE(nnnn)", - "val": "TO dynamically add a line" + "val": "Dynamically add a line" }, { "key": "$ADD LOGON(nn)", @@ -57,23 +57,23 @@ }, { "key": "$ADD PRT", - "val": "To dynamically add a local printer" + "val": "Dynamically add a local printer" }, { "key": "$ADD REDIRECT", - "val": "To specify redirection for commands entered at the entry console" + "val": "Specify redirection for commands entered at the entry console" }, { "key": "$ADD RMT(nnnn)", - "val": "To add one or more RJE workstations" + "val": "Add one or more RJE workstations" }, { "key": "$C A", - "val": "To cancel the processing of all or specified automatic command entries and delete those entries" + "val": "Cancel the processing of all or specified automatic command entries and delete those entries" }, { "key": "$C A 3", - "val": "To cancel auto job id=3" + "val": "Cancel auto job id=3" }, { "key": "$C job", @@ -85,7 +85,7 @@ }, { "key": "$D BUFDEF", - "val": "To display the current values of all parameters defined on the BUFDEF initialization statement or command" + "val": "Display the current values of all parameters defined on the BUFDEF initialization statement or command" }, { "key": "$D SPOOL", @@ -93,89 +93,89 @@ }, { "key": "$TA,I=900,T=11.15,'$VS,\\[\\]D A,L\\[\\]'", - "val": "Displays active list every 15 minutes" + "val": "Display active list every 15 minutes" }, { "key": "$TA,I=86400,T=04.15,'$VS,''S TMSDAILY\\[\\]'", - "val": "Starts job TMSDAILY every 24 hours starting at 0415 hours" + "val": "Start job TMSDAILY every 24 hours starting at 0415 hours" }, { "key": "$TA,I=86400,T=01.15,'$VS,\\[\\]S BACKUP\\[\\]'", - "val": "Starts job BACKUP every 24 hours starting at 0115 hours" + "val": "Start job BACKUP every 24 hours starting at 0115 hours" }, { "key": "$vs, 'v (234,235,236),offline','d a' ", "val": "Varys offline devices 234,235,236 and dispalys all at JES2 startup" } ], - "MVS": [ + "Multiple Virtual Storage(MVS)": [ { "key": "DS QT,483,1", "val": "Display Status information on device" }, { "key": "D IOS,MIH,DEV=484", - "val": "Displaying IOS control unit group information" + "val": "Display IOS control unit group information" }, { "key": "D ASM", - "val": "Displaying Page Data Set Information" + "val": "Display Page Data Set Information" }, { "key": "D IPLINFO", - "val": "Displaying IPL information" + "val": "Display IPL information" }, { "key": "D LOGREC", - "val": "Displaying the Logrec Recording Medium" + "val": "Display the Logrec Recording Medium" }, { "key": "D M", - "val": "Displaying all the resouces" + "val": "Display all the resouces" }, { "key": "D PARMLIB", - "val": "Displaying PARMLIB data sets and volumes Information" + "val": "Display PARMLIB data sets and volumes Information" }, { "key":"D PROD,REGISTERED", - "val":"Displaying Registered Products" + "val":"Display Registered Products" }, { "key":"D PROG,LNKLST", - "val":"Displaying LNKLST Information" + "val":"Display LNKLST Information" }, { "key":"D PROG,APF", - "val":"Displaying Entries in the List of APF-Authorized Libraries" + "val":"Display Entries in the List of APF-Authorized Libraries" }, { "key":"D SMF", - "val":"Displaying System Management Facilities" + "val":"Display System Management Facilities" }, { "key":"D SMF,O", - "val":"Displaying SMF Data" + "val":"Display SMF Data" }, { "key":"D SMS,STORGRP(storgrp)", - "val":"Displaying storage group status using the DISPLAY SMS command" + "val":"Display storage group status using the DISPLAY SMS command" }, { "key":"D SYMBOLS", - "val":"Displaying assigned name of the systems" + "val":"Display assigned name of the systems" }, { "key":"D U,IPLVOL", - "val":"Displaying Device Status and Allocation" + "val":"Display Device Status and Allocation" }, { "key":"F TSO,USERMAX=1", - "val":"Sets TSO user to max of one user" + "val":"Set TSO user to max of one user" }, { "key":"D XCF,COUPLE", - "val":"Displays info on the couple data sets, which used at IPL, names, DASD, etc" + "val":"Display info on the couple data sets, which used at IPL, names, DASD, etc" }, { "key":"VARY CN(*),ACTIVATE", @@ -186,7 +186,7 @@ "val":"Display hard copy consoles" } ], - "DFSMS": [ + "Data Facility System Managed Storage(DFSMS)": [ { "key": "F CATALOG,REPORT,CACHE", "val": "Reports caching statistics for both caching approaches of catalog management to cache catalog information" @@ -200,17 +200,17 @@ "val": "Detail information and used in real-time diagnosis when problems arise" } ], - "TSO/E": [ + "Time Sharing Option/Extensions(TSO/E)": [ { "key": "SYNC", "val": "command to initialize SYS1.BRODCAST data set and to synchronize it with the RACF data set, SYS1.UADS, or both" }, { "key": "SHOWMVS", - "val": "To list all kinds of info on your system(by using ISPF)." + "val": "List all kinds of info on your system(by using ISPF)." } ], - "VTAM": [ + "Virtual Telecommunications Access Method(VTAM)": [ { "key": "D NET,MAJNODES", "val": "Display the all active nodes in the domain" @@ -228,7 +228,7 @@ "val": "Display information about VTAM buffer used" } ], - "VLF": [ + "Virtual Lookaside Facility(VLF)": [ { "key": "F CATALOG,REPORT,CACHE", "val": "Determining Catalogs in VLF" @@ -238,7 +238,7 @@ "val": "Removing Catalogs from VLF" } ], - "SDSF": [ + "System Display and Search Facility(SDSF)": [ { "key": "XDC", "val": "Typing this command on the line of the job you want to save as a data set. It displays a self explaining menu. Your job is NOT remove for the output queue" From 0a5fd46d6623626e5a5b2ef84f3130a0cd5bd855 Mon Sep 17 00:00:00 2001 From: JOBIN PHILIP ABRAHAM Date: Wed, 18 Nov 2015 21:20:05 +0530 Subject: [PATCH 085/379] Create 8086.json --- share/goodie/cheat_sheets/json/8086.json | 363 +++++++++++++++++++++++ 1 file changed, 363 insertions(+) create mode 100644 share/goodie/cheat_sheets/json/8086.json diff --git a/share/goodie/cheat_sheets/json/8086.json b/share/goodie/cheat_sheets/json/8086.json new file mode 100644 index 000000000..13a2c55d4 --- /dev/null +++ b/share/goodie/cheat_sheets/json/8086.json @@ -0,0 +1,363 @@ +{ + + "id": "8086_cheat_sheet", + + "name": "8086", + + "description": "8086 instructions and their explanations", + + "metadata": { + + "sourceName": "utcluj", + + "sourceUrl": "http://users.utcluj.ro/~elupu/Curs/fileloader.php?fileName=upload/Cursuri/Univ.Nord_BM1/Curs_5/8086_instruction_set.pdf" + + }, + + "template_type": "reference", + + "section_order": [ + + "Data Transfer Instructions", + + "Arithmetic Instructions", + + "Logical Instructions", + + "Rotate and Shift Instructions", + + "Control Transfer Instructions", + + "Flag Manipulation Instructions" + + ], + + "aliases": [ + + "8086 instructionset", + + "8086 instruction set", + + "8086 programming", + + "8086 instructions" + + ], + + "sections": { + + "Data Transfer Instructions": [ + + { + + "key": "MOV Destination, Source", + + "val": "Copies a word or byte of data from 'source' to 'destination'" + + }, + + { + + "key": "XCHG Destination, Source", + + "val": "Exchanges the content of 'source' and 'destination' " + + }, + + { + + "key": "LEA Register, Source", + + "val": "Stores the offset of the variable or memory location named as the 'source' into the 16-bit register" + + } + + ], + + "Arithmetic Instructions": [ + + { + + "key": "ADD Destination, Source", + + "val": "Adds the number in 'source' to the number in 'destination' and put the result in the 'destination'" + + }, + + { + + "key": "SUB Destination, Source", + + "val": "Subtracts the number in 'source' from the number in 'destination' and put the result in the 'destination'" + + }, + + { + + "key": "MUL Source", + + "val": "Multiplies an unsigned byte in the 'source' with an unsigned byte in AL register or an unsigned word in the 'source' with an unsigned word in AX register" + + }, + + { + + "key": "DIV Source", + + "val": "Divide an unsigned word by a byte in the 'source' or to divide an unsigned double word by a word in the 'source'" + + }, + + { + + "key": "INC Destination", + + "val": "Increments the content of 'destination' by one" + + }, + + { + + "key": "DEC Destination", + + "val": "Decrements the content of 'destination' by one" + + }, + + { + + "key": "DAA", + + "val": "Decimal adjust after BCD addition" + + }, + + { + + "key": "AAA", + + "val": "ASCII adjust for addition" + + } + + ], + + "Logical Instructions": [ + + { + + "key": "AND Destination, Source", + + "val": "ANDs each bit in the 'source' byte or word with the same numbered bit in a 'destination' byte or word" + + }, + + { + + "key": "OR Destination, Source", + + "val": "ORs each bit in a 'source' byte or word with the same numbered bit in a 'destination' byte or word" + + }, + + { + + "key": "XOR Destination, Source", + + "val": "Exclusive-ORs each bit in a 'source' byte or word with the same numbered bit in a 'destination' byte or word" + + }, + + { + + "key": "NOT Destinations", + + "val": "Inverts each bit (1’s complement) of a byte or word in the 'destination'" + + }, + + { + + "key": "CMP Destination, Source", + + "val": "Compares a byte / word in the 'source' with a byte / word in the 'destination'" + + }, + + { + + "key": "TEST Destination, Source", + + "val": "ANDs the byte / word in the 'source' with the byte / word in the 'destination'" + + } + + ], + + "Rotate and Shift Instructions": [ + + { + + "key": "RCL Destination, Count", + + "val": "Rotates all the bits in a word or byte in the 'destination' to the left 'count' number of times through carry flag" + + }, + + { + + "key": "RCR Destination, Count", + + "val": "Rotates all the bits in a word or byte in the 'destination' to the right 'count' number of times through carry flag" + + }, + + { + + "key": "ROL Destination, Count", + + "val": "Rotates all the bits in a word or byte in the 'destination' to the left 'count' number of times.MSB is circled back into the LSB and CF contains a copy of the bit most recently moved out of the MSB" + + }, + + { + + "key": "ROR Destination, Count", + + "val": "Rotates all the bits in a word or byte in the 'destination' to the right 'count' number of times.LSB is circled back into the LSB and CF contains a copy of the bit most recently moved out of the LSB" + + }, + + { + + "key": "SHL Destination, Count", + + "val": "Shifts each bit in the 'destination' to the left 'count' number of times and a 0 is put in the LSB position for each shift" + + }, + + { + + "key": "SHR Destination, Count", + + "val": "Shifts each bit in the 'destination' to the right 'count' number of times and a 0 is put in the MSB position for each shift" + + } + + ], + + "Control Transfer Instructions": [ + + { + + "key": "JMP Destination", + + "val": "Unconditional jump to the specified 'destination'" + + }, + + { + + "key": "JC Destination", + + "val": "Jump to the specified 'destination' if carry flag is set" + + }, + + { + + "key": "JZ Destination", + + "val": "Jump to the specified 'destination' if zero flag is set" + + }, + + { + + "key": "JS", + + "val": "Jump to the specified 'destination' if sign flag is set" + + }, + + { + + "key": "LOOP", + + "val": "Repeat a series of instructions some number of times. The number of times is loaded into CX" + + }, + + { + + "key": "CALL", + + "val": "Transfer control to a subprogram or a procedure" + + } + + ], + + "Flag Manipulation Instructions": [ + + { + + "key": "STC", + + "val": "Sets Carry Flag" + + }, + + { + + "key": "CLC", + + "val": "Clear Carry Flag" + + }, + + { + + "key": "CMC", + + "val": "Complement Carry Flag" + + }, + + { + + "key": "STD", + + "val": "Sets Direction Flag" + + }, + + { + + "key": "CLD", + + "val": "Clear Direction Flag" + + }, + + { + + "key": "STI", + + "val": "Sets Interrupt Flag" + + }, + + { + + "key": "CLI", + + "val": "Clear Interrupt Flag" + + } + + ] + + } + +} From f804dbb2eb99851b9390122adf382271cf8594d5 Mon Sep 17 00:00:00 2001 From: direwolf-424 Date: Wed, 18 Nov 2015 16:13:06 +0000 Subject: [PATCH 086/379] casing correction --- share/goodie/cheat_sheets/json/arch-linux.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/share/goodie/cheat_sheets/json/arch-linux.json b/share/goodie/cheat_sheets/json/arch-linux.json index 79283db88..09332b9e7 100644 --- a/share/goodie/cheat_sheets/json/arch-linux.json +++ b/share/goodie/cheat_sheets/json/arch-linux.json @@ -132,15 +132,15 @@ }, { "key": "killall xyz", - "val": "kill all running instances of a process xyz" + "val": "Kill all running instances of a process xyz" }, { "key": "chmod +x xyz", - "val": "make the file xyz executable" + "val": "Make the file xyz executable" }, { "key": "ls -a", - "val": "list hidden files" + "val": "List hidden files" } ] } From 121aee0547ed807f3e16f32da90b294cd1135b50 Mon Sep 17 00:00:00 2001 From: Mohan Pawar Date: Wed, 18 Nov 2015 21:55:21 +0530 Subject: [PATCH 087/379] Spacing adjusted. --- share/goodie/cheat_sheets/json/mainframe.json | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/share/goodie/cheat_sheets/json/mainframe.json b/share/goodie/cheat_sheets/json/mainframe.json index 92ec5ab28..5164bc1b9 100644 --- a/share/goodie/cheat_sheets/json/mainframe.json +++ b/share/goodie/cheat_sheets/json/mainframe.json @@ -13,16 +13,16 @@ "Main Frame commands" ], "section_order": [ - "Job Entry Subsystem 2(JES2)", - "Multiple Virtual Storage(MVS)", - "Data Facility System Managed Storage(DFSMS)", - "Time Sharing Option/Extensions(TSO/E)", - "Virtual Telecommunications Access Method(VTAM)", - "Virtual Lookaside Facility(VLF)", - "System Display and Search Facility(SDSF)" + "Job Entry Subsystem 2 (JES2)", + "Multiple Virtual Storage (MVS)", + "Data Facility System Managed Storage (DFSMS)", + "Time Sharing Option/Extensions (TSO/E)", + "Virtual Telecommunications Access Method (VTAM)", + "Virtual Lookaside Facility (VLF)", + "System Display and Search Facility (SDSF)" ], "sections": { - "Job Entry Subsystem 2(JES2)": [ + "Job Entry Subsystem 2 (JES2)": [ { "key": "$DSPL,JOBS=5", "val": "Display all jobs using 5% or more of the spool" @@ -48,11 +48,11 @@ "val": "Dynamically define a functional subsystem (FSS) to JES2" }, { - "key": "$ADD LINE(nnnn)", + "key": "$ADD LINE (nnnn)", "val": "Dynamically add a line" }, { - "key": "$ADD LOGON(nn)", + "key": "$ADD LOGON (nn)", "val": "Creates a new LOGON pseudo-device, which defines JES2 as an application program to VTAM" }, { @@ -64,7 +64,7 @@ "val": "Specify redirection for commands entered at the entry console" }, { - "key": "$ADD RMT(nnnn)", + "key": "$ADD RMT (nnnn)", "val": "Add one or more RJE workstations" }, { @@ -108,7 +108,7 @@ "val": "Varys offline devices 234,235,236 and dispalys all at JES2 startup" } ], - "Multiple Virtual Storage(MVS)": [ + "Multiple Virtual Storage (MVS)": [ { "key": "DS QT,483,1", "val": "Display Status information on device" @@ -158,7 +158,7 @@ "val":"Display SMF Data" }, { - "key":"D SMS,STORGRP(storgrp)", + "key":"D SMS,STORGRP (storgrp)", "val":"Display storage group status using the DISPLAY SMS command" }, { @@ -186,7 +186,7 @@ "val":"Display hard copy consoles" } ], - "Data Facility System Managed Storage(DFSMS)": [ + "Data Facility System Managed Storage (DFSMS)": [ { "key": "F CATALOG,REPORT,CACHE", "val": "Reports caching statistics for both caching approaches of catalog management to cache catalog information" @@ -196,21 +196,21 @@ "val": "This new modify catalog command reports counts for various events and the average elapsed time for these events" }, { - "key": "F CATALOG,LIST(id|yyyyyy)|LISTJ(jobname)", + "key": "F CATALOG,LIST (id|yyyyyy) | LISTJ (jobname)", "val": "Detail information and used in real-time diagnosis when problems arise" } ], - "Time Sharing Option/Extensions(TSO/E)": [ + "Time Sharing Option/Extensions (TSO/E)": [ { "key": "SYNC", "val": "command to initialize SYS1.BRODCAST data set and to synchronize it with the RACF data set, SYS1.UADS, or both" }, { "key": "SHOWMVS", - "val": "List all kinds of info on your system(by using ISPF)." + "val": "List all kinds of info on your system (by using ISPF)." } ], - "Virtual Telecommunications Access Method(VTAM)": [ + "Virtual Telecommunications Access Method (VTAM)": [ { "key": "D NET,MAJNODES", "val": "Display the all active nodes in the domain" @@ -228,21 +228,21 @@ "val": "Display information about VTAM buffer used" } ], - "Virtual Lookaside Facility(VLF)": [ + "Virtual Lookaside Facility (VLF)": [ { "key": "F CATALOG,REPORT,CACHE", "val": "Determining Catalogs in VLF" }, { - "key": "F CATALOG,NOVLF(your.catname)", + "key": "F CATALOG,NOVLF (your.catname)", "val": "Removing Catalogs from VLF" } ], - "System Display and Search Facility(SDSF)": [ + "System Display and Search Facility (SDSF)": [ { "key": "XDC", "val": "Typing this command on the line of the job you want to save as a data set. It displays a self explaining menu. Your job is NOT remove for the output queue" } ] } -} \ No newline at end of file +} From 393085b560c1998f94e827ae2c965290af40a388 Mon Sep 17 00:00:00 2001 From: JOBIN PHILIP ABRAHAM Date: Wed, 18 Nov 2015 22:06:32 +0530 Subject: [PATCH 088/379] Delete cpp.json --- share/goodie/cheat_sheets/json/cpp.json | 195 ------------------------ 1 file changed, 195 deletions(-) delete mode 100644 share/goodie/cheat_sheets/json/cpp.json diff --git a/share/goodie/cheat_sheets/json/cpp.json b/share/goodie/cheat_sheets/json/cpp.json deleted file mode 100644 index 21aac008c..000000000 --- a/share/goodie/cheat_sheets/json/cpp.json +++ /dev/null @@ -1,195 +0,0 @@ -{ - "id": "cpp_cheat_sheet", - "name": "C++", - "description": "A quick reference of c++ language", - "metadata": { - "sourceName": "cs", - "sourceUrl": "http://www.cs.ccu.edu.tw/~damon/oop/,c++refcard.pdf" - }, - "template_type": "reference", - "section_order": [ - "Fundamental Data Types", - "Preprocessor Directives", - "Arithmetic Operators", - "Relational Operators", - "Logical Operators", - "Bitwise Operators", - "Namespaces", - "Console Input/Output", - "Class Member Protections" - ], - "aliases": [ - "c++", - "c plus plus" - ], - "sections": { - "Fundamental Data Types": [ - { - "key": "char", - "val": "Character (1 byte)" - }, - { - "key": "int", - "val": "Integer " - }, - { - "key": "float", - "val": "Floating point" - }, - { - "key": "bool", - "val": "True or false" - }, - { - "key": "void", - "val": "No value" - } - ], - "Preprocessor Directives": [ - { - "key": "#include ", - "val": "Include library file" - }, - { - "key": "#include \"filename\"", - "val": "Include user file" - }, - { - "key": "#define name text", - "val": "Define a macro" - }, - { - "key": "#define name(var) text", - "val": "Define a parameterized macro" - }, - { - "key": "#undef name", - "val": "Undefine a previously defined macro" - }, - { - "key": "#if, #else, #elif, #endif", - "val": "Conditional execution" - } - ], - "Arithmetic Operators": [ - { - "key": "+", - "val": "Adds two operands" - }, - { - "key": "−", - "val": "Subtracts second operand from the first" - }, - { - "key": "*", - "val": "Multiplies both operands" - }, - { - "key": "/", - "val": "Divides numerator by de-numerator" - }, - { - "key": "%", - "val": "Modulus Operator" - }, - { - "key": "++", - "val": "Increases the integer value by one" - }, - { - "key": "--", - "val": "Decreases the integer value by one" - } - ], - "Relational Operators": [ - { - "key": "==", - "val": "Checks for equality between operands" - }, - { - "key": "!=", - "val": "Checks for non equality between operands" - }, - { - "key": ">", - "val": "Checks if the value of left operand is greater than the value of right operand. If yes, then the condition becomes true." - }, - { - "key": "<", - "val": "Checks if the value of left operand is less than the value of right operand. If yes, then the condition becomes true." - }, - { - "key": ">=", - "val": "Checks if the value of left operand is greater than or equal to the value of right operand. If yes, then the condition becomes true." - }, - { - "key": "<=", - "val": "Checks if the value of left operand is less than or equal to the value of right operand. If yes, then the condition becomes true." - } - ], - "Logical Operators": [ - { - "key": "&&", - "val": "Logical AND operator" - }, - { - "key": "||", - "val": "Logical OR Operator" - }, - { - "key": "!", - "val": "Logical NOT Operator" - } - ], - "Bitwise Operators": [ - { - "key": "&", - "val": "Does the logical AND on the bits in the corresponding position of the operands in its binary form" - }, - { - "key": "|", - "val": "Does the logical OR on the bits in the corresponding position of the operands in its binary form" - }, - { - "key": "^", - "val": "Does XOR on the bits in the corresponding position of the operands in its binary form" - }, - { - "key": "~", - "val": "Inverts all the bits of operand" - }, - { - "key": "<<", - "val": "Takes two numbers, left shifts the bits of first operand, the second operand decides the number of places to shift" - }, - { - "key": ">>", - "val": "Takes two numbers, right shifts the bits of first operand, the second operand decides the number of places to shift" - } - ], - "Namespaces": [ - { - "key": "namespace name {...}", - "val": "Define namespace for the enclosed code" - }, - { - "key": "using name;", - "val": "Import function and variable definition from the given namespace into the current namespace" - } - ], - "Class Member Protections": [ - { - "key": "public", - "val": "Anyone outside the class may access these member functions and variables" - }, - { - "key": "private", - "val": "Only the class's member functions and friends may access the data." - }, - { - "key": "protected", - "val": "Only the class's member functions, friends, and derived classes may access." - } - ] - } -} From e2c0d455595ea9dedcb69bd5c4d31fa582aa8b15 Mon Sep 17 00:00:00 2001 From: JOBIN PHILIP ABRAHAM Date: Wed, 18 Nov 2015 22:08:40 +0530 Subject: [PATCH 089/379] Update 8086.json --- share/goodie/cheat_sheets/json/8086.json | 537 ++++++++--------------- 1 file changed, 178 insertions(+), 359 deletions(-) diff --git a/share/goodie/cheat_sheets/json/8086.json b/share/goodie/cheat_sheets/json/8086.json index 13a2c55d4..d559950c3 100644 --- a/share/goodie/cheat_sheets/json/8086.json +++ b/share/goodie/cheat_sheets/json/8086.json @@ -1,363 +1,182 @@ { - - "id": "8086_cheat_sheet", - - "name": "8086", - - "description": "8086 instructions and their explanations", - - "metadata": { - - "sourceName": "utcluj", - - "sourceUrl": "http://users.utcluj.ro/~elupu/Curs/fileloader.php?fileName=upload/Cursuri/Univ.Nord_BM1/Curs_5/8086_instruction_set.pdf" - - }, - - "template_type": "reference", - - "section_order": [ - - "Data Transfer Instructions", - - "Arithmetic Instructions", - - "Logical Instructions", - - "Rotate and Shift Instructions", - - "Control Transfer Instructions", - - "Flag Manipulation Instructions" - - ], - - "aliases": [ - - "8086 instructionset", - - "8086 instruction set", - - "8086 programming", - - "8086 instructions" - - ], - - "sections": { - - "Data Transfer Instructions": [ - - { - - "key": "MOV Destination, Source", - - "val": "Copies a word or byte of data from 'source' to 'destination'" - - }, - - { - - "key": "XCHG Destination, Source", - - "val": "Exchanges the content of 'source' and 'destination' " - - }, - - { - - "key": "LEA Register, Source", - - "val": "Stores the offset of the variable or memory location named as the 'source' into the 16-bit register" - - } - + "id": "8086_cheat_sheet", + "name": "8086", + "description": "8086 instructions and their explanations", + "metadata": { + "sourceName": "utcluj", + "sourceUrl": "http://users.utcluj.ro/~elupu/Curs/fileloader.php?fileName=upload/Cursuri/Univ.Nord_BM1/Curs_5/8086_instruction_set.pdf" + }, + "template_type": "reference", + "section_order": [ + "Data Transfer Instructions", + "Arithmetic Instructions", + "Logical Instructions", + "Rotate and Shift Instructions", + "Control Transfer Instructions", + "Flag Manipulation Instructions" ], - - "Arithmetic Instructions": [ - - { - - "key": "ADD Destination, Source", - - "val": "Adds the number in 'source' to the number in 'destination' and put the result in the 'destination'" - - }, - - { - - "key": "SUB Destination, Source", - - "val": "Subtracts the number in 'source' from the number in 'destination' and put the result in the 'destination'" - - }, - - { - - "key": "MUL Source", - - "val": "Multiplies an unsigned byte in the 'source' with an unsigned byte in AL register or an unsigned word in the 'source' with an unsigned word in AX register" - - }, - - { - - "key": "DIV Source", - - "val": "Divide an unsigned word by a byte in the 'source' or to divide an unsigned double word by a word in the 'source'" - - }, - - { - - "key": "INC Destination", - - "val": "Increments the content of 'destination' by one" - - }, - - { - - "key": "DEC Destination", - - "val": "Decrements the content of 'destination' by one" - - }, - - { - - "key": "DAA", - - "val": "Decimal adjust after BCD addition" - - }, - - { - - "key": "AAA", - - "val": "ASCII adjust for addition" - - } - + "aliases": [ + "8086 instructionset", + "8086 instruction set", + "8086 programming", + "8086 instructions" ], - - "Logical Instructions": [ - - { - - "key": "AND Destination, Source", - - "val": "ANDs each bit in the 'source' byte or word with the same numbered bit in a 'destination' byte or word" - - }, - - { - - "key": "OR Destination, Source", - - "val": "ORs each bit in a 'source' byte or word with the same numbered bit in a 'destination' byte or word" - - }, - - { - - "key": "XOR Destination, Source", - - "val": "Exclusive-ORs each bit in a 'source' byte or word with the same numbered bit in a 'destination' byte or word" - - }, - - { - - "key": "NOT Destinations", - - "val": "Inverts each bit (1’s complement) of a byte or word in the 'destination'" - - }, - - { - - "key": "CMP Destination, Source", - - "val": "Compares a byte / word in the 'source' with a byte / word in the 'destination'" - - }, - - { - - "key": "TEST Destination, Source", - - "val": "ANDs the byte / word in the 'source' with the byte / word in the 'destination'" - - } - - ], - - "Rotate and Shift Instructions": [ - - { - - "key": "RCL Destination, Count", - - "val": "Rotates all the bits in a word or byte in the 'destination' to the left 'count' number of times through carry flag" - - }, - - { - - "key": "RCR Destination, Count", - - "val": "Rotates all the bits in a word or byte in the 'destination' to the right 'count' number of times through carry flag" - - }, - - { - - "key": "ROL Destination, Count", - - "val": "Rotates all the bits in a word or byte in the 'destination' to the left 'count' number of times.MSB is circled back into the LSB and CF contains a copy of the bit most recently moved out of the MSB" - - }, - - { - - "key": "ROR Destination, Count", - - "val": "Rotates all the bits in a word or byte in the 'destination' to the right 'count' number of times.LSB is circled back into the LSB and CF contains a copy of the bit most recently moved out of the LSB" - - }, - - { - - "key": "SHL Destination, Count", - - "val": "Shifts each bit in the 'destination' to the left 'count' number of times and a 0 is put in the LSB position for each shift" - - }, - - { - - "key": "SHR Destination, Count", - - "val": "Shifts each bit in the 'destination' to the right 'count' number of times and a 0 is put in the MSB position for each shift" - - } - - ], - - "Control Transfer Instructions": [ - - { - - "key": "JMP Destination", - - "val": "Unconditional jump to the specified 'destination'" - - }, - - { - - "key": "JC Destination", - - "val": "Jump to the specified 'destination' if carry flag is set" - - }, - - { - - "key": "JZ Destination", - - "val": "Jump to the specified 'destination' if zero flag is set" - - }, - - { - - "key": "JS", - - "val": "Jump to the specified 'destination' if sign flag is set" - - }, - - { - - "key": "LOOP", - - "val": "Repeat a series of instructions some number of times. The number of times is loaded into CX" - - }, - - { - - "key": "CALL", - - "val": "Transfer control to a subprogram or a procedure" - - } - - ], - - "Flag Manipulation Instructions": [ - - { - - "key": "STC", - - "val": "Sets Carry Flag" - - }, - - { - - "key": "CLC", - - "val": "Clear Carry Flag" - - }, - - { - - "key": "CMC", - - "val": "Complement Carry Flag" - - }, - - { - - "key": "STD", - - "val": "Sets Direction Flag" - - }, - - { - - "key": "CLD", - - "val": "Clear Direction Flag" - - }, - - { - - "key": "STI", - - "val": "Sets Interrupt Flag" - - }, - - { - - "key": "CLI", - - "val": "Clear Interrupt Flag" - - } - - ] - - } - + "sections": { + "Data Transfer Instructions": [ + { + "key": "MOV Destination, Source", + "val": "Copies a word or byte of data from 'source' to 'destination'" + }, + { + "key": "XCHG Destination, Source", + "val": "Exchanges the content of 'source' and 'destination' " + }, + { + "key": "LEA Register, Source", + "val": "Stores the offset of the variable or memory location named as the 'source' into the 16-bit register" + } + ], + "Arithmetic Instructions": [ + { + "key": "ADD Destination, Source", + "val": "Adds the number in 'source' to the number in 'destination' and put the result in the 'destination'" + }, + { + "key": "SUB Destination, Source", + "val": "Subtracts the number in 'source' from the number in 'destination' and put the result in the 'destination'" + }, + { + "key": "MUL Source", + "val": "Multiplies an unsigned byte in the 'source' with an unsigned byte in AL register or an unsigned word in the 'source' with an unsigned word in AX register" + }, + { + "key": "DIV Source", + "val": "Divide an unsigned word by a byte in the 'source' or to divide an unsigned double word by a word in the 'source'" + }, + { + "key": "INC Destination", + "val": "Increments the content of 'destination' by one" + }, + { + "key": "DEC Destination", + "val": "Decrements the content of 'destination' by one" + }, + { + "key": "DAA", + "val": "Decimal adjust after BCD addition" + }, + { + "key": "AAA", + "val": "ASCII adjust for addition" + } + ], + "Logical Instructions": [ + { + "key": "AND Destination, Source", + "val": "ANDs each bit in the 'source' byte or word with the same numbered bit in a 'destination' byte or word" + }, + { + "key": "OR Destination, Source", + "val": "ORs each bit in a 'source' byte or word with the same numbered bit in a 'destination' byte or word" + }, + { + "key": "XOR Destination, Source", + "val": "Exclusive-ORs each bit in a 'source' byte or word with the same numbered bit in a 'destination' byte or word" + }, + { + "key": "NOT Destinations", + "val": "Inverts each bit (1’s complement) of a byte or word in the 'destination'" + }, + { + "key": "CMP Destination, Source", + "val": "Compares a byte / word in the 'source' with a byte / word in the 'destination'" + }, + { + "key": "TEST Destination, Source", + "val": "ANDs the byte / word in the 'source' with the byte / word in the 'destination'" + } + ], + "Rotate and Shift Instructions": [ + { + "key": "RCL Destination, Count", + "val": "Rotates all the bits in a word or byte in the 'destination' to the left 'count' number of times through carry flag" + }, + { + "key": "RCR Destination, Count", + "val": "Rotates all the bits in a word or byte in the 'destination' to the right 'count' number of times through carry flag" + }, + { + "key": "ROL Destination, Count", + "val": "Rotates all the bits in a word or byte in the 'destination' to the left 'count' number of times.MSB is circled back into the LSB and CF contains a copy of the bit most recently moved out of the MSB" + }, + { + "key": "ROR Destination, Count", + "val": "Rotates all the bits in a word or byte in the 'destination' to the right 'count' number of times.LSB is circled back into the LSB and CF contains a copy of the bit most recently moved out of the LSB" + }, + { + "key": "SHL Destination, Count", + "val": "Shifts each bit in the 'destination' to the left 'count' number of times and a 0 is put in the LSB position for each shift" + }, + { + "key": "SHR Destination, Count", + "val": "Shifts each bit in the 'destination' to the right 'count' number of times and a 0 is put in the MSB position for each shift" + } + ], + "Control Transfer Instructions": [ + { + "key": "JMP Destination", + "val": "Unconditional jump to the specified 'destination'" + }, + { + "key": "JC Destination", + "val": "Jump to the specified 'destination' if carry flag is set" + }, + { + "key": "JZ Destination", + "val": "Jump to the specified 'destination' if zero flag is set" + }, + { + "key": "JS", + "val": "Jump to the specified 'destination' if sign flag is set" + }, + { + "key": "LOOP", + "val": "Repeat a series of instructions some number of times. The number of times is loaded into CX" + }, + { + "key": "CALL", + "val": "Transfer control to a subprogram or a procedure" + } + ], + "Flag Manipulation Instructions": [ + { + "key": "STC", + "val": "Sets Carry Flag" + }, + { + "key": "CLC", + "val": "Clear Carry Flag" + }, + { + "key": "CMC", + "val": "Complement Carry Flag" + }, + { + "key": "STD", + "val": "Sets Direction Flag" + }, + { + "key": "CLD", + "val": "Clear Direction Flag" + }, + { + "key": "STI", + "val": "Sets Interrupt Flag" + }, + { + "key": "CLI", + "val": "Clear Interrupt Flag" + } + ] + } } From c107a141509bc246fd138b7ac90501d79f3d7ed7 Mon Sep 17 00:00:00 2001 From: Mohan Pawar Date: Thu, 19 Nov 2015 17:24:56 +0530 Subject: [PATCH 090/379] alphabet c chaged to uppercase --- share/goodie/cheat_sheets/json/mainframe.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/goodie/cheat_sheets/json/mainframe.json b/share/goodie/cheat_sheets/json/mainframe.json index 5164bc1b9..db67f8f3b 100644 --- a/share/goodie/cheat_sheets/json/mainframe.json +++ b/share/goodie/cheat_sheets/json/mainframe.json @@ -203,7 +203,7 @@ "Time Sharing Option/Extensions (TSO/E)": [ { "key": "SYNC", - "val": "command to initialize SYS1.BRODCAST data set and to synchronize it with the RACF data set, SYS1.UADS, or both" + "val": "Command to initialize SYS1.BRODCAST data set and to synchronize it with the RACF data set, SYS1.UADS, or both" }, { "key": "SHOWMVS", From 4ec35d89dae6e84537f5fa5ea5601b2f294707ad Mon Sep 17 00:00:00 2001 From: Zaahir Moolla Date: Thu, 19 Nov 2015 15:44:31 -0500 Subject: [PATCH 091/379] Add optional val to links template --- share/goodie/cheat_sheets/links.handlebars | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/share/goodie/cheat_sheets/links.handlebars b/share/goodie/cheat_sheets/links.handlebars index 6856916ab..63b4ce94b 100644 --- a/share/goodie/cheat_sheets/links.handlebars +++ b/share/goodie/cheat_sheets/links.handlebars @@ -1,7 +1,10 @@
    {{#each items}}
  • - {{key}} + {{key}} + {{#if val}} +
    {{val}}
    + {{/if}}
  • {{/each}}
From 083c6d993043602943ba6819e21a911b87c5be94 Mon Sep 17 00:00:00 2001 From: Zaahir Moolla Date: Thu, 19 Nov 2015 16:42:04 -0500 Subject: [PATCH 092/379] re-format JSON --- .../cheat_sheets/json/nodejs-tutorials.json | 308 ++++++++++++++++++ 1 file changed, 308 insertions(+) create mode 100644 share/goodie/cheat_sheets/json/nodejs-tutorials.json diff --git a/share/goodie/cheat_sheets/json/nodejs-tutorials.json b/share/goodie/cheat_sheets/json/nodejs-tutorials.json new file mode 100644 index 000000000..d4c24b70e --- /dev/null +++ b/share/goodie/cheat_sheets/json/nodejs-tutorials.json @@ -0,0 +1,308 @@ +{ + "id": "nodejs_tutorials_cheat_sheet", + "name": "Node.js Tutorials", + "description": "A list of helpful resources for getting started with Node.js", + "metadata": { + "sourceName": "Stack Overflow", + "sourceUrl": "https://stackoverflow.com/questions/2353818/how-do-i-get-started-with-node-js" + }, + "aliases": [ + "nodejs tutorials", + "node tutorials", + "node.js tutorials" + ], + "template_type": "links", + "section_order": [ + "Tutorials", + "Developer Sites", + "Videos", + "Screencasts", + "Books", + "Courses", + "Blogs", + "Podcasts", + "JavaScript Resources", + "Node.js Modules", + "Other" + ], + "sections": { + "Tutorials": [ + { + "link": "http://nodeschool.io/", + "key": "NodeSchool.io" + }, + { + "link": "https://github.com/maxogden/art-of-node/#the-art-of-node", + "key": "The Art of Node" + }, + { + "link": "http://node.blog.com/2014/12/29/hello-world-with-node-and-express/", + "key": "Hello World Example" + }, + { + "link": "http://www.nodebeginner.org/#hello-world", + "key": "Hello World" + }, + { + "link": "http://www.nodebeginner.org/#building-the-application-stack", + "key": "Hello World Web Server" + }, + { + "link": "http://nodeguide.com/", + "key": "Node.js Guide" + }, + { + "link": "http://howtonode.org/express-mongodb", + "key": "Build a blog with Node.js, express and MongoDB" + }, + { + "link": "http://net.tutsplus.com/tutorials/javascript-ajax/node-js-for-beginners/", + "key": "Node.js for Beginners" + }, + { + "link": "http://javascriptissexy.com/learn-node-js-completely-and-with-confidence/", + "key": "Learn Node.js Completely and with Confidence" + }, + { + "link": "http://blog.modulus.io/absolute-beginners-guide-to-nodejs", + "key": "Absolute Beginners Guide To Node.js" + } + ], + "Developer Sites": [ + { + "link": "http://www.joyent.com/developers/node", + "key": "Joyent's developer site for node" + } + ], + "Videos": [ + { + "link": "http://nodetuts.com/", + "key": "Node tuts" + }, + { + "link": "http://www.youtube.com/watch?v=jo_B4LTHi3I", + "key": "Introduction to Node.js with the author of the languag, Ryan Dahl" + }, + { + "link": "http://www.infoq.com/presentations/nodejs", + "key": "Node.js: Asynchronous Purity Leads to Faster Development" + }, + { + "link": "http://www.infoq.com/presentations/Parallel-Programming-with-Nodejs", + "key": "Parallel Programming with Node.js" + }, + { + "link": "http://vimeo.com/18077379", + "key": "Server-side JavaScript with Node, Connect & Express" + }, + { + "link": "http://www.lynda.com/Nodejs-tutorials/Nodejs-First-Look/101554-2.html", + "key": "Node.js First Look" + }, + { + "link": "http://www.youtube.com/watch?v=0_GNHWZHc-o", + "key": "Node.js with MongoDB" + }, + { + "link": "http://www.youtube.com/watch?v=F6k8lTrAE2g", + "key": "Ryan Dahl's Google Tech Talk" + }, + { + "link": "http://node.codeschool.com/levels/1", + "key": "Real Time Web with Node.js" + }, + { + "link": "https://www.youtube.com/playlist?list=PL6gx4Cwl9DGBMdkKFn3HasZnnAqVjzHn_", + "key": "Node.js Tutorials for Beginners" + }, + { + "link": "http://www.pluralsight.com/search/?searchTerm=Node.js", + "key": "Pluralsight courses (paid)" + } + ], + "Screencasts": [ + { + "link": "http://learnallthenodes.com/", + "key": "Learn All the Nodes" + }, + { + "link": "http://nodetuts.com/", + "key": "NodeTuts" + }, + { + "link": "http://nodecasts.net/", + "key": "NodeCasts" + }, + { + "link": "http://www.develop.com/webcasts/watch/5318c4d5d588bf08c461f4b1/create-server-side-mvc-apps-with-node-js-and-express", + "key": "Create server-side MVC apps with Node.js and Express" + } + ], + "Books": [ + { + "link": "http://nodebeginner.org/", + "key": "The Node Beginner Book" + }, + { + "link": "https://github.com/tj/masteringnode", + "key": "Mastering Node.js" + }, + { + "link": "http://chimera.labs.oreilly.com/books/1234000001808/index.html", + "key": "Up and Running with Node.js" + }, + { + "link": "http://www.manning.com/cantelon/", + "key": "Node.js in Action" + }, + { + "link": "http://amzn.com/B008Z5OEUY", + "key": "Smashing Node.js: JavaScript Everywhere" + }, + { + "link": "http://www.amazon.de/dp/389864829X", + "key": "Node.js & Co. (in German)" + }, + { + "link": "http://nodejsbook.io/", + "key": "Sam's Teach Yourself Node.js in 24 Hours" + }, + { + "link": "http://jsbooks.revolunet.com/", + "key": "A detailed list of free JavaScript Books" + }, + { + "link": "http://book.mixu.net/node/index.html", + "key": "Mixu's Node Book" + }, + { + "link": "http://pragprog.com/book/jwnode/node-js-the-right-way", + "key": "Node.js the Right Way: Practical, Server-Side JavaScript That Scale" + }, + { + "link": "https://leanpub.com/webdevelopmentwithnodejs", + "key": "Beginning Web Development with Node.js" + }, + { + "link": "http://www.packtpub.com/node-javascript-web-development/book", + "key": "Node Web Development" + }, + { + "link": "http://nicholasjohnson.com/courses/nodejs/book", + "key": "NodeJS for Righteous Universal Domination!" + } + ], + "Courses": [ + { + "link": "http://node.codeschool.com/", + "key": "Real Time Web with Node.js" + }, + { + "link": "http://www.develop.com/training-course/nodejs-featuring-node-npm-express-mocha-mongodb-with-mongoose", + "key": "Essential Node.js from DevelopMentor" + } + ], + "Blogs": [ + { + "link": "http://blog.nodejs.org/", + "key": "The Node.js blog" + }, + { + "link": "http://howtonode.org/", + "key": "How to Node" + }, + { + "link": "http://dailyjs.com/", + "key": "DailyJS" + }, + { + "link": "http://blog.nodejitsu.com/", + "key": "Nodejitsu blog" + }, + { + "link": "http://www.wilcoxd.com/whitepapers/node_js/", + "key": "Ryan Wilcox's Whitepaper" + }, + { + "link": "http://www.devthought.com/", + "key": "devthought" + } + ], + "Podcasts": [ + { + "link": "http://nodeup.com/", + "key": "NodeUp" + } + ], + "JavaScript Resources": [ + { + "link": "http://yuiblog.com/crockford/", + "key": "Douglas Crockford's videos" + }, + { + "link": "http://www.addyosmani.com/resources/essentialjsdesignpatterns/book/", + "key": "Essential JavaScript Design Patterns For Beginners" + }, + { + "link": "http://bonsaiden.github.com/JavaScript-Garden/", + "key": "JavaScript garden" + }, + { + "link": "http://oreilly.com/catalog/9780596806767", + "key": "Javascript Patterns" + }, + { + "link": "http://oreilly.com/catalog/9780596517748/", + "key": "JavaScript: The Good Parts" + } + ], + "Node.js Modules": [ + { + "link": "http://npmjs.org/", + "key": "Search for registered Node.js modules" + }, + { + "link": "http://www.freshblurbs.com/articles/important-node-js-modules.html", + "key": "Useful, yet biased and incomplete, selection of Node.js modules" + }, + { + "link": "https://github.com/joyent/node/wiki/modules", + "key": "Wiki List on GitHub/Joyent/Node.js " + } + ], + "Other": [ + { + "link": "http://jsapp.us/", + "key": "JSApp.US - like jsfiddle, but for Node.js" + }, + { + "link": "https://www.ebayopensource.org/index.php/VJET/NodeJS", + "key": "Node with VJET JS (for Eclipse IDE)" + }, + { + "link": "http://coding.smashingmagazine.com/2011/09/16/useful-node-js-tools-tutorials-and-resources/", + "key": "Useful Node.js Tools, Tutorials and Resources" + }, + { + "link": "http://runnable.com/", + "key": "Runnable.com - like jsfiddle, but for server side as well" + }, + { + "link": "https://devcenter.heroku.com/categories/nodejs", + "key": "Getting Started with Node.js on Heroku" + }, + { + "link": "https://blog.openshift.com/run-your-nodejs-projects-on-openshift-in-two-simple-steps/", + "key": "Getting Started with Node.js on Open-Shift" + }, + { + "link": "http://passportjs.org/guide/", + "key": "Authentication using the Passport Module" + }, + { + "link": "http://apostrophenow.org/", + "key": "In-Context, Open Source CMS built in Node.js" + } + ] + } +} From 3a6a0ab11ebc57dbd230c1876912d9673c2544c1 Mon Sep 17 00:00:00 2001 From: Zaahir Moolla Date: Thu, 19 Nov 2015 16:59:24 -0500 Subject: [PATCH 093/379] ensure val is defined before modifying --- share/goodie/cheat_sheets/cheat_sheets.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/share/goodie/cheat_sheets/cheat_sheets.js b/share/goodie/cheat_sheets/cheat_sheets.js index 48e8d4043..057394bc8 100644 --- a/share/goodie/cheat_sheets/cheat_sheets.js +++ b/share/goodie/cheat_sheets/cheat_sheets.js @@ -19,16 +19,16 @@ DDH.cheat_sheets.build = function(ops) { } else if ( i === 1 && !is_mobile ){ showhide = false; } - + //replaces */ and /* to */ and /* fixing issue1646 var val; - for (var j = 0; j < sections[section].length; j++){ - val = sections[section][j].val; - val = val.replace(/*//g, "*/") - .replace(//*/g, "/*"); - sections[section][j].val = val; + for (var j = 0; j < sections[section].length; j++){ + if (sections[section][j].hasOwnProperty(val)){ + sections[section][j].val.replace(/*//g, "*/") + .replace(//*/g, "/*"); + } } - + result += options.fn({ name: section, items: sections[section], template: template, showhide: showhide }); } }); From 35abba28fc5c07c84d95c833a79ecf6dc9b06735 Mon Sep 17 00:00:00 2001 From: Zaahir Moolla Date: Thu, 19 Nov 2015 18:13:42 -0500 Subject: [PATCH 094/379] titles for each section, proper sentence casing --- .../cheat_sheets/json/knitting-pattern.json | 530 ++++++++++-------- 1 file changed, 307 insertions(+), 223 deletions(-) diff --git a/share/goodie/cheat_sheets/json/knitting-pattern.json b/share/goodie/cheat_sheets/json/knitting-pattern.json index 269311e00..c5bdd9822 100644 --- a/share/goodie/cheat_sheets/json/knitting-pattern.json +++ b/share/goodie/cheat_sheets/json/knitting-pattern.json @@ -6,229 +6,313 @@ "sourceName": "Craft Yarn Council", "sourceUrl": "http://craftyarncouncil.com/knit.html" }, - "section_order": ["Abbreviations", " ", " "], + "template_type": "reference", + "section_order": [ + "Abbreviations (A-I)", + "Abbreviations (K-R)", + "Abbreviations (S-Z)", + "Symbols" + ], "sections": { - "Abbreviations": [{ - "val": "work instructions within brackets as many times as directed", - "key": "[]" - }, { - "val": "work instructions within parentheses in the place directed", - "key": "()" - }, { - "val": "repeat instructions following the asterisks as directed", - "key": "**" - }, { - "val": "inch(es)", - "key": "\"" - }, { - "val": "repeat instructions following the single asterisk as directed", - "key": "*" - }, { - "val": "alternate", - "key": "alt" - }, { - "val": "approximately", - "key": "approx" - }, { - "val": "begin/beginning", - "key": "beg" - }, { - "val": "between", - "key": "bet" - }, { - "val": "bind off", - "key": "BO" - }, { - "val": "color A", - "key": "CA" - }, { - "val": "color B", - "key": "CB" - }, { - "val": "contrasting color", - "key": "CC" - }, { - "val": "centimeter", - "key": "cm" - }, { - "val": "cable needle", - "key": "cn" - }, { - "val": "cast on", - "key": "CO" - }, { - "val": "continue", - "key": "cont" - }, { - "val": "decrease/decreases/decreasing", - "key": "dec" - }, { - "val": "double pointed needle(s)", - "key": "dpn" - }, { - "val": "front loop(s)", - "key": "fl" - }, { - "val": "follow/follows/following", - "key": "foll" - }, { - "val": "gram", - "key": "g" - }, { - "val": "increase/increases/increasing", - "key": "inc" - }, { - "val": "knit", - "key": "k" - }, { - "val": "knit", - "key": "K" - }], - " ": [{ - "val": "knit 2 stitches together", - "key": "k2tog" - }, { - "val": "knitwise", - "key": "kwise" - }, { - "val": "left hand", - "key": "LH" - }, { - "val": "loop(s)", - "key": "lp(s)" - }, { - "val": "meter(s)", - "key": "m" - }, { - "val": "make one stitch", - "key": "M1" - }, { - "val": "make on purl stitch", - "key": "M1 p-st" - }, { - "val": "main color", - "key": "MC" - }, { - "val": "millimeter(s)", - "key": "mm" - }, { - "val": "ounce(s)", - "key": "oz" - }, { - "val": "purl", - "key": "p" - }, { - "val": "purl", - "key": "P" - }, { - "val": "pattern(s)", - "key": "pat(s)" - }, { - "val": "pattern(s)", - "key": "patt" - }, { - "val": "place marker", - "key": "pm" - }, { - "val": "popcorn", - "key": "pop" - }, { - "val": "purl 2 stitches together", - "key": "p2tog" - }, { - "val": "previous", - "key": "prev" - }, { - "val": "pass slipped stitch over", - "key": "psso" - }, { - "val": "purlwise", - "key": "pwise" - }, { - "val": "remain/remaining", - "key": "rem" - }, { - "val": "repeat(s)", - "key": "rep" - }], - " ": [{ - "val": "reverse stockinette stitch", - "key": "rev St st" - }, { - "val": "right hand", - "key": "RH" - }, { - "val": "round(s)", - "key": "rnd(s)" - }, { - "val": "right side", - "key": "RS" - }, { - "val": "skip", - "key": "sk" - }, { - "val": "slip, knit, pass stitch over—one stitch decreased", - "key": "skp" - }, { - "val": "slip 1, knit 2 together, pass slip stitch over the knit 2 together; 2 stitches have been decreased", - "key": "sk2p" - }, { - "val": "slip", - "key": "sl" - }, { - "val": "slip 1 knitwise", - "key": "sl1k" - }, { - "val": "slip 1 purlwise", - "key": "sl1p" - }, { - "val": "slip stitch(es)", - "key": "sl st" - }, { - "val": "slip stitch (Canadian)", - "key": "ss" - }, { - "val": "slip, slip, knit these 2 stiches together—a decrease", - "key": "ssk" - }, { - "val": "slip, slip, slip, knit 3 stiches together", - "key": "sssk" - }, { - "val": "stitch(es)", - "key": "st(s)" - }, { - "val": "stockinette stitch/stocking stitch", - "key": "St st" - }, { - "val": "through back loop", - "key": "tbl" - }, { - "val": "together", - "key": "tog" - }, { - "val": "wrong side", - "key": "WS" - }, { - "val": "with yarn in back", - "key": "wyib" - }, { - "val": "with yarn in front", - "key": "wyif" - }, { - "val": "yard(s)", - "key": "yd(s)" - }, { - "val": "yarn forward", - "key": "yfwd" - }, { - "val": "yarn over", - "key": "yo" - }, { - "val": "yarn around needle", - "key": "yrn" - }, { - "val": "yarn over needle", - "key": "yon" - }] + "Symbols": [ + { + "val": "Work instructions within brackets as many times as directed", + "key": "[]" + }, + { + "val": "Work instructions within parentheses in the place directed", + "key": "()" + }, + { + "val": "Repeat instructions following the asterisks as directed", + "key": "**" + }, + { + "val": "Inch(es)", + "key": "\"" + }, + { + "val": "Repeat instructions following the single asterisk as directed", + "key": "*" + } + ], + "Abbreviations (A-I)": [ + { + "val": "Alternate", + "key": "alt" + }, + { + "val": "Approximately", + "key": "approx" + }, + { + "val": "Begin, Beginning", + "key": "beg" + }, + { + "val": "Between", + "key": "bet" + }, + { + "val": "Bind off", + "key": "BO" + }, + { + "val": "Color A", + "key": "CA" + }, + { + "val": "Color B", + "key": "CB" + }, + { + "val": "Contrasting color", + "key": "CC" + }, + { + "val": "Centimeter", + "key": "cm" + }, + { + "val": "Cable needle", + "key": "cn" + }, + { + "val": "Cast on", + "key": "CO" + }, + { + "val": "Continue", + "key": "cont" + }, + { + "val": "Decrease, Decreases, Decreasing", + "key": "dec" + }, + { + "val": "Double pointed needle(s)", + "key": "dpn" + }, + { + "val": "Front loop(s)", + "key": "fl" + }, + { + "val": "Follow, Follows, Following", + "key": "foll" + }, + { + "val": "Gram", + "key": "g" + }, + { + "val": "Increase, Increases, Increasing", + "key": "inc" + } + ], + "Abbreviations (K-R)": [ + { + "val": "Knit", + "key": "k" + }, + { + "val": "Knit", + "key": "K" + }, + { + "val": "Knit 2 stitches together", + "key": "k2tog" + }, + { + "val": "Knitwise", + "key": "kwise" + }, + { + "val": "Left hand", + "key": "LH" + }, + { + "val": "Loop(s)", + "key": "lp(s)" + }, + { + "val": "Meter(s)", + "key": "m" + }, + { + "val": "Make one stitch", + "key": "M1" + }, + { + "val": "Make on purl stitch", + "key": "M1 p-st" + }, + { + "val": "Main color", + "key": "MC" + }, + { + "val": "Millimeter(s)", + "key": "mm" + }, + { + "val": "Ounce(s)", + "key": "oz" + }, + { + "val": "Purl", + "key": "p" + }, + { + "val": "Purl", + "key": "P" + }, + { + "val": "Pattern(s)", + "key": "pat(s)" + }, + { + "val": "Pattern(s)", + "key": "patt" + }, + { + "val": "Place marker", + "key": "pm" + }, + { + "val": "Popcorn", + "key": "pop" + }, + { + "val": "Purl 2 stitches together", + "key": "p2tog" + }, + { + "val": "Previous", + "key": "prev" + }, + { + "val": "Pass slipped stitch over", + "key": "psso" + }, + { + "val": "Purlwise", + "key": "pwise" + }, + { + "val": "Remain, Remaining", + "key": "rem" + }, + { + "val": "Repeat(s)", + "key": "rep" + }, + { + "val": "Reverse stockinette stitch", + "key": "rev St st" + }, + { + "val": "Right hand", + "key": "RH" + }, + { + "val": "Round(s)", + "key": "rnd(s)" + }, + { + "val": "Right side", + "key": "RS" + } + ], + "Abbreviations (S-Z)": [ + { + "val": "Skip", + "key": "sk" + }, + { + "val": "Slip, Knit, Pass stitch over — one stitch decreased", + "key": "skp" + }, + { + "val": "Slip 1, Knit 2 together, Pass slip stitch over the knit 2 together; 2 stitches have been decreased", + "key": "sk2p" + }, + { + "val": "Slip", + "key": "sl" + }, + { + "val": "Slip 1 knitwise", + "key": "sl1k" + }, + { + "val": "Slip 1 purlwise", + "key": "sl1p" + }, + { + "val": "Slip stitch(es)", + "key": "sl st" + }, + { + "val": "Slip stitch (Canadian)", + "key": "ss" + }, + { + "val": "Slip, Slip, Knit these 2 stiches together — a decrease", + "key": "ssk" + }, + { + "val": "Slip, Slip, Slip, Knit 3 stiches together", + "key": "sssk" + }, + { + "val": "Stitch(es)", + "key": "st(s)" + }, + { + "val": "Stockinette stitch, Stocking stitch", + "key": "St st" + }, + { + "val": "Through back loop", + "key": "tbl" + }, + { + "val": "Together", + "key": "tog" + }, + { + "val": "Wrong side", + "key": "WS" + }, + { + "val": "With yarn in back", + "key": "wyib" + }, + { + "val": "With yarn in front", + "key": "wyif" + }, + { + "val": "Yard(s)", + "key": "yd(s)" + }, + { + "val": "Yarn forward", + "key": "yfwd" + }, + { + "val": "Yarn over", + "key": "yo" + }, + { + "val": "Yarn around needle", + "key": "yrn" + }, + { + "val": "Yarn over needle", + "key": "yon" + } + ] } } From d77d30d29d29ed7c91199b20fe25bd10cd1434d5 Mon Sep 17 00:00:00 2001 From: Zaahir Moolla Date: Thu, 19 Nov 2015 18:34:20 -0500 Subject: [PATCH 095/379] titles for each section, proper sentence casing --- .../cheat_sheets/json/crochet-pattern.json | 485 ++++++++++-------- 1 file changed, 281 insertions(+), 204 deletions(-) diff --git a/share/goodie/cheat_sheets/json/crochet-pattern.json b/share/goodie/cheat_sheets/json/crochet-pattern.json index 3f90646f3..b2cb3b086 100644 --- a/share/goodie/cheat_sheets/json/crochet-pattern.json +++ b/share/goodie/cheat_sheets/json/crochet-pattern.json @@ -1,213 +1,290 @@ { "id": "crochet_pattern_cheat_sheet", - "name": "Crochet Pattern Cheat Sheet", - "description": "Crochet pattern abbreviations", + "name": "Crochet Patterns", + "description": "List of crochet pattern abbreviations and meanings", "metadata": { "sourceName": "Craft Yarn Council", "sourceUrl": "http://craftyarncouncil.com/crochet.html" }, - "section_order": ["Abbreviations", " ", " "], + "template_type": "reference", + "section_order": [ + "Abbreviations (A-D)", + "Abbreviations (F-P)", + "Abbreviations (P-Z)", + "Symbols" + ], "sections": { - "Abbreviations": [{ - "val": "work instructions within brackets as many times as directed", - "key": "[]" - }, { - "val": "work instructions within parentheses in the place directed", - "key": "()" - }, { - "val": "repeat instructions following the asterisks as directed", - "key": "**" - }, { - "val": "inch(es)", - "key": "\"" - }, { - "val": "repeat instructions following the single asterisk as directed", - "key": "*" - }, { - "val": "alternate", - "key": "alt" - }, { - "val": "approximately", - "key": "approx" - }, { - "val": "begin/beginning", - "key": "beg" - }, { - "val": "between", - "key": "bet" - }, { - "val": "back loop(s)", - "key": "BL" - }, { - "val": "bobble", - "key": "bo" - }, { - "val": "back post double crochet", - "key": "BP" - }, { - "val": "back post single crochet", - "key": "BPsc" - }, { - "val": "back post treble crochet", - "key": "BPtr" - }, { - "val": "color A", - "key": "CA" - }, { - "val": "color B", - "key": "CB" - }, { - "val": "contrasting color", - "key": "CC" - }, { - "val": "chain stitch", - "key": "ch" - }, { - "val": "refers to chain or space previously made: e.g., ch-1 space", - "key": "ch-" - }], - " ": [{ - "val": "chain space", - "key": "ch-sp" - }, { - "val": "cluster", - "key": "CL" - }, { - "val": "centimeter(s)", - "key": "cm" - }, { - "val": "continue", - "key": "cont" - }, { - "val": "double crochet", - "key": "dc" - }, { - "val": "double crochet 2 stitches together", - "key": "dc2tog" - }, { - "val": "decrease/decreases/decreasing", - "key": "dec" - }, { - "val": "double treble", - "key": "dtr" - }, { - "val": "front loop(s)", - "key": "FL" - }, { - "val": "follow/follows/following", - "key": "foll" - }, { - "val": "front post", - "key": "FP" - }, { - "val": "front post double crochet", - "key": "FPdc" - }, { - "val": "front post single crochet", - "key": "FPsc" - }, { - "val": "front post treble crochet", - "key": "FPtr" - }, { - "val": "gram", - "key": "g" - }, { - "val": "half double crochet", - "key": "hdc" - }, { - "val": "increase/increases/increasing", - "key": "inc" - }, { - "val": "loops", - "key": "lp(s)" - }, { - "val": "meter(s)", - "key": "m" - }, { - "val": "main color", - "key": "MC" - }, { - "val": "millimeter(s)", - "key": "mm" - }, { - "val": "ounce(s)", - "key": "oz" - }, { - "val": "picot", - "key": "p" - }], - " ": [{ - "val": "pattern(s)", - "key": "pat(s)" - }, { - "val": "popcorn", - "key": "pc" - }, { - "val": "place marker", - "key": "pm" - }, { - "val": "previous", - "key": "prev" - }, { - "val": "remain/remaining", - "key": "rem" - }, { - "val": "repeat(s)", - "key": "rep" - }, { - "val": "round(s)", - "key": "rnd(s)" - }, { - "val": "right side", - "key": "RS" - }, { - "val": "single crochet", - "key": "sc" - }, { - "val": "single crochet 2 stitches together", - "key": "sc2tog" - }, { - "val": "skip", - "key": "sk" - }, { - "val": "slip stitch", - "key": "sL st" - }, { - "val": "space(s)", - "key": "sp(s)" - }, { - "val": "stitch(es)", - "key": "st(s)" - }, { - "val": "turning chain", - "key": "tch" - }, { - "val": "turning chain", - "key": "t-ch" - }, { - "val": "through back loop", - "key": "tbl" - }, { - "val": "together", - "key": "tog" - }, { - "val": "treble crochet", - "key": "tr" - }, { - "val": "triple treble crochet", - "key": "trtr" - }, { - "val": "wrong side", - "key": "WS" - }, { - "val": "yard(s)", - "key": "yd(s)" - }, { - "val": "yarn over", - "key": "yo" - }, { - "val": "yarn over hook", - "key": "yoh" - }] + "Symbols": [ + { + "val": "Work instructions within brackets as many times as directed", + "key": "[]" + }, + { + "val": "Work instructions within parentheses in the place directed", + "key": "()" + }, + { + "val": "Repeat instructions following the asterisks as directed", + "key": "**" + }, + { + "val": "Inch(es)", + "key": "\"" + }, + { + "val": "Repeat instructions following the single asterisk as directed", + "key": "*" + } + ], + "Abbreviations (A-D)": [ + { + "val": "Alternate", + "key": "alt" + }, + { + "val": "Approximately", + "key": "approx" + }, + { + "val": "Begin, Beginning", + "key": "beg" + }, + { + "val": "Between", + "key": "bet" + }, + { + "val": "Back loop(s)", + "key": "BL" + }, + { + "val": "Bobble", + "key": "bo" + }, + { + "val": "Back post double crochet", + "key": "BP" + }, + { + "val": "Back post single crochet", + "key": "BPsc" + }, + { + "val": "Back post treble crochet", + "key": "BPtr" + }, + { + "val": "Color A", + "key": "CA" + }, + { + "val": "Color B", + "key": "CB" + }, + { + "val": "Contrasting color", + "key": "CC" + }, + { + "val": "Chain stitch", + "key": "ch" + }, + { + "val": "Refers to chain or space previously made: e.g., ch-1 space", + "key": "ch-" + }, + { + "val": "Chain space", + "key": "ch-sp" + }, + { + "val": "Cluster", + "key": "CL" + }, + { + "val": "Centimeter(s)", + "key": "cm" + }, + { + "val": "Continue", + "key": "cont" + }, + { + "val": "Double crochet", + "key": "dc" + }, + { + "val": "Double crochet 2 stitches together", + "key": "dc2tog" + }, + { + "val": "Decrease, Decreases, Decreasing", + "key": "dec" + }, + { + "val": "Double treble", + "key": "dtr" + } + ], + "Abbreviations (F-P)": [ + { + "val": "Front loop(s)", + "key": "FL" + }, + { + "val": "Follow, Follows, Following", + "key": "foll" + }, + { + "val": "Front post", + "key": "FP" + }, + { + "val": "Front post double crochet", + "key": "FPdc" + }, + { + "val": "Front post single crochet", + "key": "FPsc" + }, + { + "val": "Front post treble crochet", + "key": "FPtr" + }, + { + "val": "Gram", + "key": "g" + }, + { + "val": "Half double crochet", + "key": "hdc" + }, + { + "val": "Increase, Increases, Increasing", + "key": "inc" + }, + { + "val": "Loops", + "key": "lp(s)" + }, + { + "val": "Meter(s)", + "key": "m" + }, + { + "val": "Main color", + "key": "MC" + }, + { + "val": "Millimeter(s)", + "key": "mm" + }, + { + "val": "Ounce(s)", + "key": "oz" + }, + { + "val": "Picot", + "key": "p" + }, + { + "val": "Pattern(s)", + "key": "pat(s)" + }, + { + "val": "Popcorn", + "key": "pc" + }, + { + "val": "Place marker", + "key": "pm" + }, + { + "val": "Previous", + "key": "prev" + } + ], + "Abbreviations (P-Z)": [ + { + "val": "Remain, Remaining", + "key": "rem" + }, + { + "val": "Repeat(s)", + "key": "rep" + }, + { + "val": "Round(s)", + "key": "rnd(s)" + }, + { + "val": "Right side", + "key": "RS" + }, + { + "val": "Single crochet", + "key": "sc" + }, + { + "val": "Single crochet 2 stitches together", + "key": "sc2tog" + }, + { + "val": "Skip", + "key": "sk" + }, + { + "val": "Slip stitch", + "key": "sL st" + }, + { + "val": "Space(s)", + "key": "sp(s)" + }, + { + "val": "Stitch(es)", + "key": "st(s)" + }, + { + "val": "Turning chain", + "key": "tch" + }, + { + "val": "Turning chain", + "key": "t-ch" + }, + { + "val": "Through back loop", + "key": "tbl" + }, + { + "val": "Together", + "key": "tog" + }, + { + "val": "Treble crochet", + "key": "tr" + }, + { + "val": "Triple treble crochet", + "key": "trtr" + }, + { + "val": "Wrong side", + "key": "WS" + }, + { + "val": "Yard(s)", + "key": "yd(s)" + }, + { + "val": "Yarn over", + "key": "yo" + }, + { + "val": "Yarn over hook", + "key": "yoh" + } + ] } } From c3264f0944fa2d92825d98b1844991ad474937a5 Mon Sep 17 00:00:00 2001 From: Zaahir Moolla Date: Thu, 19 Nov 2015 18:39:51 -0500 Subject: [PATCH 096/379] switch to terminal template --- share/goodie/cheat_sheets/json/ubuntu.json | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/share/goodie/cheat_sheets/json/ubuntu.json b/share/goodie/cheat_sheets/json/ubuntu.json index 9c893b13e..7f2ad4f78 100644 --- a/share/goodie/cheat_sheets/json/ubuntu.json +++ b/share/goodie/cheat_sheets/json/ubuntu.json @@ -9,9 +9,7 @@ "aliases": [ "ubuntu unity", "unity ubuntu cheat sheet", "unity ubuntu" ], - - "template_type": "keyboard", - + "template_type": "terminal", "section_order": [ "Privileges", "Display", @@ -221,7 +219,6 @@ "System": [{ "val": "Type the phrase REISUB while holding down Alt and SysRq (PrintScrn) with about 1 second between each letter. Your system will reboot", "key": "Recovery" - }, { "val": "Get Ubuntu version", "key": "lsb_release -a" From 7ef38a7443084e9a11170dc786e4ac050b566f0a Mon Sep 17 00:00:00 2001 From: JOBIN PHILIP ABRAHAM Date: Fri, 20 Nov 2015 07:16:40 +0530 Subject: [PATCH 097/379] Update jira.json --- share/goodie/cheat_sheets/json/jira.json | 140 +++++++++++------------ 1 file changed, 70 insertions(+), 70 deletions(-) diff --git a/share/goodie/cheat_sheets/json/jira.json b/share/goodie/cheat_sheets/json/jira.json index ca1f579ec..bb783d32f 100644 --- a/share/goodie/cheat_sheets/json/jira.json +++ b/share/goodie/cheat_sheets/json/jira.json @@ -2,10 +2,10 @@ "id": "jira_cheat_sheet", "name": "JIRA", "metadata": { - "sourceName": "cheatography", + "sourceName": "Cheatography", "sourceUrl": "http://www.cheatography.com/ovi-mihai/cheat-sheets/jira/" }, - "template_type": "reference", + "template_type": "keyboard", "section_order": [ "Global", "Navigating Issues", @@ -19,146 +19,146 @@ "sections": { "Global": [ { - "key": "Quick Search", - "val": "/" + "val": "Quick Search", + "key": "/" }, { - "key": "Quick Operations", - "val": ". " + "val": "Quick Operations", + "key": ". " }, { - "key": "Create Issue", - "val": "c" + "val": "Create Issue", + "key": "c" }, { - "key": "Next Item", - "val": "j" + "val": "Next Item", + "key": "j" }, { - "key": "Previous Item", - "val": "p" + "val": "Previous Item", + "key": "p" }, { - "key": "Dashboard", - "val": "g d" + "val": "Dashboard", + "key": "g d" }, { - "key": "Browse a Project", - "val": "g p" + "val": "Browse a Project", + "key": "g p" }, { - "key": "Agile", - "val": "g a" + "val": "Agile", + "key": "g a" }, { - "key": "Find Issues", - "val": "g i" + "val": "Find Issues", + "key": "g i" }, { - "key": "Adm Quick Search", - "val": "g g" + "val": "Adm Quick Search", + "key": "g g" }, { - "key": "Submit Form", - "val": "Ctrl + s" + "val": "Submit Form", + "key": "Ctrl + s" }, { - "key": "Help", - "val": "?" + "val": "Help", + "key": "?" } ], "Navigating Issues": [ { - "key": "View selected", - "val": "o or Enter" + "val": "View selected", + "key": "o or Enter" }, { - "key": "Next Issue", - "val": "j" + "val": "Next Issue", + "key": "j" }, { - "key": "Previous Issue", - "val": "k" + "val": "Previous Issue", + "key": "k" }, { - "key": "Assign to me", - "val": "i" + "val": "Assign to me", + "key": "i" }, { - "key": "Assign", - "val": "a" + "val": "Assign", + "key": "a" }, { - "key": "Dock/U­ncock Filters", - "val": "[" + "val": "Dock/U­ncock Filters", + "key": "[" }, { - "key": "Next Activity", - "val": "n" + "val": "Next Activity", + "key": "n" }, { - "key": "Previous Activity", - "val": "p" + "val": "Previous Activity", + "key": "p" }, { - "key": "Switch filter view", - "val": "t" + "val": "Switch filter view", + "key": "t" } ], "Agile": [ { - "key": "Plan", - "val": "1" + "val": "Plan", + "key": "1" }, { - "key": "Work", - "val": "2" + "val": "Work", + "key": "2" }, { - "key": "Report", - "val": "3" + "val": "Report", + "key": "3" }, { - "key": "Presen­tation mode", - "val": "z" + "val": "Presen­tation mode", + "key": "z" }, { - "key": "Next Column", - "val": "n" + "val": "Next Column", + "key": "n" }, { - "key": "Previous Column", - "val": "p" + "val": "Previous Column", + "key": "p" }, { - "key": "Hide/Show Details", - "val": "t" + "val": "Hide/Show Details", + "key": "t" } ], "Issue Actions": [ { - "key": "Edit Issue", - "val": "e" + "val": "Edit Issue", + "key": "e" }, { - "key": "Assign issue", - "val": "a" + "val": "Assign issue", + "key": "a" }, { - "key": "Comment", - "val": "m" + "val": "Comment", + "key": "m" }, { - "key": "Edit Labels", - "val": "l" + "val": "Edit Labels", + "key": "l" }, { - "key": "Jump to fields for editing", - "val": "," + "val": "Jump to fields for editing", + "key": "," }, { - "key": "Assign To Me", - "val": "i" + "val": "Assign To Me", + "key": "i" } ] } From 64d3c8e85b0de1962393c92d1ce05d663842d118 Mon Sep 17 00:00:00 2001 From: gautamkrishnar Date: Fri, 20 Nov 2015 21:54:05 +0000 Subject: [PATCH 098/379] awesome bar --- share/goodie/cheat_sheets/json/awesome-bar.json | 1 + 1 file changed, 1 insertion(+) diff --git a/share/goodie/cheat_sheets/json/awesome-bar.json b/share/goodie/cheat_sheets/json/awesome-bar.json index 85baf7527..332825e21 100644 --- a/share/goodie/cheat_sheets/json/awesome-bar.json +++ b/share/goodie/cheat_sheets/json/awesome-bar.json @@ -1,6 +1,7 @@ { "name": "Firefox Awesome Bar", "id": "awesome_bar_cheat_sheet", + "description": "The Firefox location bar, also called the URL bar or address bar, displays a site's web address (URL).", "metadata": { "sourceName": "Mozilla Support", "sourceUrl": "https://support.mozilla.org/kb/awesome-bar-keyboard-shortcuts" From 4deecc635ff0ef3072e7853352118fc46d6dfbde Mon Sep 17 00:00:00 2001 From: gautamkrishnar Date: Fri, 20 Nov 2015 21:56:37 +0000 Subject: [PATCH 099/379] duckduckgo.json --- share/goodie/cheat_sheets/json/duckduckgo.json | 1 + 1 file changed, 1 insertion(+) diff --git a/share/goodie/cheat_sheets/json/duckduckgo.json b/share/goodie/cheat_sheets/json/duckduckgo.json index 76c1ed39f..9bc3e791d 100644 --- a/share/goodie/cheat_sheets/json/duckduckgo.json +++ b/share/goodie/cheat_sheets/json/duckduckgo.json @@ -2,6 +2,7 @@ "id": "duckduckgo_cheat_sheet", "name": "DuckDuckGo Shortcuts", "template_type": "keyboard", + "description": "A set of keyboard shortcuts to use duckduckgo efficiently", "section_order": [ "Open results", "Move around" From 6d808b4129ebfd00725e98cf49c2953efccec731 Mon Sep 17 00:00:00 2001 From: gautamkrishnar Date: Fri, 20 Nov 2015 22:00:18 +0000 Subject: [PATCH 100/379] english-braille.json --- share/goodie/cheat_sheets/json/english-braille.json | 1 + 1 file changed, 1 insertion(+) diff --git a/share/goodie/cheat_sheets/json/english-braille.json b/share/goodie/cheat_sheets/json/english-braille.json index 936c5cbd6..9dc5fa833 100644 --- a/share/goodie/cheat_sheets/json/english-braille.json +++ b/share/goodie/cheat_sheets/json/english-braille.json @@ -1,6 +1,7 @@ { "id": "english_braille_cheat_sheet", "name": "English Braille", + "description": "English Braille, also known as Grade-2 Braille,is the braille alphabet used for English", "metadata": { "sourceName": "EnglishBraille", "sourceUrl": "https://en.wikipedia.org/wiki/English_braille" From 4859b55f02ff9c331e45761f2c7a826fcb006d53 Mon Sep 17 00:00:00 2001 From: gautamkrishnar Date: Fri, 20 Nov 2015 22:02:26 +0000 Subject: [PATCH 101/379] firefox.json --- share/goodie/cheat_sheets/json/firefox.json | 1 + 1 file changed, 1 insertion(+) diff --git a/share/goodie/cheat_sheets/json/firefox.json b/share/goodie/cheat_sheets/json/firefox.json index c4af85ab3..d8fce7784 100644 --- a/share/goodie/cheat_sheets/json/firefox.json +++ b/share/goodie/cheat_sheets/json/firefox.json @@ -1,6 +1,7 @@ { "id":"firefox_cheat_sheet", "name":"Mozilla Firefox", + "description": "Mozilla Firefox (known simply as Firefox) is a free and open-source web browser developed by the Mozilla Foundation and its subsidiary", "metadata":{ "sourceName":"Mozilla Firefox", "sourceUrl":"https://support.mozilla.org/en-US/kb/keyboard-shortcuts-perform-firefox-tasks-quickly" From 614455f682f5b44c9bf93828236dc9544436532c Mon Sep 17 00:00:00 2001 From: gautamkrishnar Date: Fri, 20 Nov 2015 22:05:52 +0000 Subject: [PATCH 102/379] irc.json --- share/goodie/cheat_sheets/json/irc.json | 1 + 1 file changed, 1 insertion(+) diff --git a/share/goodie/cheat_sheets/json/irc.json b/share/goodie/cheat_sheets/json/irc.json index 106f09a00..9dfb25ded 100644 --- a/share/goodie/cheat_sheets/json/irc.json +++ b/share/goodie/cheat_sheets/json/irc.json @@ -1,6 +1,7 @@ { "id": "irc_cheat_sheet", "name": "IRC Cheat Sheet", + "description": "Internet Relay Chat (IRC) is an application layer protocol that facilitates communication in the form of text", "metadata": { "sourceName": "Internet Relay Chat WikiHow", "sourceUrl": "http://www.cheat-sheets.org/saved-copy/wikiHow_IRC_Cheat_Sheet.pdf" From 60f28d8770e44c302803fa9c83a6448ad6f24626 Mon Sep 17 00:00:00 2001 From: gautamkrishnar Date: Fri, 20 Nov 2015 22:08:17 +0000 Subject: [PATCH 103/379] morse-code.json --- share/goodie/cheat_sheets/json/morse-code.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/share/goodie/cheat_sheets/json/morse-code.json b/share/goodie/cheat_sheets/json/morse-code.json index b8720f3a2..4f306400d 100644 --- a/share/goodie/cheat_sheets/json/morse-code.json +++ b/share/goodie/cheat_sheets/json/morse-code.json @@ -1,6 +1,7 @@ { "id": "morse_code_cheat_sheet", - "name": "Morse Code Cheat Sheet", + "name": "Morse Code Cheat Sheet", + "description": "Morse code is a method of transmitting text information as a series of on-off tones, lights, or clicks that can be directly understood by a skilled listener", "metadata":{ "sourceName": "MorseCode", "sourceUrl": "http://morsecode.scphillips.com/morse2.html" From 5e002a42cc07cd39eebaa95d25d2a3791c0e2758 Mon Sep 17 00:00:00 2001 From: direwolf-424 Date: Fri, 20 Nov 2015 22:17:18 +0000 Subject: [PATCH 104/379] spacing issue --- share/goodie/cheat_sheets/json/arch-linux.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/goodie/cheat_sheets/json/arch-linux.json b/share/goodie/cheat_sheets/json/arch-linux.json index 09332b9e7..89e145111 100644 --- a/share/goodie/cheat_sheets/json/arch-linux.json +++ b/share/goodie/cheat_sheets/json/arch-linux.json @@ -1,7 +1,7 @@ { "id": "arch_linux_cheat_sheet", "name": "Arch Linux", - "description": "Arch Linux Commands For Pacman , Yaourt and Some Basic Linux Commands", + "description": "Arch Linux Commands For Pacman,Yaourt and Some Basic Linux Commands", "metadata": { "sourceName": "ArchWiki", "sourceUrl": "https://wiki.archlinux.org/index.php/Pacman" From c1882cfcdba23c82df290ec1c9b8d2eb65435ff7 Mon Sep 17 00:00:00 2001 From: Mailkov Date: Sat, 21 Nov 2015 10:00:26 +0000 Subject: [PATCH 105/379] Issue #1491 - Chess960: Remove clickable link from result --- lib/DDG/Goodie/PackageTracking.pm | 20 ++++++++++++++++++++ lib/DDG/GoodieRole/Chess.pm | 2 +- t/PackageTracking.t | 22 ++++++++++++++++++++++ 3 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 lib/DDG/Goodie/PackageTracking.pm create mode 100644 t/PackageTracking.t diff --git a/lib/DDG/Goodie/PackageTracking.pm b/lib/DDG/Goodie/PackageTracking.pm new file mode 100644 index 000000000..0a5914aa1 --- /dev/null +++ b/lib/DDG/Goodie/PackageTracking.pm @@ -0,0 +1,20 @@ +package DDG::Goodie::PackageTracking; +# ABSTRACT: track a package. + +use DDG::Goodie; +use strict; + +zci answer_type => 'package_tracking'; +zci is_cached => 1; + +# Triggers +triggers any => 'triggerWord', 'trigger phrase'; + +# Handle statement +handle remainder => sub { + # Query can be accessed in $_ + + return $_; +}; + +1; diff --git a/lib/DDG/GoodieRole/Chess.pm b/lib/DDG/GoodieRole/Chess.pm index ddcad7d99..9c1c840cf 100644 --- a/lib/DDG/GoodieRole/Chess.pm +++ b/lib/DDG/GoodieRole/Chess.pm @@ -76,7 +76,7 @@ sub draw_chessboard_html { for ($j = 0; $j < 8; $j++){ # Columns $html_chessboard .= ''; - $html_chessboard .= ''; $html_chessboard .= ''; $counter++; diff --git a/t/PackageTracking.t b/t/PackageTracking.t new file mode 100644 index 000000000..695b60774 --- /dev/null +++ b/t/PackageTracking.t @@ -0,0 +1,22 @@ +#!/usr/bin/env perl + +use strict; +use warnings; +use Test::More; +use DDG::Test::Goodie; + +zci answer_type => "package_tracking"; +zci is_cached => 1; + +ddg_goodie_test( + [qw( DDG::Goodie::PackageTracking )], + # At a minimum, be sure to include tests for all: + # - primary_example_queries + # - secondary_example_queries + 'example query' => test_zci('query'), + # Try to include some examples of queries on which it might + # appear that your answer will trigger, but does not. + 'bad example query' => undef, +); + +done_testing; From 531820110500ae4837b2e8ca9ef687f480c468f9 Mon Sep 17 00:00:00 2001 From: Mailkov Date: Sat, 21 Nov 2015 10:11:08 +0000 Subject: [PATCH 106/379] fix error commit --- lib/DDG/Goodie/PackageTracking.pm | 20 -------------------- t/PackageTracking.t | 22 ---------------------- 2 files changed, 42 deletions(-) delete mode 100644 lib/DDG/Goodie/PackageTracking.pm delete mode 100644 t/PackageTracking.t diff --git a/lib/DDG/Goodie/PackageTracking.pm b/lib/DDG/Goodie/PackageTracking.pm deleted file mode 100644 index 0a5914aa1..000000000 --- a/lib/DDG/Goodie/PackageTracking.pm +++ /dev/null @@ -1,20 +0,0 @@ -package DDG::Goodie::PackageTracking; -# ABSTRACT: track a package. - -use DDG::Goodie; -use strict; - -zci answer_type => 'package_tracking'; -zci is_cached => 1; - -# Triggers -triggers any => 'triggerWord', 'trigger phrase'; - -# Handle statement -handle remainder => sub { - # Query can be accessed in $_ - - return $_; -}; - -1; diff --git a/t/PackageTracking.t b/t/PackageTracking.t deleted file mode 100644 index 695b60774..000000000 --- a/t/PackageTracking.t +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env perl - -use strict; -use warnings; -use Test::More; -use DDG::Test::Goodie; - -zci answer_type => "package_tracking"; -zci is_cached => 1; - -ddg_goodie_test( - [qw( DDG::Goodie::PackageTracking )], - # At a minimum, be sure to include tests for all: - # - primary_example_queries - # - secondary_example_queries - 'example query' => test_zci('query'), - # Try to include some examples of queries on which it might - # appear that your answer will trigger, but does not. - 'bad example query' => undef, -); - -done_testing; From b5b52c58e2b733c4d55886026fac451d0db464c8 Mon Sep 17 00:00:00 2001 From: Mailkov Date: Sat, 21 Nov 2015 10:29:03 +0000 Subject: [PATCH 107/379] fix error test Chess960.t --- t/Chess960.t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/Chess960.t b/t/Chess960.t index fbfd4c896..2503fc9fd 100644 --- a/t/Chess960.t +++ b/t/Chess960.t @@ -21,7 +21,7 @@ pppppppp - - - - PPPPPPPP [QRBKN]{1,8}$/, - html => qr/^
((
.*<\/a><\/td>){1,8}<\/tr>){1,8}<\/table><\/div>$/, + html => qr/^
(('; $counter++; } diff --git a/t/Chess960.t b/t/Chess960.t index 2503fc9fd..576d4f21e 100644 --- a/t/Chess960.t +++ b/t/Chess960.t @@ -21,7 +21,7 @@ pppppppp - - - - PPPPPPPP [QRBKN]{1,8}$/, - html => qr/^
.*<\/a><\/td>){1,8}<\/tr>){1,8}<\/table><\/div>$/, heading => qr/^Position \d+ \(Chess960\)$/, ) } ('random chess960 position', 'chess960 random') From df2ee9e47c130d48b11f7c116ab92eb720ccbe06 Mon Sep 17 00:00:00 2001 From: Mailkov Date: Sat, 21 Nov 2015 10:39:05 +0000 Subject: [PATCH 108/379] fix error test FenViewer.t --- t/FenViewer.t | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/t/FenViewer.t b/t/FenViewer.t index 99c4db97f..c2190887e 100644 --- a/t/FenViewer.t +++ b/t/FenViewer.t @@ -10,11 +10,11 @@ zci is_cached => 1; ddg_goodie_test( [qw( DDG::Goodie::FenViewer )], - 'FEN rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1' => test_zci("rnbqkbnr\npppppppp\n - - - -\n- - - - \n - - - -\n- - - - \nPPPPPPPP\nRNBQKBNR", html => ''), - 'fen rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq e3 0 1 ' => test_zci("rnbqkbnr\npppppppp\n - - - -\n- - - - \n - -P- -\n- - - - \nPPPP PPP\nRNBQKBNR", html => ''), + 'FEN rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1' => test_zci("rnbqkbnr\npppppppp\n - - - -\n- - - - \n - - - -\n- - - - \nPPPPPPPP\nRNBQKBNR", html => ''), + 'fen rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq e3 0 1 ' => test_zci("rnbqkbnr\npppppppp\n - - - -\n- - - - \n - -P- -\n- - - - \nPPPP PPP\nRNBQKBNR", html => ''), # Two examples from the last world championship - 'fen r1b1r1k1/2qn1ppp/1ppp4/p3p3/P2PP3/R4N1P/1PP2PP1/2BQR1K1 b - - 0 14 ' => test_zci("r-b-r-k-\n- qn-ppp\n ppp - -\np - p - \nP- PP- -\nR - -N-P\n PP- PP-\n- BQR K ", html => ''), - 'fen 5rk1/4R1p1/3q1p2/p1p2P1p/P3Q2P/5pP1/2P2P1K/8 w - - 0 35' => test_zci(" - - rk-\n- - R p \n - q p -\np p -P-p\nP- -Q- P\n- - -pP \n -P- P K\n- - - - ", html => ''), + 'fen r1b1r1k1/2qn1ppp/1ppp4/p3p3/P2PP3/R4N1P/1PP2PP1/2BQR1K1 b - - 0 14 ' => test_zci("r-b-r-k-\n- qn-ppp\n ppp - -\np - p - \nP- PP- -\nR - -N-P\n PP- PP-\n- BQR K ", html => ''), + 'fen 5rk1/4R1p1/3q1p2/p1p2P1p/P3Q2P/5pP1/2P2P1K/8 w - - 0 35' => test_zci(" - - rk-\n- - R p \n - q p -\np p -P-p\nP- -Q- P\n- - -pP \n -P- P K\n- - - - ", html => ''), 'rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1' => undef, 'fen' => undef, 'fen ' => undef, From 75f844506cf1b72ea0cb604641789baea0e43e56 Mon Sep 17 00:00:00 2001 From: "Gautam krishna.R" Date: Sat, 21 Nov 2015 16:24:46 +0530 Subject: [PATCH 109/379] Update duckduckgo.json --- share/goodie/cheat_sheets/json/duckduckgo.json | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/share/goodie/cheat_sheets/json/duckduckgo.json b/share/goodie/cheat_sheets/json/duckduckgo.json index b56e2991b..1411e1091 100644 --- a/share/goodie/cheat_sheets/json/duckduckgo.json +++ b/share/goodie/cheat_sheets/json/duckduckgo.json @@ -2,12 +2,8 @@ "id": "duckduckgo_cheat_sheet", "name": "DuckDuckGo Shortcuts", "template_type": "keyboard", -<<<<<<< HEAD "description": "A set of keyboard shortcuts to use duckduckgo efficiently", - "section_order": [ -======= "section_order": [ ->>>>>>> master "Open results", "Move around" ], @@ -61,4 +57,4 @@ } ] } -} \ No newline at end of file +} From bdaeb7385cda72d4015435315302e9dcdb965d8d Mon Sep 17 00:00:00 2001 From: "Gautam krishna.R" Date: Sat, 21 Nov 2015 16:26:30 +0530 Subject: [PATCH 110/379] Update firefox.json --- share/goodie/cheat_sheets/json/firefox.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/share/goodie/cheat_sheets/json/firefox.json b/share/goodie/cheat_sheets/json/firefox.json index 012097635..fea02e73a 100644 --- a/share/goodie/cheat_sheets/json/firefox.json +++ b/share/goodie/cheat_sheets/json/firefox.json @@ -1,12 +1,8 @@ { "id":"firefox_cheat_sheet", "name":"Mozilla Firefox", -<<<<<<< HEAD "description": "Mozilla Firefox (known simply as Firefox) is a free and open-source web browser developed by the Mozilla Foundation and its subsidiary", - "metadata":{ -======= "metadata":{ ->>>>>>> master "sourceName":"Mozilla Firefox", "sourceUrl":"https://support.mozilla.org/en-US/kb/keyboard-shortcuts-perform-firefox-tasks-quickly" }, From c8c3f67d7401b9db7aacf0b68e3e4154f3471951 Mon Sep 17 00:00:00 2001 From: "Gautam krishna.R" Date: Sat, 21 Nov 2015 16:27:38 +0530 Subject: [PATCH 111/379] Update irc.json --- share/goodie/cheat_sheets/json/irc.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/goodie/cheat_sheets/json/irc.json b/share/goodie/cheat_sheets/json/irc.json index 9dfb25ded..80e2fd457 100644 --- a/share/goodie/cheat_sheets/json/irc.json +++ b/share/goodie/cheat_sheets/json/irc.json @@ -1,6 +1,6 @@ { "id": "irc_cheat_sheet", - "name": "IRC Cheat Sheet", + "name": "IRC", "description": "Internet Relay Chat (IRC) is an application layer protocol that facilitates communication in the form of text", "metadata": { "sourceName": "Internet Relay Chat WikiHow", From 495f61b856726b85e179b261cc8fb9731840c6bc Mon Sep 17 00:00:00 2001 From: Mailkov Date: Sat, 21 Nov 2015 11:03:49 +0000 Subject: [PATCH 112/379] changes tag to --- lib/DDG/GoodieRole/Chess.pm | 4 ++-- t/Chess960.t | 2 +- t/FenViewer.t | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/DDG/GoodieRole/Chess.pm b/lib/DDG/GoodieRole/Chess.pm index 9c1c840cf..e6f3e1752 100644 --- a/lib/DDG/GoodieRole/Chess.pm +++ b/lib/DDG/GoodieRole/Chess.pm @@ -76,8 +76,8 @@ sub draw_chessboard_html { for ($j = 0; $j < 8; $j++){ # Columns $html_chessboard .= ''; - $html_chessboard .= ''.$unicode_dict{$position[$counter]}.''; + $html_chessboard .= ''.$unicode_dict{$position[$counter]}.''; $html_chessboard .= '
((
.*<\/a><\/td>){1,8}<\/tr>){1,8}<\/table><\/div>$/, + html => qr/^
((
.*<\/span><\/td>){1,8}<\/tr>){1,8}<\/table><\/div>$/, heading => qr/^Position \d+ \(Chess960\)$/, ) } ('random chess960 position', 'chess960 random') diff --git a/t/FenViewer.t b/t/FenViewer.t index c2190887e..409ac0716 100644 --- a/t/FenViewer.t +++ b/t/FenViewer.t @@ -10,11 +10,11 @@ zci is_cached => 1; ddg_goodie_test( [qw( DDG::Goodie::FenViewer )], - 'FEN rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1' => test_zci("rnbqkbnr\npppppppp\n - - - -\n- - - - \n - - - -\n- - - - \nPPPPPPPP\nRNBQKBNR", html => ''), - 'fen rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq e3 0 1 ' => test_zci("rnbqkbnr\npppppppp\n - - - -\n- - - - \n - -P- -\n- - - - \nPPPP PPP\nRNBQKBNR", html => ''), + 'FEN rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1' => test_zci("rnbqkbnr\npppppppp\n - - - -\n- - - - \n - - - -\n- - - - \nPPPPPPPP\nRNBQKBNR", html => '
'), + 'fen rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq e3 0 1 ' => test_zci("rnbqkbnr\npppppppp\n - - - -\n- - - - \n - -P- -\n- - - - \nPPPP PPP\nRNBQKBNR", html => '
'), # Two examples from the last world championship - 'fen r1b1r1k1/2qn1ppp/1ppp4/p3p3/P2PP3/R4N1P/1PP2PP1/2BQR1K1 b - - 0 14 ' => test_zci("r-b-r-k-\n- qn-ppp\n ppp - -\np - p - \nP- PP- -\nR - -N-P\n PP- PP-\n- BQR K ", html => ''), - 'fen 5rk1/4R1p1/3q1p2/p1p2P1p/P3Q2P/5pP1/2P2P1K/8 w - - 0 35' => test_zci(" - - rk-\n- - R p \n - q p -\np p -P-p\nP- -Q- P\n- - -pP \n -P- P K\n- - - - ", html => ''), + 'fen r1b1r1k1/2qn1ppp/1ppp4/p3p3/P2PP3/R4N1P/1PP2PP1/2BQR1K1 b - - 0 14 ' => test_zci("r-b-r-k-\n- qn-ppp\n ppp - -\np - p - \nP- PP- -\nR - -N-P\n PP- PP-\n- BQR K ", html => '
'), + 'fen 5rk1/4R1p1/3q1p2/p1p2P1p/P3Q2P/5pP1/2P2P1K/8 w - - 0 35' => test_zci(" - - rk-\n- - R p \n - q p -\np p -P-p\nP- -Q- P\n- - -pP \n -P- P K\n- - - - ", html => '
'), 'rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1' => undef, 'fen' => undef, 'fen ' => undef, From b5d395b8d72639105f94604aad47848e8071dda8 Mon Sep 17 00:00:00 2001 From: Mailkov Date: Sat, 21 Nov 2015 11:13:06 +0000 Subject: [PATCH 113/379] changes 960chess.css tag a to span --- share/goodie/chess960/chess960.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/goodie/chess960/chess960.css b/share/goodie/chess960/chess960.css index 03ccd2172..0261fb79c 100644 --- a/share/goodie/chess960/chess960.css +++ b/share/goodie/chess960/chess960.css @@ -1,4 +1,4 @@ -.zci--answer .zci--fenviewer a { +.zci--answer .zci--fenviewer span { color:#333; display:block; font-size:27px; From a90bd9dba17ad8a18b6b2f30ddfe17c55e12a294 Mon Sep 17 00:00:00 2001 From: Mailkov Date: Sat, 21 Nov 2015 11:14:56 +0000 Subject: [PATCH 114/379] changes fen_viewer.css tag a to span --- share/goodie/fen_viewer/fen_viewer.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/goodie/fen_viewer/fen_viewer.css b/share/goodie/fen_viewer/fen_viewer.css index 03ccd2172..0261fb79c 100644 --- a/share/goodie/fen_viewer/fen_viewer.css +++ b/share/goodie/fen_viewer/fen_viewer.css @@ -1,4 +1,4 @@ -.zci--answer .zci--fenviewer a { +.zci--answer .zci--fenviewer span { color:#333; display:block; font-size:27px; From 63b442b2db683eb1fe882e9a46858ae8139a031b Mon Sep 17 00:00:00 2001 From: Mailkov Date: Sat, 21 Nov 2015 11:30:07 +0000 Subject: [PATCH 115/379] Issue #1138 - start working --- lib/DDG/Goodie/PackageTracking.pm | 22 ++++++++++++++++++++++ t/PackageTracking.t | 22 ++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 lib/DDG/Goodie/PackageTracking.pm create mode 100644 t/PackageTracking.t diff --git a/lib/DDG/Goodie/PackageTracking.pm b/lib/DDG/Goodie/PackageTracking.pm new file mode 100644 index 000000000..a2ddb795d --- /dev/null +++ b/lib/DDG/Goodie/PackageTracking.pm @@ -0,0 +1,22 @@ +package DDG::Goodie::PackageTracking; +# ABSTRACT: Write an abstract here +# Start at https://duck.co/duckduckhack/goodie_overview if you are new +# to instant answer development + +use DDG::Goodie; +use strict; + +zci answer_type => 'package_tracking'; +zci is_cached => 1; + +# Triggers +triggers any => 'triggerWord', 'trigger phrase'; + +# Handle statement +handle remainder => sub { + # Query can be accessed in $_ + + return $_; +}; + +1; diff --git a/t/PackageTracking.t b/t/PackageTracking.t new file mode 100644 index 000000000..695b60774 --- /dev/null +++ b/t/PackageTracking.t @@ -0,0 +1,22 @@ +#!/usr/bin/env perl + +use strict; +use warnings; +use Test::More; +use DDG::Test::Goodie; + +zci answer_type => "package_tracking"; +zci is_cached => 1; + +ddg_goodie_test( + [qw( DDG::Goodie::PackageTracking )], + # At a minimum, be sure to include tests for all: + # - primary_example_queries + # - secondary_example_queries + 'example query' => test_zci('query'), + # Try to include some examples of queries on which it might + # appear that your answer will trigger, but does not. + 'bad example query' => undef, +); + +done_testing; From 0f3cf8d0dfb8eb9b174af5f6ad0a0e48902a7e20 Mon Sep 17 00:00:00 2001 From: Lerna Ekmekcioglu Date: Sat, 21 Nov 2015 13:19:14 -0500 Subject: [PATCH 116/379] Updated wording for a better phrased translation and added punctuation marks where needed --- share/goodie/cheat_sheets/json/armenian.json | 148 ------------------ .../cheat_sheets/json/language/armenian.json | 32 ++-- 2 files changed, 16 insertions(+), 164 deletions(-) delete mode 100644 share/goodie/cheat_sheets/json/armenian.json diff --git a/share/goodie/cheat_sheets/json/armenian.json b/share/goodie/cheat_sheets/json/armenian.json deleted file mode 100644 index 98f8a3c63..000000000 --- a/share/goodie/cheat_sheets/json/armenian.json +++ /dev/null @@ -1,148 +0,0 @@ -{ - "id" : "armenian_cheat_sheet", - - "name" : "Armenian Cheat Sheet (Western)", - - "metadata" : { - "sourceName" : "omniglot", - "sourceUrl" : "http://www.omniglot.com/language/phrases/westernarmenian.htm" - }, - - "aliases": [ - "armenian phrases", "english to armenian", "basic armenian phrases", "basic armenian" - ], - - "template_type": "reference", - - "section_order" : [ - "Basics", - "Etiquette", - "Getting Help", - "Traveling" - ], - - "description" : "Basic Armenian words and phrases", - - "sections" : { - "Etiquette" : [ - { - "val" : "Բարի լույս: (Pahree looys)", - "key" : "Good morning" - }, - { - "val" : "Բարի կէսօր: (Pahree guess-ore - rarely used)", - "key" : "Good afternoon" - }, - { - "val" : "Բարի իրիկուն: (Pahree Eeree-goon)", - "key" : "Good evening" - }, - { - "val" : "Մնաք բարով: (Muh-nuck parov) - leaving", - "key" : "Goodbye" - }, - { - "val" : "Երթաք բարով: (Yer-tuck parov) - staying", - "key" : "Goodbye" - }, - { - "val" : "Շնորհակալ եմ: (Shnor-ha-gal em)", - "key" : "Thanks" - }, - { - "val" : "Ներողութիւն: (Neh-ro-ghoo-tune)", - "key" : "I am sorry" - } - ], - "Getting Help" : [ - { - "val" : "Օգնութիւն (Oak-noo-tune)", - "key" : "Help" - }, - { - "val" : "Ոստիկան (Vohs-dee-gun)", - "key" : "Police" - }, - { - "val" : "Բժիշկ կանչեցեք: (Puhsheeshk gun-chetzek)", - "key" : "Get a doctor" - }, - { - "val" : "Հիւանդ եմ: (Hee-vunt ehm)", - "key" : "I am sick" - }, - { - "val" : "Մեկը գողցավ իմ ... (Meh-guh khogh-tzahv eem ...)", - "key" : "Somebody has stolen my..." - }, - { - "val" : "Հիւանդանոցը ո՞ւր է: (Heevon-tah-no-tzuh oor eh?)", - "key" : "Where is the hospital?" - } - ], - "Basics" : [ - { - "val" : "Անունս ... է: (Uh-noon-us ... eh)", - "key" : "My name is..." - }, - { - "val" : "Լաւ եմ, շնորհակալ եմ: Եւ դուք ինչպէ՞ս էք: (Laav em shnor-hagal em. Yev took inch bess ek?)", - "key" : "I'm fine, thanks. And you?" - }, - { - "val" : "Ինչպե՞ս եք: (Inch bess ek)", - "key" : "How are you?" - }, - { - "val" : "Բարև (Pahrev)", - "key" : "Hello" - }, - { - "val" : "Բարի՜ եկաք: (Pah-ree yeh-guck)", - "key" : "Welcome" - }, - { - "val" : "Ձեր անունը ի՞նչ է: (Tzer a-noo-nuh inch eh)", - "key" : "What's your name?" - } - ], - "Traveling" : [ - { - "val" : "Անգլիերէն կը խօսի՞ք: (Ahnc-laren guh kho-seek?)", - "key" : "Do you speak English?" - }, - { - "val" : "Հաճիս ինձի կրնա՞ք օգնել: (Huh-jees intzi guhr-nuck ok-nell?)", - "key" : "Would you help me please?" - }, - { - "val" : "Պէտքարանը ո՞ւր է: (Bed-kara-nuh oor eh?)", - "key" : "Where is the toilet?" - }, - { - "val" : "Ասիկա ինչքա՞ն կ'արժէ: (Asee-guh inch-khan gar-zheh?)", - "key" : "How much is this?" - }, - { - "val" : "Ուր կրնամ գտնա՞լ ... (Oor grnum kuhd-null ...?)", - "key" : "Where can I find ..." - }, - { - "val" : "Որ ատէն խանութը կը բացվի՞: (Vor adehn kha-noo-tuh guh patzwee?)", - "key" : "What time does the shop open?" - }, - { - "val" : "Որ ատէն խանութը կը գոցվի՞: (Vor adehn kha-noo-tuh guh kotzvee?)", - "key" : "What time does the shop close?" - }, - { - "val" : "Հաճիս աւելի կամաց կրնա՞ք խօսիլ: (Huhjees ave-lee ga-matz guhr-nock khoseel?", - "key" : "Could you talk a bit slower?" - }, - { - "val" : "Հաճիս կրնա՞ք կրկնել: (Huhjees guhr-nock ghurg-nell?)", - "key" : "Could you repeat that please?" - } - ] - } -} diff --git a/share/goodie/cheat_sheets/json/language/armenian.json b/share/goodie/cheat_sheets/json/language/armenian.json index 2599e8535..bcdbaebc7 100644 --- a/share/goodie/cheat_sheets/json/language/armenian.json +++ b/share/goodie/cheat_sheets/json/language/armenian.json @@ -90,7 +90,7 @@ }, { "key" : "Where is the hospital?", - "val" : "Հիւանդանոցը ո՞ւր է", + "val" : "Հիւանդանոցը ո՞ւր է:", "trn" : "Heevon-tah-no-tzuh oor eh?" } ], @@ -102,12 +102,12 @@ }, { "key" : "I'm fine, thanks. And you?", - "val" : "Լաւ եմ, շնորհակալ եմ: Եւ դուք ինչպէ՞ս էք", - "trn" : "Laav em, shnor-hagal em. Yev took inch bess ek?" + "val" : "Լաւ եմ, մերսի: Դուք ինչպէ՞ս էք:", + "trn" : "Laav em, mer-see. Took inch bess ek?" }, { "key" : "How are you?", - "val" : "Ինչպէ՞ս էք", + "val" : "Ինչպէ՞ս էք:", "trn" : "Inch bess ek" }, { @@ -122,29 +122,29 @@ }, { "key" : "What's your name?", - "val" : "Ձեր անունը ի՞նչ է", + "val" : "Ձեր անունը ի՞նչ է:", "trn" : "Tzer a-noo-nuh inch eh" } ], "Travelling" : [ { "key" : "Do you speak English?", - "val" : "Անգլիերէն կը խօսի՞ք", + "val" : "Անգլիերէն կը խօսի՞ք:", "trn" : "Ahnc-laren guh kho-seek?" }, { "key" : "Would you help me please?", - "val" : "Հաճիս ինծի կրնա՞ք օգնել", + "val" : "Հաճիս ինծի կրնա՞ք օգնել:", "trn" : "Huh-jees intzi guhr-nuck ok-nell?" }, { "key" : "Where is the toilet?", - "val" : "Պէտքարանը ո՞ւր է", + "val" : "Պէտքարանը ո՞ւր է:", "trn" : "Bed-kara-nuh oor eh?" }, { "key" : "How much is this?", - "val" : "Ասիկա ինչքա՞ն կ'արժէ", + "val" : "Ասիկա ինչքա՞ն կ'արժէ:", "trn" : "Asee-guh inch-kun gar-zheh?" }, { @@ -154,29 +154,29 @@ }, { "key" : "What time does the shop open?", - "val" : "Ժամը քանի՞ին խանութը կը բացվի՞", + "val" : "Ժամը քանի՞ին խանութը կը բացվի:", "trn" : "Shum-uh kun-ee-in kha-noo-tuh guh patzwee?" }, { "key" : "What time does the shop close?", - "val" : "Ժամը քանի՞ին խանութը կը գոցվի՞", + "val" : "Ժամը քանի՞ին խանութը կը գոցվի:", "trn" : "Shum-uh kun-ee-in kha-noo-tuh guh kotzvee?" }, { "key" : "Could you talk a bit slower?", - "val" : "Հաճիս աւելի կամաց կրնա՞ք խօսիլ", + "val" : "Հաճիս աւելի կամաց կրնա՞ք խօսիլ:", "trn" : "Huhjees ave-lee ga-matz guhr-nock khoseel?" }, { "key" : "Could you repeat that please?", - "val" : "Հաճիս կրնա՞ք կրկնել", + "val" : "Հաճիս կրնա՞ք կրկնել:", "trn" : "Huhjees guhr-nock gurg-nell?" } ], "Going out for dinner" : [ { "key" : "Do you have vegetarian dishes?", - "val" : "Միայն բանջարեղէնով կերակուր ո՞ւնիք", + "val" : "Միայն բանջարեղէնով կերակուր ո՞ւնիք:", "trn" : "Mee-uhyn pun-chuh-reh-gheh-nov gue-ruh-goor oo-nik?" }, { @@ -201,7 +201,7 @@ }, { "key" : "Where is a good restaurant?", - "val" : "Լաւ ճաշարան մը ուր կը գտնուի", + "val" : "Լաւ ճաշարան մը ո՞ւր կը գտնուի:", "trn" : "Lav juh-shu-run muh oor guh kuhd-nuh-vee?" }, { @@ -211,7 +211,7 @@ }, { "key" : "Can I get a menu, please", - "val" : "Ճաշացուցակ, խնդրեմ", + "val" : "Ճաշացուցակ, խնդրեմ:", "trn" : "Juh-sha-tzoo-tzug, khuhn-trem" } ] From b69894362603f29c94c7969bf5a2006d7800a1c2 Mon Sep 17 00:00:00 2001 From: JOBIN PHILIP ABRAHAM Date: Mon, 23 Nov 2015 12:44:31 +0530 Subject: [PATCH 117/379] Update 8086.json --- share/goodie/cheat_sheets/json/8086.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/goodie/cheat_sheets/json/8086.json b/share/goodie/cheat_sheets/json/8086.json index d559950c3..196928b21 100644 --- a/share/goodie/cheat_sheets/json/8086.json +++ b/share/goodie/cheat_sheets/json/8086.json @@ -1,6 +1,6 @@ { "id": "8086_cheat_sheet", - "name": "8086", + "name": "8086 Instruction Set", "description": "8086 instructions and their explanations", "metadata": { "sourceName": "utcluj", From 4d5ac6f84214b0f13bec1fc138323ccb853d594c Mon Sep 17 00:00:00 2001 From: JOBIN PHILIP ABRAHAM Date: Mon, 23 Nov 2015 15:41:07 +0530 Subject: [PATCH 118/379] Update sql.json --- share/goodie/cheat_sheets/json/sql.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/share/goodie/cheat_sheets/json/sql.json b/share/goodie/cheat_sheets/json/sql.json index c7f4f1d58..3cb0b2a43 100644 --- a/share/goodie/cheat_sheets/json/sql.json +++ b/share/goodie/cheat_sheets/json/sql.json @@ -8,8 +8,8 @@ }, "template_type":"reference", "section_order":[ - "Data Manipulation Language (DML) Commands", - "Data Definition Language (DDL) Commands", + " ManDataipulation Language (DML)", + "Data Definition Language (DDL)", "Aggregate Functions", "Arguments Used with Commands", "SQL Constraints", @@ -21,7 +21,7 @@ "sql commands" ], "sections":{ - "Data Definition Language (DDL) Commands":[ + "Data Definition Language (DDL)":[ { "key":"CREATE TABLE", "val":"Define a new table" @@ -59,7 +59,7 @@ } ], - "Data Manipulation Language (DML) Commands":[ + "Data Manipulation Language (DML)":[ { "key":"SELECT", From 0765152329d7ed9717b938b120cd102eb71f9eaa Mon Sep 17 00:00:00 2001 From: JOBIN PHILIP ABRAHAM Date: Mon, 23 Nov 2015 15:52:12 +0530 Subject: [PATCH 119/379] Update duckduckgo-syntax.json Added an alias --- share/goodie/cheat_sheets/json/duckduckgo-syntax.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/goodie/cheat_sheets/json/duckduckgo-syntax.json b/share/goodie/cheat_sheets/json/duckduckgo-syntax.json index 3192ea909..be3b10eb1 100644 --- a/share/goodie/cheat_sheets/json/duckduckgo-syntax.json +++ b/share/goodie/cheat_sheets/json/duckduckgo-syntax.json @@ -8,7 +8,7 @@ "sourceUrl": "https://duck.co/help/results/syntax" }, "aliases": [ - "ddg syntax" + "ddg syntax","duck duck go syntax" ], "section_order": [ "Triggers", From 3f4cdb77f973ed8cd1fea6eef3759448148895cb Mon Sep 17 00:00:00 2001 From: JOBIN PHILIP ABRAHAM Date: Mon, 23 Nov 2015 15:54:08 +0530 Subject: [PATCH 120/379] Update duckduckgo.json Added aliases --- share/goodie/cheat_sheets/json/duckduckgo.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/share/goodie/cheat_sheets/json/duckduckgo.json b/share/goodie/cheat_sheets/json/duckduckgo.json index 1411e1091..35368fc3d 100644 --- a/share/goodie/cheat_sheets/json/duckduckgo.json +++ b/share/goodie/cheat_sheets/json/duckduckgo.json @@ -6,6 +6,10 @@ "section_order": [ "Open results", "Move around" + ], + "aliases": [ + "duck duck go shortcuts", + "ddg shortcuts" ], "sections": { "Open results": [ From b33d739786a8824118f09f11840f305b9acf11a2 Mon Sep 17 00:00:00 2001 From: JOBIN PHILIP ABRAHAM Date: Mon, 23 Nov 2015 15:58:06 +0530 Subject: [PATCH 121/379] Update currency.json Added alias --- share/goodie/cheat_sheets/json/currency.json | 510 +++++++++++-------- 1 file changed, 295 insertions(+), 215 deletions(-) diff --git a/share/goodie/cheat_sheets/json/currency.json b/share/goodie/cheat_sheets/json/currency.json index 16b4642b9..81b4b885c 100644 --- a/share/goodie/cheat_sheets/json/currency.json +++ b/share/goodie/cheat_sheets/json/currency.json @@ -15,221 +15,301 @@ "South America", "Antartica", "Oceania" - ], + ], + "aliases": [ + "countries and currencies", + "countries and currency" + ], "sections": { - "Africa":[{ - "key":"Algeria", - "val":"Dinar" - },{ - "key":"Angola", - "val":"Kwanza" - },{ - "key":"Botswana", - "val":"Pula" - },{ - "key":"Cameroon", - "val":"CFA franc" - },{ - "key":"Egypt", - "val":"Egyptian pound" - },{ - "key":"Ethiopia", - "val":"Birr " - },{ - "key":"Ghana", - "val":"Ghana cedi" - },{ - "key":"Kenya", - "val":"Kenyan shilling" - },{ - "key":"Libya", - "val":"Dinar" - },{ - "key":"Mali", - "val":"CFA franc" - },{ - "key":"Nigeria", - "val":"Naira" - },{ - "key":"South Africa", - "val":"South African rand" - },{ - "key":"Sudan", - "val":"Sudanese pound" - },{ - "key":"Uganda", - "val":"Ugandan shilling" - } ], - "Asia": [{ - "key":"Afghanistan", - "val":"Afghani" - },{ - "key":"Bahrain", - "val":"Bahraini dinar" - },{ - "key":"Bangladesh", - "val":"Taka" - },{ - "key":"China", - "val":"Renminbi (yuan)" - },{ - "key":"Hong Kong", - "val":"Hong Kong dollar" - },{ - "key":"India", - "val":"Indian rupee" - },{ - "key":"Japan", - "val":"Yen" - },{ - "key":"Kuwait", - "val":"Kuwaiti dinar" - },{ - "key":"Thailand", - "val":"Baht" - } ], - "Europe":[{ - "key":"Austria", - "val":"Euro" - },{ - "key":"Belgium", - "val":"Euro" - },{ - "key":"France", - "val":"Euro CFP franc" - },{ - "key":"Germany", - "val":"Euro" - },{ - "key":"Hungary", - "val":"Forint" - },{ - "key":"Ireland", - "val":"Euro" - },{ - "key":"Russia", - "val":"Russian ruble" - },{ - "key":"Switzerland", - "val":"Swiss franc" - },{ - "key":"Spain", - "val":"Euro " - } ], - "North America": [{ - "key":"Antigua and Barbuda", - "val":"East Caribbean dollar" - }, { - "key":"Bahamas", - "val":"Bahamian dollar" - }, { - "key":"Barbados", - "val":"Barbadian dollar" - }, { - "key":"Belize", - "val":"Belize dollar" - }, { - "key":"Bermuda", - "val":"Bermudian dollar" - }, { - "key":"Canada", - "val":"Canadian dollar" - }, { - "key":"Costa Rica", - "val":"Costa Rican colon" - }, { - "key":"Cuba", - "val":"Cuban Peso" - }, { - "key":"Dominican Republic", - "val":"Dominican Peso" - }, { - "key":"El Salvador", - "val":"United States dollar" - }, { - "key":"Guatemala", - "val":"Guatemalan quetzal" - }, { - "key":"Jamaica", - "val":"Jamaican dollar" - }, { - "key":"Mexico", - "val":"Mexican Peso" - }, { - "key":"Panama", - "val":"United States dollar" - }, { - "key":"United States of America", - "val":"United States dollar" - }], - "South America": [{ - "key":"Argentina", - "val":"Peso" - }, { - "key":"Bolivia", - "val":"Boliviano" - }, { - "key":"Brazil", - "val":"Real" - }, { - "key":"Chile", - "val":"Peso" - }, { - "key":"Colombia", - "val":"Peso" - }, { - "key":"Ecuador", - "val":"United States dollar" - }, { - "key":"Falkland Islands", - "val":"Falklands Island Pound" - }, { - "key":"French Guiana", - "val":"Euro" - }, { - "key":"Guyana", - "val":"Guyanese dollar" - }, { - "key":"Paraguay", - "val":"Guarani" - }, { - "key":"Peru", - "val":"Nuevo Sol" - }, { - "key":"Suriname", - "val":"Surinamese dollar" - }, { - "key":"Uruguay", - "val":"Uruguayan Peso" - }, { - "key":"Venezuela", - "val":"Bolívar fuerte" - }], - "Oceania": [{ - "key":"Australia", - "val":"Australian dollar" - }, { - "key":"Fiji", - "val":"Fijian dollar" - }, { - "key":"New Zealand", - "val":"New Zealand dollar" - }, { - "key":"Vanuatu", - "val":"Vanuatu Vatu" - }, { - "key":"American Samoa", - "val":"United States dollar" - }, { - "key":"Cook Islands", - "val":"Cook Islands dollar" - }], - "Antartica":[{ - "key":"French Southern Territories", - "val":"Euro" - }, { - "key":"South Georgia and the South Sandwich Islands", - "val":"Pound Sterling" - }] + "Africa": [ + { + "key": "Algeria", + "val": "Dinar" + }, + { + "key": "Angola", + "val": "Kwanza" + }, + { + "key": "Botswana", + "val": "Pula" + }, + { + "key": "Cameroon", + "val": "CFA franc" + }, + { + "key": "Egypt", + "val": "Egyptian pound" + }, + { + "key": "Ethiopia", + "val": "Birr " + }, + { + "key": "Ghana", + "val": "Ghana cedi" + }, + { + "key": "Kenya", + "val": "Kenyan shilling" + }, + { + "key": "Libya", + "val": "Dinar" + }, + { + "key": "Mali", + "val": "CFA franc" + }, + { + "key": "Nigeria", + "val": "Naira" + }, + { + "key": "South Africa", + "val": "South African rand" + }, + { + "key": "Sudan", + "val": "Sudanese pound" + }, + { + "key": "Uganda", + "val": "Ugandan shilling" + } + ], + "Asia": [ + { + "key": "Afghanistan", + "val": "Afghani" + }, + { + "key": "Bahrain", + "val": "Bahraini dinar" + }, + { + "key": "Bangladesh", + "val": "Taka" + }, + { + "key": "China", + "val": "Renminbi (yuan)" + }, + { + "key": "Hong Kong", + "val": "Hong Kong dollar" + }, + { + "key": "India", + "val": "Indian rupee" + }, + { + "key": "Japan", + "val": "Yen" + }, + { + "key": "Kuwait", + "val": "Kuwaiti dinar" + }, + { + "key": "Thailand", + "val": "Baht" + } + ], + "Europe": [ + { + "key": "Austria", + "val": "Euro" + }, + { + "key": "Belgium", + "val": "Euro" + }, + { + "key": "France", + "val": "Euro CFP franc" + }, + { + "key": "Germany", + "val": "Euro" + }, + { + "key": "Hungary", + "val": "Forint" + }, + { + "key": "Ireland", + "val": "Euro" + }, + { + "key": "Russia", + "val": "Russian ruble" + }, + { + "key": "Switzerland", + "val": "Swiss franc" + }, + { + "key": "Spain", + "val": "Euro " + } + ], + "North America": [ + { + "key": "Antigua and Barbuda", + "val": "East Caribbean dollar" + }, + { + "key": "Bahamas", + "val": "Bahamian dollar" + }, + { + "key": "Barbados", + "val": "Barbadian dollar" + }, + { + "key": "Belize", + "val": "Belize dollar" + }, + { + "key": "Bermuda", + "val": "Bermudian dollar" + }, + { + "key": "Canada", + "val": "Canadian dollar" + }, + { + "key": "Costa Rica", + "val": "Costa Rican colon" + }, + { + "key": "Cuba", + "val": "Cuban Peso" + }, + { + "key": "Dominican Republic", + "val": "Dominican Peso" + }, + { + "key": "El Salvador", + "val": "United States dollar" + }, + { + "key": "Guatemala", + "val": "Guatemalan quetzal" + }, + { + "key": "Jamaica", + "val": "Jamaican dollar" + }, + { + "key": "Mexico", + "val": "Mexican Peso" + }, + { + "key": "Panama", + "val": "United States dollar" + }, + { + "key": "United States of America", + "val": "United States dollar" + } + ], + "South America": [ + { + "key": "Argentina", + "val": "Peso" + }, + { + "key": "Bolivia", + "val": "Boliviano" + }, + { + "key": "Brazil", + "val": "Real" + }, + { + "key": "Chile", + "val": "Peso" + }, + { + "key": "Colombia", + "val": "Peso" + }, + { + "key": "Ecuador", + "val": "United States dollar" + }, + { + "key": "Falkland Islands", + "val": "Falklands Island Pound" + }, + { + "key": "French Guiana", + "val": "Euro" + }, + { + "key": "Guyana", + "val": "Guyanese dollar" + }, + { + "key": "Paraguay", + "val": "Guarani" + }, + { + "key": "Peru", + "val": "Nuevo Sol" + }, + { + "key": "Suriname", + "val": "Surinamese dollar" + }, + { + "key": "Uruguay", + "val": "Uruguayan Peso" + }, + { + "key": "Venezuela", + "val": "Bolívar fuerte" + } + ], + "Oceania": [ + { + "key": "Australia", + "val": "Australian dollar" + }, + { + "key": "Fiji", + "val": "Fijian dollar" + }, + { + "key": "New Zealand", + "val": "New Zealand dollar" + }, + { + "key": "Vanuatu", + "val": "Vanuatu Vatu" + }, + { + "key": "American Samoa", + "val": "United States dollar" + }, + { + "key": "Cook Islands", + "val": "Cook Islands dollar" + } + ], + "Antartica": [ + { + "key": "French Southern Territories", + "val": "Euro" + }, + { + "key": "South Georgia and the South Sandwich Islands", + "val": "Pound Sterling" + } + ] } } From 7e4eed8d2a42317f3cb18a1e38e9a2a4b03253f0 Mon Sep 17 00:00:00 2001 From: JOBIN PHILIP ABRAHAM Date: Mon, 23 Nov 2015 18:30:37 +0530 Subject: [PATCH 122/379] Update ubuntu.json removed an alias "unity ubuntu cheat sheet" --- share/goodie/cheat_sheets/json/ubuntu.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/goodie/cheat_sheets/json/ubuntu.json b/share/goodie/cheat_sheets/json/ubuntu.json index 7f2ad4f78..c19b57d0e 100644 --- a/share/goodie/cheat_sheets/json/ubuntu.json +++ b/share/goodie/cheat_sheets/json/ubuntu.json @@ -7,7 +7,7 @@ "sourceUrl": "http://www.cheat-sheets.org/saved-copy/ubunturef.pdf" }, "aliases": [ - "ubuntu unity", "unity ubuntu cheat sheet", "unity ubuntu" + "ubuntu unity", "unity ubuntu" ], "template_type": "terminal", "section_order": [ From 5e3a182d24a18ee083606c401f7dfc4ac89667e2 Mon Sep 17 00:00:00 2001 From: JOBIN PHILIP ABRAHAM Date: Mon, 23 Nov 2015 18:45:28 +0530 Subject: [PATCH 123/379] Update knitting-pattern.json removed "cheat sheet" from name --- share/goodie/cheat_sheets/json/knitting-pattern.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/goodie/cheat_sheets/json/knitting-pattern.json b/share/goodie/cheat_sheets/json/knitting-pattern.json index c5bdd9822..577395657 100644 --- a/share/goodie/cheat_sheets/json/knitting-pattern.json +++ b/share/goodie/cheat_sheets/json/knitting-pattern.json @@ -1,6 +1,6 @@ { "id": "knitting_pattern_cheat_sheet", - "name": "Knitting Pattern Cheat Sheet", + "name": "Knitting Pattern", "description": "Knitting pattern abbreviations", "metadata": { "sourceName": "Craft Yarn Council", From e755fae7ddced5ae7e4a1d95c4523059462886a3 Mon Sep 17 00:00:00 2001 From: JOBIN PHILIP ABRAHAM Date: Mon, 23 Nov 2015 20:02:31 +0530 Subject: [PATCH 124/379] Update sql.json --- share/goodie/cheat_sheets/json/sql.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/goodie/cheat_sheets/json/sql.json b/share/goodie/cheat_sheets/json/sql.json index 3cb0b2a43..1e6698a14 100644 --- a/share/goodie/cheat_sheets/json/sql.json +++ b/share/goodie/cheat_sheets/json/sql.json @@ -8,7 +8,7 @@ }, "template_type":"reference", "section_order":[ - " ManDataipulation Language (DML)", + "Data Manipulation Language (DML)", "Data Definition Language (DDL)", "Aggregate Functions", "Arguments Used with Commands", From 0e1b79f33dc72b890218ddc968269dc25d1e8597 Mon Sep 17 00:00:00 2001 From: JOBIN PHILIP ABRAHAM Date: Mon, 23 Nov 2015 21:13:53 +0530 Subject: [PATCH 125/379] Update bbcode.json updated source name --- share/goodie/cheat_sheets/json/bbcode.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/goodie/cheat_sheets/json/bbcode.json b/share/goodie/cheat_sheets/json/bbcode.json index 66e5a0754..504015830 100644 --- a/share/goodie/cheat_sheets/json/bbcode.json +++ b/share/goodie/cheat_sheets/json/bbcode.json @@ -3,7 +3,7 @@ "name": "BBCode", "description": "Text formatting for popular online forums (Not all codes are supported by all forums)", "metadata": { - "sourceName": "bbcode.org", + "sourceName": "BBCODE", "sourceUrl": "http://www.bbcode.org/reference.php" }, "template_type": "code", From c86c1b06652cf9b648c1617ecc8c86655151212a Mon Sep 17 00:00:00 2001 From: Mailkov Date: Mon, 23 Nov 2015 15:47:31 +0000 Subject: [PATCH 126/379] Issue 1418 - Factorial: Move integration into Calculator.pm; Calculate factorial with Math::BigInt bfac() --- lib/DDG/Goodie/Calculator.pm | 8 +++++++- lib/DDG/Goodie/Factorial.pm | 2 +- t/Calculator.t | 18 ++++++++++++++++++ 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/lib/DDG/Goodie/Calculator.pm b/lib/DDG/Goodie/Calculator.pm index 02227550a..87bdd865a 100644 --- a/lib/DDG/Goodie/Calculator.pm +++ b/lib/DDG/Goodie/Calculator.pm @@ -7,6 +7,7 @@ with 'DDG::GoodieRole::NumberStyler'; use List::Util qw( max ); use Math::Trig; +use Math::BigInt; use utf8; zci answer_type => "calc"; @@ -33,7 +34,7 @@ triggers query_nowhitespace => qr< [\( \) x X × ∙ ⋅ * % + ÷ / \^ 0-9 \. , _ \$ -]* (?(1) (?: -? [0-9 \. , _ ]+ |) |) - (?: [\( \) x X × ∙ ⋅ * % + ÷ / \^ \$ -] | times | divided by | plus | minus | cos | sin | tan | cotan | log | ln | log[_]?\d{1,3} | exp | tanh | sec | csc | squared | sqrt | pi | e )+ + (?: [\( \) x X × ∙ ⋅ * % + ÷ / \^ \$ -] | times | divided by | plus | minus | fact | factorial | cos | sin | tan | cotan | log | ln | log[_]?\d{1,3} | exp | tanh | sec | csc | squared | sqrt | pi | e )+ (?: [0-9 \. ,]* ) (?: gross | dozen | pi | e | c | squared | score |) @@ -59,6 +60,7 @@ my %named_operations = ( '÷' => '/', 'ln' => 'log', # perl log() is natural log. 'squared' => '**2', + 'fact' => 'Math::BigInt->new', ); my %named_constants = ( @@ -85,9 +87,11 @@ handle query_nowhitespace => sub { return if ($query =~ /^(?:(?:\+?1\s*(?:[.-]\s*)?)?(?:\(\s*([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9])\s*\)|([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9]))\s*(?:[.-]\s*)?)([2-9]1[02-9]|[2-9][02-9]1|[2-9][02-9]{2})\s*(?:[.-]\s*)?([0-9]{4})(?:\s*(?:#|x\.?|ext\.?|extension)\s*(\d+))?$/); # Probably are searching for a phone number, not making a calculation $query =~ s/^(?:whatis|calculate|solve|math)//; + $query =~ s/(factorial)/fact/; #replace factorial with fact # Grab expression. my $tmp_expr = spacing($query, 1); + return if $tmp_expr eq $query; # If it didn't get spaced out, there are no operations to be done. @@ -114,6 +118,7 @@ handle query_nowhitespace => sub { return unless $style; $tmp_expr = $style->for_computation($tmp_expr); + $tmp_expr =~ s/(Math::BigInt->new\((.*)\))/(Math::BigInt->new\($2\))->bfac()/g; #correct expression for factorial # Using functions makes us want answers with more precision than our inputs indicate. my $precision = ($query =~ $funcy) ? undef : ($query =~ /^\$/) ? 2 : max(map { $style->precision_of($_) } @numbers); my $tmp_result; @@ -152,6 +157,7 @@ sub prepare_for_display { # Show them how 'E' was interpreted. This should use the number styler, too. $query =~ s/((?:\d+?|\s))E(-?\d+)/\($1 * 10^$2\)/i; $query =~ s/\s*\*{2}\s*/^/g; # Use prettier exponentiation. + $query =~ s/(Math::BigInt->new\((.*)\))/fact\($2\)/g; #replace Math::BigInt->new( with fact( $result = $style->for_display($result); foreach my $name (keys %named_constants) { $query =~ s#\($name\)#$name#xig; diff --git a/lib/DDG/Goodie/Factorial.pm b/lib/DDG/Goodie/Factorial.pm index 3ddc930c5..4940bafde 100644 --- a/lib/DDG/Goodie/Factorial.pm +++ b/lib/DDG/Goodie/Factorial.pm @@ -20,7 +20,7 @@ code_url "https://github.com/duckduckgo/zeroclickinfo-goodies/blob/master/lib/DD attribution github => ["https://github.com/codenirvana", "Udit Vasu"], twitter => "uditdistro"; -triggers any => "factorial", "fact"; +triggers any => "factorial", "facs"; handle remainder => sub { my $n = $_; diff --git a/t/Calculator.t b/t/Calculator.t index ed93f4a66..26feafbfb 100644 --- a/t/Calculator.t +++ b/t/Calculator.t @@ -759,6 +759,24 @@ ddg_goodie_test( result => qr"6.28318530717958" } ), + 'fact(3)' => test_zci( + 'fact(3) = 6', + heading => 'Calculator', + structured_answer => { + input => ['fact(3)'], + operation => 'Calculate', + result => qr/>6 test_zci( + 'fact(3) = 6', + heading => 'Calculator', + structured_answer => { + input => ['fact(3)'], + operation => 'Calculate', + result => qr/>6 undef, '83.166.167.160/27' => undef, '9 + 0 x 07' => undef, From 8acb04c9d731f9efc59d88789d4dbb5af633ab75 Mon Sep 17 00:00:00 2001 From: Mailkov Date: Mon, 23 Nov 2015 15:52:39 +0000 Subject: [PATCH 127/379] Issue 1418 - fix change Factorial.t --- lib/DDG/Goodie/Factorial.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/DDG/Goodie/Factorial.pm b/lib/DDG/Goodie/Factorial.pm index 4940bafde..3ddc930c5 100644 --- a/lib/DDG/Goodie/Factorial.pm +++ b/lib/DDG/Goodie/Factorial.pm @@ -20,7 +20,7 @@ code_url "https://github.com/duckduckgo/zeroclickinfo-goodies/blob/master/lib/DD attribution github => ["https://github.com/codenirvana", "Udit Vasu"], twitter => "uditdistro"; -triggers any => "factorial", "facs"; +triggers any => "factorial", "fact"; handle remainder => sub { my $n = $_; From 8566e8fdf87cfa158c13febe7a4de12c8b5cc561 Mon Sep 17 00:00:00 2001 From: Mailkov Date: Mon, 23 Nov 2015 16:03:17 +0000 Subject: [PATCH 128/379] Issue 1418 - fix error commit --- lib/DDG/Goodie/Calculator.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/DDG/Goodie/Calculator.pm b/lib/DDG/Goodie/Calculator.pm index 87bdd865a..a1a8acfef 100644 --- a/lib/DDG/Goodie/Calculator.pm +++ b/lib/DDG/Goodie/Calculator.pm @@ -118,7 +118,7 @@ handle query_nowhitespace => sub { return unless $style; $tmp_expr = $style->for_computation($tmp_expr); - $tmp_expr =~ s/(Math::BigInt->new\((.*)\))/(Math::BigInt->new\($2\))->bfac()/g; #correct expression for factorial + $tmp_expr =~ s/(Math::BigInt->new\((.*)\))/(Math::BigInt->new\($2\))->bfac()/g; #correct expression for fact # Using functions makes us want answers with more precision than our inputs indicate. my $precision = ($query =~ $funcy) ? undef : ($query =~ /^\$/) ? 2 : max(map { $style->precision_of($_) } @numbers); my $tmp_result; From 0e40119f688f65f5c3171a6e481e8346f7904f58 Mon Sep 17 00:00:00 2001 From: Mailkov Date: Mon, 23 Nov 2015 16:11:40 +0000 Subject: [PATCH 129/379] Issue 1418 - fix error PackageTracking --- lib/DDG/Goodie/PackageTracking.pm | 22 ---------------------- t/PackageTracking.t | 22 ---------------------- 2 files changed, 44 deletions(-) delete mode 100644 lib/DDG/Goodie/PackageTracking.pm delete mode 100644 t/PackageTracking.t diff --git a/lib/DDG/Goodie/PackageTracking.pm b/lib/DDG/Goodie/PackageTracking.pm deleted file mode 100644 index a2ddb795d..000000000 --- a/lib/DDG/Goodie/PackageTracking.pm +++ /dev/null @@ -1,22 +0,0 @@ -package DDG::Goodie::PackageTracking; -# ABSTRACT: Write an abstract here -# Start at https://duck.co/duckduckhack/goodie_overview if you are new -# to instant answer development - -use DDG::Goodie; -use strict; - -zci answer_type => 'package_tracking'; -zci is_cached => 1; - -# Triggers -triggers any => 'triggerWord', 'trigger phrase'; - -# Handle statement -handle remainder => sub { - # Query can be accessed in $_ - - return $_; -}; - -1; diff --git a/t/PackageTracking.t b/t/PackageTracking.t deleted file mode 100644 index 695b60774..000000000 --- a/t/PackageTracking.t +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env perl - -use strict; -use warnings; -use Test::More; -use DDG::Test::Goodie; - -zci answer_type => "package_tracking"; -zci is_cached => 1; - -ddg_goodie_test( - [qw( DDG::Goodie::PackageTracking )], - # At a minimum, be sure to include tests for all: - # - primary_example_queries - # - secondary_example_queries - 'example query' => test_zci('query'), - # Try to include some examples of queries on which it might - # appear that your answer will trigger, but does not. - 'bad example query' => undef, -); - -done_testing; From 76bba985e883bf79bcb00a1c63438a4d13ca9fe0 Mon Sep 17 00:00:00 2001 From: Mailkov Date: Mon, 23 Nov 2015 16:38:08 +0000 Subject: [PATCH 130/379] remove Factorial.pm and Factorial.t --- lib/DDG/Goodie/Factorial.pm | 44 ------------------------------------- 1 file changed, 44 deletions(-) delete mode 100644 lib/DDG/Goodie/Factorial.pm diff --git a/lib/DDG/Goodie/Factorial.pm b/lib/DDG/Goodie/Factorial.pm deleted file mode 100644 index 3ddc930c5..000000000 --- a/lib/DDG/Goodie/Factorial.pm +++ /dev/null @@ -1,44 +0,0 @@ -package DDG::Goodie::Factorial; -# ABSTRACT: n factorial - -use strict; -use DDG::Goodie; - -use List::Util qw(reduce); -use bigint; - -zci answer_type => "factorial"; -zci is_cached => 1; - -name "Factorial"; -description "Returns Factorial of n"; -primary_example_queries "factorial 7", "7 factorial"; -secondary_example_queries "12 fact"; -topics 'math'; -category 'calculations'; -code_url "https://github.com/duckduckgo/zeroclickinfo-goodies/blob/master/lib/DDG/Goodie/Factorial.pm"; -attribution github => ["https://github.com/codenirvana", "Udit Vasu"], - twitter => "uditdistro"; - -triggers any => "factorial", "fact"; - -handle remainder => sub { - my $n = $_; - - return unless $n =~ /^\d+$/; - - $n = int($n); - - my $fact = '1'; - $fact = reduce { $a * $b } 1 .. $n if ($n > 0); - - return "Factorial of $n is $fact", - structured_answer => { - input => [$n], - operation => 'Factorial', - result => $fact - }; - -}; - -1; From 75a9d44e82869cff4efa46060972ad9ef5c0bb27 Mon Sep 17 00:00:00 2001 From: Mailkov Date: Mon, 23 Nov 2015 16:38:37 +0000 Subject: [PATCH 131/379] remove Factorial.t --- t/Factorial.t | 52 --------------------------------------------------- 1 file changed, 52 deletions(-) delete mode 100644 t/Factorial.t diff --git a/t/Factorial.t b/t/Factorial.t deleted file mode 100644 index c5eec12dd..000000000 --- a/t/Factorial.t +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/env perl - -use strict; -use warnings; -use Test::More; -use DDG::Test::Goodie; -use bigint; - -zci answer_type => "factorial"; -zci is_cached => 1; - -ddg_goodie_test( - [qw( DDG::Goodie::Factorial )], - 'fact 4' => test_zci( - 'Factorial of 4 is 24', - structured_answer => { - input => ['4'], - operation => 'Factorial', - result => 24 - } - ), - 'factorial 6' => test_zci( - 'Factorial of 6 is 720', - structured_answer => { - input => ['6'], - operation => 'Factorial', - result => 720 - } - ), - 'factorial 0' => test_zci( - 'Factorial of 0 is 1', - structured_answer => { - input => ['0'], - operation => 'Factorial', - result => 1 - } - ), - 'tell a factorial' => undef, - 'what is factorial?' => undef, - 'a factorial' => undef, - '25abc factorial' => undef, - 'factorial xyz' => undef, - 'factorial -9' => undef, - 'factorial 0!' => undef, - '-12 factorial' => undef, - 'fact -8' => undef, - 'fact 12!' => undef, - 'abc fact' => undef, - 'n8 fact' => undef, -); - -done_testing; From 0cef246ab3f53f1a276528ddb823d3690370f34a Mon Sep 17 00:00:00 2001 From: Zaahir Moolla Date: Mon, 23 Nov 2015 17:10:11 -0500 Subject: [PATCH 132/379] wrap yaml in quotes to force string type --- share/goodie/public_dns/providers.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/share/goodie/public_dns/providers.yml b/share/goodie/public_dns/providers.yml index b085e8f08..501947247 100644 --- a/share/goodie/public_dns/providers.yml +++ b/share/goodie/public_dns/providers.yml @@ -67,8 +67,8 @@ Censurfridns: - 91.239.100.100 - 89.233.43.71 ip6: - - 2001:67c:28a4:: - - 2002:d596:2a92:1:71:53:: + - "2001:67c:28a4::" + - "2002:d596:2a92:1:71:53::" puntCAT: info_url: http://www.servidordenoms.cat/ ip4: @@ -149,8 +149,8 @@ Xiala.net: - 77.109.148.136 - 77.109.148.137 ip6: - - 2001:1620:2078:136:: - - 2001:1620:2078:137:: + - "2001:1620:2078:136::" + - "2001:1620:2078:137::" SkyDNS: info_url: https://www.skydns.ru/ ip4: From 0faf43a25fa00ac30da104b0cba6028a915793db Mon Sep 17 00:00:00 2001 From: amitdev Date: Tue, 24 Nov 2015 13:03:44 +0000 Subject: [PATCH 133/379] Added currency symbols to cheatsheet --- share/goodie/cheat_sheets/json/currency.json | 134 +++++++++---------- 1 file changed, 67 insertions(+), 67 deletions(-) diff --git a/share/goodie/cheat_sheets/json/currency.json b/share/goodie/cheat_sheets/json/currency.json index 16b4642b9..bd09c7989 100644 --- a/share/goodie/cheat_sheets/json/currency.json +++ b/share/goodie/cheat_sheets/json/currency.json @@ -19,217 +19,217 @@ "sections": { "Africa":[{ "key":"Algeria", - "val":"Dinar" + "val":"DZD (Dinar)" },{ "key":"Angola", - "val":"Kwanza" + "val":"Kz (Kwanza)" },{ "key":"Botswana", - "val":"Pula" + "val":"P (Pula)" },{ "key":"Cameroon", "val":"CFA franc" },{ "key":"Egypt", - "val":"Egyptian pound" + "val":"\u00A3 (Egyptian pound)" },{ "key":"Ethiopia", - "val":"Birr " + "val":"Br (Birr)" },{ "key":"Ghana", - "val":"Ghana cedi" + "val":"\u00A2 (Ghana cedi)" },{ "key":"Kenya", - "val":"Kenyan shilling" + "val":"Ksh (Kenyan shilling)" },{ "key":"Libya", - "val":"Dinar" + "val":"LD (Dinar)" },{ "key":"Mali", "val":"CFA franc" },{ "key":"Nigeria", - "val":"Naira" + "val":"\u20a6 (Naira)" },{ "key":"South Africa", - "val":"South African rand" + "val":"R (South African rand)" },{ "key":"Sudan", - "val":"Sudanese pound" + "val":"SDG (Sudanese pound)" },{ "key":"Uganda", - "val":"Ugandan shilling" + "val":"Ush (Ugandan shilling)" } ], "Asia": [{ "key":"Afghanistan", - "val":"Afghani" + "val":"\u060b (Afghani)" },{ "key":"Bahrain", - "val":"Bahraini dinar" + "val":"BHD (Bahraini dinar)" },{ "key":"Bangladesh", - "val":"Taka" + "val":"\u09F3 (Taka)" },{ "key":"China", - "val":"Renminbi (yuan)" + "val":"\u00a5 (Renminbi or yuan)" },{ "key":"Hong Kong", - "val":"Hong Kong dollar" + "val":"\u0024 (Hong Kong dollar)" },{ "key":"India", - "val":"Indian rupee" + "val":"\u20B9 (Indian rupee)" },{ "key":"Japan", - "val":"Yen" + "val":"\u00a5 (Yen)" },{ "key":"Kuwait", - "val":"Kuwaiti dinar" + "val":"KWD (Kuwaiti dinar)" },{ "key":"Thailand", - "val":"Baht" + "val":"\u0e3f (Baht)" } ], "Europe":[{ "key":"Austria", - "val":"Euro" + "val":"\u20ac (Euro)" },{ "key":"Belgium", - "val":"Euro" + "val":"\u20ac (Euro)" },{ "key":"France", - "val":"Euro CFP franc" + "val":" (Euro CFP franc)" },{ "key":"Germany", - "val":"Euro" + "val":"\u20ac (Euro)" },{ "key":"Hungary", - "val":"Forint" + "val":"Ft (Forint)" },{ "key":"Ireland", - "val":"Euro" + "val":"\u20ac (Euro)" },{ "key":"Russia", - "val":"Russian ruble" + "val":"\u0440\u0443\u0431 (Russian ruble)" },{ "key":"Switzerland", - "val":"Swiss franc" + "val":"CHF (Swiss franc)" },{ "key":"Spain", - "val":"Euro " + "val":"\u20ac (Euro)" } ], "North America": [{ "key":"Antigua and Barbuda", - "val":"East Caribbean dollar" + "val":"$ (East Caribbean dollar)" }, { "key":"Bahamas", - "val":"Bahamian dollar" + "val":"$ (Bahamian dollar)" }, { "key":"Barbados", - "val":"Barbadian dollar" + "val":"$ (Barbadian dollar)" }, { "key":"Belize", - "val":"Belize dollar" + "val":"$ (Belize dollar)" }, { "key":"Bermuda", - "val":"Bermudian dollar" + "val":"$ (Bermudian dollar)" }, { "key":"Canada", - "val":"Canadian dollar" + "val":"$ (Canadian dollar)" }, { "key":"Costa Rica", - "val":"Costa Rican colon" + "val":" (Costa Rican colon)" }, { "key":"Cuba", - "val":"Cuban Peso" + "val":"\u20a1 (Cuban Peso)" }, { "key":"Dominican Republic", - "val":"Dominican Peso" + "val":"RD$ (Dominican Peso)" }, { "key":"El Salvador", - "val":"United States dollar" + "val":"$ (United States dollar)" }, { "key":"Guatemala", - "val":"Guatemalan quetzal" + "val":"Q (Guatemalan quetzal)" }, { "key":"Jamaica", - "val":"Jamaican dollar" + "val":"$ (Jamaican dollar)" }, { "key":"Mexico", - "val":"Mexican Peso" + "val":"$ (Mexican Peso)" }, { "key":"Panama", - "val":"United States dollar" + "val":"$ (United States dollar)" }, { "key":"United States of America", - "val":"United States dollar" + "val":"$ (United States dollar)" }], "South America": [{ "key":"Argentina", - "val":"Peso" + "val":"$ (Peso)" }, { "key":"Bolivia", - "val":"Boliviano" + "val":"Bs (Boliviano)" }, { "key":"Brazil", - "val":"Real" + "val":"R$ (Real)" }, { "key":"Chile", - "val":"Peso" + "val":"$ (Peso)" }, { "key":"Colombia", - "val":"Peso" + "val":"$ (Peso)" }, { "key":"Ecuador", - "val":"United States dollar" + "val":"$ (United States dollar)" }, { "key":"Falkland Islands", - "val":"Falklands Island Pound" + "val":"\u00a3 (Falklands Island Pound)" }, { "key":"French Guiana", - "val":"Euro" + "val":"\u20ac (Euro)" }, { "key":"Guyana", - "val":"Guyanese dollar" + "val":"$ (Guyanese dollar)" }, { "key":"Paraguay", - "val":"Guarani" + "val":"\u20b2 (Guarani)" }, { "key":"Peru", - "val":"Nuevo Sol" + "val":"Sol (Nuevo Sol)" }, { "key":"Suriname", - "val":"Surinamese dollar" + "val":"SRD (Surinamese dollar)" }, { "key":"Uruguay", - "val":"Uruguayan Peso" + "val":"$U (Uruguayan Peso)" }, { "key":"Venezuela", - "val":"Bolívar fuerte" + "val":"Bs (Bolívar fuerte)" }], "Oceania": [{ "key":"Australia", - "val":"Australian dollar" + "val":"$ (Australian dollar)" }, { "key":"Fiji", - "val":"Fijian dollar" + "val":"$ (Fijian dollar)" }, { "key":"New Zealand", - "val":"New Zealand dollar" + "val":"$ (New Zealand dollar)" }, { "key":"Vanuatu", - "val":"Vanuatu Vatu" + "val":"VT (Vanuatu Vatu)" }, { "key":"American Samoa", - "val":"United States dollar" + "val":"$ (United States dollar)" }, { "key":"Cook Islands", - "val":"Cook Islands dollar" + "val":"$ (Cook Islands dollar)" }], "Antartica":[{ "key":"French Southern Territories", - "val":"Euro" + "val":"\u20ac (Euro)" }, { "key":"South Georgia and the South Sandwich Islands", - "val":"Pound Sterling" + "val":"\u00a3 (Pound Sterling)" }] } } From 27edc8320bcee625707aece9f49f078c69b88af9 Mon Sep 17 00:00:00 2001 From: Ondrej Galbavy Date: Tue, 27 Oct 2015 20:04:45 +0100 Subject: [PATCH 134/379] Add Slovak cheat sheet --- share/goodie/cheat_sheets/json/slovak.json | 240 +++++++++++++++++++++ 1 file changed, 240 insertions(+) create mode 100644 share/goodie/cheat_sheets/json/slovak.json diff --git a/share/goodie/cheat_sheets/json/slovak.json b/share/goodie/cheat_sheets/json/slovak.json new file mode 100644 index 000000000..1938d6b0e --- /dev/null +++ b/share/goodie/cheat_sheets/json/slovak.json @@ -0,0 +1,240 @@ +{ + "id" : "slovak_cheat_sheet", + "name" : "Slovak Cheat Sheet", + "metadata" : { + "sourceName" : "Linguanaut", + "sourceUrl" : "http://www.linguanaut.com/english_slovak.htm" + }, + "aliases": [ + "slovak phrases", "english to slovak", "basic slovak phrases", "basic slovak" + ], + "template_type": "reference", + "section_order" : [ + "Basics", + "Getting Help", + "Travelling", + "Etiquette", + "Dinner on the Town" + ], + "description" : "Basic Slovak words and phrases", + "sections" : { + "Etiquette" : [ + { + "val" : "Dobrú noc", + "key" : "Good night" + }, + { + "val" : "Dobrý deň", + "key" : "Good afternoon" + }, + { + "val" : "Dobrý večer", + "key" : "Good evening" + }, + { + "val" : "Ospravedlňujem sa", + "key" : "I'm sorry." + }, + { + "val" : "Ďakujem", + "key" : "Thank you" + }, + { + "val" : "Prosím", + "key" : "Please" + }, + { + "val" : "Veľmi vám ďakujem", + "key" : "Thank you very much!" + }, + { + "val" : "Dobré ráno", + "key" : "Good morning" + }, + { + "val" : "Nemáte za čo", + "key" : "You're welcome" + } + ], + "Getting Help" : [ + { + "val" : "Zavolajte políciu!", + "key" : "Call the police!" + }, + { + "val" : "Prosím, hovorte pomalšie!", + "key" : "Please speak more slowly!" + }, + { + "val" : "Som alergický.", + "key" : "I am allergic. (male)" + }, + { + "val" : "Som alergická.", + "key" : "I am allergic. (female)" + }, + { + "val" : "Zopakujte to, prosím.", + "key" : "Repeat, please." + }, + { + "val" : "Ako sa po slovensky povie \"X\"?", + "key" : "How do you say \"X\" in Slovak?" + }, + { + "val" : "Stojte!", + "key" : "Stop!" + }, + { + "val" : "Hovoríte po anglicky?", + "key" : "Do you speak English?" + }, + { + "val" : "Prepáčte!", + "key" : "Excuse me!" + }, + { + "val" : "Potrebujem doktora!", + "key" : "I need a doctor!" + }, + { + "val" : "Môžete to napísať, prosím?", + "key" : "Can you write that down, please?" + }, + { + "val" : "Zavolajte sanitku!", + "key" : "Call an ambulance!" + }, + { + "val" : "Som v nebezpečí!", + "key" : "I am in danger!" + }, + { + "val" : "Môžete mi pomôcť?", + "key" : "Can you help me?" + }, + { + "val" : "Horí!", + "key" : "Fire!" + } + ], + "Basics" : [ + { + "val" : "Volám sa...", + "key" : "My name is..." + }, + { + "val" : "Mám sa fajn, ďakujem!", + "key" : "I'm fine, thanks!" + }, + { + "val" : "Ako sa máte?", + "key" : "How are you?" + }, + { + "val" : "Ahoj", + "key" : "Hello" + }, + { + "val" : "Vitajte", + "key" : "Welcome" + }, + { + "val" : "Ako sa voláte?", + "key" : "What's your name?" + } + ], + "Travelling" : [ + { + "val" : "Zatočiť doľava.", + "key" : "Turn left." + }, + { + "val" : "Kde je východ?", + "key" : "Where is the exit?" + }, + { + "val" : "Kde?", + "key" : "Where?" + }, + { + "val" : "Je to ďaleko?", + "key" : "Is it far?" + }, + { + "val" : "Choďte rovno.", + "key" : "Go straight ahead." + }, + { + "val" : "Máte mapu mesta?", + "key" : "Do you have a city map?" + }, + { + "val" : "Zastavte tu, prosím.", + "key" : "Stop here please." + }, + { + "val" : "Zatočiť doprava.", + "key" : "Turn right." + }, + { + "val" : "Kde môžem nájsť taxi?", + "key" : "Where can I find the taxis?" + }, + { + "val" : "Ako môžem zavolať taxi?", + "key" : "How can I get a taxi?" + } + ], + "Dinner on the Town" : [ + { + "val" : "Máte vegetariánske jedlá?", + "key" : "Do you have vegetarian dishes?" + }, + { + "val" : "Hlavný chod", + "key" : "Main dish" + }, + { + "val" : "Predkrm", + "key" : "Entrée" + }, + { + "val" : "Som alergický.", + "key" : "I am allergic." + }, + { + "val" : "Dezert", + "key" : "Dessert" + }, + { + "val" : "Účet prosím!", + "key" : "The check please!" + }, + { + "val" : "Šálok kávy, prosím.", + "key" : "A cup of coffee please." + }, + { + "val" : "Máte bezlepkové jedlo?", + "key" : "Do you have gluten-free dishes?" + }, + { + "val" : "Kde nájdem dobrú reštauráciu?", + "key" : "Where is a good restaurant?" + }, + { + "val" : "Prosím si pohár vody.", + "key" : "A glass of water please." + }, + { + "val" : "Stôl pre dvoch, prosím.", + "key" : "A table for two please!" + }, + { + "val" : "Môžete mi priniesť jedálny lístok, prosím?", + "key" : "Can I get a menu, please?" + } + ] + } +} From 0a76e9091ffbada94b4ffc80d1dcf4989cd31672 Mon Sep 17 00:00:00 2001 From: rathoreanirudh Date: Tue, 24 Nov 2015 19:34:27 +0000 Subject: [PATCH 135/379] slight changes php cheat_sheet --- share/goodie/cheat_sheets/json/php.json | 40 +++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 share/goodie/cheat_sheets/json/php.json diff --git a/share/goodie/cheat_sheets/json/php.json b/share/goodie/cheat_sheets/json/php.json new file mode 100644 index 000000000..99247a0fc --- /dev/null +++ b/share/goodie/cheat_sheets/json/php.json @@ -0,0 +1,40 @@ +{ + "id": "php_cheat_sheet", + "name": "php", + "description": "server_side_scripting_language", + "template_type": "code", + "section_order": [ + "php array functions" + ], + "sections": { + "php array functions": [{ + "val": "values present in arr1 but not in other arguments", + "key": "array_diff(arr1,arr2,..)" + }, { + "val": "flipped array on success else null", + "key": "array_flip(arr)" + }, { + "val": "values present in arr1 and in other arguments", + "key": "array_intersect(arr1,arr2,..)" + }, { + "val": "merge one or more arrays", + "key": "array_merge(arr1,arr2,..)" + }, { + "val": "pop the element off the end of array", + "key": "array_pop(arr)" + }, { + "val": "push one or more elements onto the end of array", + "key": "array_push(arr,var1,var2,..)" + }, { + "val": "reverse array elements", + "key": "array_reverse(arr)" + }, { + "val": "count all elements in array", + "key": "count(arr)" + }, { + "val": "searches for needle in arr and returns key", + "key": "array_search(needle,arr)" + }] + + } +} \ No newline at end of file From 5a13ac6310b6055290a4de56338639f971f2e20f Mon Sep 17 00:00:00 2001 From: Mailkov Date: Tue, 24 Nov 2015 20:48:51 +0000 Subject: [PATCH 136/379] Issue #1491 - convert into JS powered goodie --- lib/DDG/Goodie/Chess960.pm | 35 +++++---- share/goodie/chess960/chess960.css | 10 +-- share/goodie/chess960/chess960.js | 94 ++++++++++++++++++++++++ share/goodie/chess960/content.handlebars | 15 ++++ t/Chess960.t | 28 +++---- 5 files changed, 151 insertions(+), 31 deletions(-) create mode 100644 share/goodie/chess960/chess960.js create mode 100644 share/goodie/chess960/content.handlebars diff --git a/lib/DDG/Goodie/Chess960.pm b/lib/DDG/Goodie/Chess960.pm index 7038ad06c..26ef71301 100644 --- a/lib/DDG/Goodie/Chess960.pm +++ b/lib/DDG/Goodie/Chess960.pm @@ -3,7 +3,6 @@ package DDG::Goodie::Chess960; use strict; use DDG::Goodie; -with 'DDG::GoodieRole::Chess'; triggers any => 'random', 'chess960'; zci is_cached => 0; @@ -12,6 +11,7 @@ zci answer_type => 'chess960_position'; primary_example_queries 'chess960 random'; description 'Generates a random starting position for Chess960'; topics 'gaming', 'entertainment'; +code_url "https://github.com/duckduckgo/zeroclickinfo-goodies/blob/master/lib/DDG/Goodie/Chess960.pm"; category 'random'; attribution github => 'https://github.com/koosha--', twitter => 'https://twitter.com/_koosha_'; @@ -116,13 +116,6 @@ RBKRNQBN RKRBNQBN RKRNQBBN RKRNQNBB BBRKRNNQ BRKBRNNQ BRKRNBNQ BRKRNNQB RBBKRNNQ RKBRNBNQ RKBRNNQB RBKRBNNQ RKRBBNNQ RKRNBBNQ RKRNBNQB RBKRNNBQ RKRBNNBQ RKRNNBBQ RKRNNQBB ); -sub make_fen { - my ($position) = @_; - my ($position_lc) = lc$position; - my ($fen) = "${position_lc}/pppppppp/8/8/8/8/PPPPPPPP/${position}"; - return parse_position($fen); -} - handle query => sub { # Ensure rand is seeded for each process srand(); @@ -136,13 +129,29 @@ handle query => sub { my $position = $all_positions[$index]; - my @fen = make_fen($position); - my $position_num = $index + 1; - - my $html = draw_chessboard_html(@fen); + $query =~ s/^ chess960|chess960 $|chess960 //i; - return draw_chessboard_ascii(@fen), html => $html, heading => "Position $position_num (Chess960)"; + + return 'Chess 960', + structured_answer => { + id => 'chess960', + name => 960, + data => { + title => 'Chess960', + subtitle => 'Position ' . $position_num, + rows => 8, + columns => 8, + position => $position + }, + templates => { + group => 'text', + item => 0, + options => { + content => 'DDH.chess960.content' + } + } + }; }; 1; diff --git a/share/goodie/chess960/chess960.css b/share/goodie/chess960/chess960.css index 0261fb79c..8259f1cd7 100644 --- a/share/goodie/chess960/chess960.css +++ b/share/goodie/chess960/chess960.css @@ -1,4 +1,4 @@ -.zci--answer .zci--fenviewer span { +.zci--chess960 .zci--fenviewer span { color:#333; display:block; font-size:27px; @@ -9,8 +9,8 @@ line-height: 1.5; } -.zci--answer .zci--fenviewer .chess_board { border: 2px solid #333; } -.zci--answer .zci--fenviewer .chess_board td { +.zci--chess960 .zci--fenviewer .chess_board { border: 2px solid #333; } +.zci--chess960 .zci--fenviewer .chess_board td { background:#fff; height:40px; text-align:center; @@ -18,7 +18,7 @@ width:40px; } -.zci--answer .zci--fenviewer .chess_board tr:nth-child(odd) td:nth-child(even), -.zci--answer .zci--fenviewer .chess_board tr:nth-child(even) td:nth-child(odd) { +.zci--chess960 .zci--fenviewer .chess_board tr:nth-child(odd) td:nth-child(even), +.zci--chess960 .zci--fenviewer .chess_board tr:nth-child(even) td:nth-child(odd) { background-color: #ddd; } \ No newline at end of file diff --git a/share/goodie/chess960/chess960.js b/share/goodie/chess960/chess960.js new file mode 100644 index 000000000..b0e464225 --- /dev/null +++ b/share/goodie/chess960/chess960.js @@ -0,0 +1,94 @@ +DDH.chess960 = DDH.chess960 || {}; + +DDH.chess960.build = function(ops) { + // Global Variables Declaration + var $tempChessboard, $container; + var squares, started; + var scheme = []; + var letters = ["H", "G", "F", "E", "D", "C", "B", "A"]; + var position = ops.data.position; + + for (var i = 0; i + + + {{#loop rows}} + + {{#loop columns}} + + {{/loop}} + + {{/loop}} +
+ +
+ + diff --git a/t/Chess960.t b/t/Chess960.t index 576d4f21e..1e560d2ca 100644 --- a/t/Chess960.t +++ b/t/Chess960.t @@ -12,19 +12,21 @@ ddg_goodie_test( [qw( DDG::Goodie::Chess960 )], - map { - $_ => test_zci(qr/^[qrkbn]{1,8} -pppppppp - - - - - -- - - - - - - - - -- - - - -PPPPPPPP -[QRBKN]{1,8}$/, - html => qr/^
(( + {{/loop}} +
.*<\/span><\/td>){1,8}<\/tr>){1,8}<\/table><\/div>$/, - heading => qr/^Position \d+ \(Chess960\)$/, - ) - } ('random chess960 position', 'chess960 random') + 'chess960 random' => test_zci( + 'Chess 960', + structured_answer => { + data => '-ANY-', + id => "chess960", + name => 960, + templates => { + group => "text", + item => 0, + options => { + content => "DDH.chess960.content" + }, + } + } + ) ); done_testing; From e7ba4747ee27898b5bb4160ef3c10c05e2187198 Mon Sep 17 00:00:00 2001 From: Zach Thompson Date: Tue, 24 Nov 2015 14:29:18 -0700 Subject: [PATCH 137/379] Remove Shortcut which doesn't have an IA page and is no longer in service (related to spice alt_to work) --- lib/DDG/Goodie/Shortcut.pm | 68 -------------------------------------- 1 file changed, 68 deletions(-) delete mode 100644 lib/DDG/Goodie/Shortcut.pm diff --git a/lib/DDG/Goodie/Shortcut.pm b/lib/DDG/Goodie/Shortcut.pm deleted file mode 100644 index 71d5d1e53..000000000 --- a/lib/DDG/Goodie/Shortcut.pm +++ /dev/null @@ -1,68 +0,0 @@ -package DDG::Goodie::Shortcut; -# ABSTRACT: Display keyboard shortcut for an action. - -use strict; -use DDG::Goodie; -use utf8; -use Text::Trim; - -triggers any => 'shortcut','keyboard shortcut', 'key combination'; - -zci answer_type => 'shortcut'; -zci is_cached => 1; - -primary_example_queries 'windows show desktop shortcut'; -secondary_example_queries 'ubuntu shortcut new folder'; -description 'Keyboard shortcuts'; -name 'Shortcut'; -topics 'computing'; -category 'computing_info'; -attribution github => ['dariog88a','Darío'], - email => [ 'dariog88@gmail.com', 'Darío' ], - twitter => ['dariog88', 'Darío']; - -my @shortcuts = share('shortcuts.csv')->slurp(iomode => '<:encoding(UTF-8)'); - -handle remainder_lc => sub { - #keep only letters and spaces (remove versioning) - s/[^a-z ]//gi; - #replace all OS words with starting char - s/windows|win|xp|vista|seven|eight/W/gi; - s/mac|os[ ]*x/M/gi; - s/linux|ubuntu|debian|fedora|kde|gnome/L/gi; - - #get OS char (if any) - my $search = $_; - $search =~ /(W|M|L)/; - my $os = $1; #save OS char - $search =~ tr/[WML]//d; #remove all OS chars from search - $search =~ tr/ / /s; #leave just one blank between words - $search = trim $search; #trim - -if(!$os) {$os='';} #line added to avoid error, remove when UA detection added. - - my $line; - foreach (@shortcuts) { - if($_ =~ /^$search/i) { #matches only the start - $line = $_; - $line =~ s/\R//g; #remove carriage return - last; - } - } - - return if !$line; - - my @columns = split('\|',$line); - my $answer = 'The shortcut for ' . $columns[0]; - my %systems = (W=>'Windows',M=>'Mac OS',L=>'KDE/GNOME'); - my %keys = (W => $columns[1], M => $columns[2], L => $columns[3]); - - return if !$keys{$os}; - - if ($os) { $answer .= ' in ' . $systems{$os} . ' is ' . $keys{$os}; } - - my $source = '
More at Wikipedia'; - return $answer, html => "$answer $source"; -}; - -1; From 6513110f1b262dd470266b2cb183286b6b5f0de3 Mon Sep 17 00:00:00 2001 From: jonk1993 Date: Wed, 25 Nov 2015 02:13:30 +0000 Subject: [PATCH 138/379] created cheat sheet for starcraft 2 cheat codes --- .../goodie/cheat_sheets/json/starcraft2.json | 118 ++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 share/goodie/cheat_sheets/json/starcraft2.json diff --git a/share/goodie/cheat_sheets/json/starcraft2.json b/share/goodie/cheat_sheets/json/starcraft2.json new file mode 100644 index 000000000..afbca3459 --- /dev/null +++ b/share/goodie/cheat_sheets/json/starcraft2.json @@ -0,0 +1,118 @@ +{ + "id": "starcraft2_cheat_sheet", + "name": "Starcraft 2 Cheat Sheet", + "description": "Cheat codes for the campaign and offline custom games of Starcraft 2", + "metadata": { + "sourceName": "Battle.net Cheats", + "sourceUrl": "http://us.battle.net/sc2/en/blog/9135373/game-guide-starcraft-ii-cheat-codes-3-1-2012" + }, + "aliases": [ + "starcraft2", + "starcraft 2", + "sc2" + ], + "template_type": "reference", + "section_order": ["Resources and Research", "Units", "Game Modifications", "Wings of Liberty Only"], + "sections": { + "Units": [ + { + "key": "TerribleTerribleDamage", + "val": "Units enter God Mode" + }, + { + "key": "MoreDotsMoreDots", + "val": "All units and buildings are free to build (No cost)" + }, + { + "key": "ImADoctorNotARoachJim", + "val": "Enable fast unit healing" + }, + { + "key": "HanShotFirst", + "val": "Disable cooldown on spells" + } + ], + "Resources and Research": [ + { + "key": "SpectralTiger", + "val": "5,000 minerals" + }, + { + "key": "RealMenDrillDeep", + "val": "5,000 gas" + }, + { + "key": "Jaynestown", + "val": "5,000 Terrazine on custom maps using Terrazine" + }, + { + "key": "WhoRunBartertown", + "val": "5,000 of each resource" + }, + { + "key": "IAmIronMan", + "val": "Instantly allows all upgrades" + }, + { + "key": "SoSayWeAll", + "val": "Allows the use of all tech" + }, + { + "key": "CatFoodForPrawnGuns", + "val": "Enables fast building and fast upgrades" + }, + { + "key": "Bunker55AliveInside", + "val": "Disables the need for supplies (Food)" + } + ], + "Game Modifications": [ + { + "key": "TookTheRedPill", + "val": "Disable fog of war" + }, + { + "key": "NeverGiveUpNeverSurrender", + "val": "Disable defeat conditions" + }, + { + "key": "TyuHasLeftTheGame", + "val": "Disable victory conditions to allow continued play" + }, + { + "key": "WhatIsBestInLife", + "val": "Win current game" + }, + { + "key": "LetsJustBugOutAndCallItEven", + "val": "Lose current game" + }, + { + "key": "OverEngineeredCodPiece", + "val": "Plays the Level 80 Elite Tauren Chieftain (Blizzard employee band) song 'Terran up the Night'" + } + ], + "Wings of Liberty Only": [ + { + "key": "WhySoSerious", + "val": "Adds 5,000,000 credits" + }, + { + "key": "LeaveYourSleep", + "val": "Opens all missions" + }, + { + "key": "horadriccube", + "val": "Opens all research options" + }, + { + "key": "EyeOfSauron", + "val": "Allows access to all cinematics" + }, + { + "key": "StayClassyMarsara", + "val": "Allows access to all UNN broadcasts" + } + ] + } +} \ No newline at end of file From dd87b051561b8467585d2dae63db99ba8940c257 Mon Sep 17 00:00:00 2001 From: jonk1993 Date: Wed, 25 Nov 2015 02:25:28 +0000 Subject: [PATCH 139/379] added new line to starcraft2.json --- share/goodie/cheat_sheets/json/starcraft2.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/goodie/cheat_sheets/json/starcraft2.json b/share/goodie/cheat_sheets/json/starcraft2.json index afbca3459..56570b77d 100644 --- a/share/goodie/cheat_sheets/json/starcraft2.json +++ b/share/goodie/cheat_sheets/json/starcraft2.json @@ -115,4 +115,4 @@ } ] } -} \ No newline at end of file +} From 56621d6fafcd56953ca8b297613b90ea5f0a7c8c Mon Sep 17 00:00:00 2001 From: JOBIN PHILIP ABRAHAM Date: Wed, 25 Nov 2015 12:26:23 +0530 Subject: [PATCH 140/379] Update drush.json added alias --- share/goodie/cheat_sheets/json/drush.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/share/goodie/cheat_sheets/json/drush.json b/share/goodie/cheat_sheets/json/drush.json index 81a7694ad..329a2ece0 100644 --- a/share/goodie/cheat_sheets/json/drush.json +++ b/share/goodie/cheat_sheets/json/drush.json @@ -6,6 +6,9 @@ "sourceName": "Drush Commands", "sourceUrl": "http://drushcommands.com" }, + "aliases": [ + "drush commands" + ], "template_type": "terminal", "section_order": [ "Project manager commands", From a93fd5e1212e50e3a6dd63e3f9cfb00ddc1b7b7a Mon Sep 17 00:00:00 2001 From: JOBIN PHILIP ABRAHAM Date: Wed, 25 Nov 2015 12:34:10 +0530 Subject: [PATCH 141/379] Update gnupg.json modified name and description .Added aliases --- share/goodie/cheat_sheets/json/gnupg.json | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/share/goodie/cheat_sheets/json/gnupg.json b/share/goodie/cheat_sheets/json/gnupg.json index c6fb7a57b..e4c26e442 100644 --- a/share/goodie/cheat_sheets/json/gnupg.json +++ b/share/goodie/cheat_sheets/json/gnupg.json @@ -1,13 +1,14 @@ { "id": "gnupg_cheat_sheet", - "name": "GnuPG", - "description": "GNU Privacy Guard is the GNU project's free software implementation of the OpenPGP standard.", + "name": "GNU Privacy Guard", + "description": "GNU project's free software implementation of OpenPGP standard.", "metadata": { "sourceName": "GnuPG man page", "sourceUrl": "https://www.gnupg.org/documentation/manpage.en.html" }, "aliases": [ - "gpg" + "gpg", + "gnu privacy guard" ], "template_type": "terminal", "section_order": [ From a41436aa05222f6a3b1f87e36fce7d2bfd6dce2e Mon Sep 17 00:00:00 2001 From: JOBIN PHILIP ABRAHAM Date: Wed, 25 Nov 2015 12:36:27 +0530 Subject: [PATCH 142/379] Update gnupg.json --- share/goodie/cheat_sheets/json/gnupg.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/goodie/cheat_sheets/json/gnupg.json b/share/goodie/cheat_sheets/json/gnupg.json index e4c26e442..ea09a0668 100644 --- a/share/goodie/cheat_sheets/json/gnupg.json +++ b/share/goodie/cheat_sheets/json/gnupg.json @@ -3,7 +3,7 @@ "name": "GNU Privacy Guard", "description": "GNU project's free software implementation of OpenPGP standard.", "metadata": { - "sourceName": "GnuPG man page", + "sourceName": "GnuPG", "sourceUrl": "https://www.gnupg.org/documentation/manpage.en.html" }, "aliases": [ From 879d3e60b14944df1e8391600be69344103e109e Mon Sep 17 00:00:00 2001 From: rathoreanirudh Date: Wed, 25 Nov 2015 09:26:16 +0000 Subject: [PATCH 143/379] some more changes --- share/goodie/cheat_sheets/json/php.json | 118 ++++++++++++++++++++---- 1 file changed, 101 insertions(+), 17 deletions(-) diff --git a/share/goodie/cheat_sheets/json/php.json b/share/goodie/cheat_sheets/json/php.json index 99247a0fc..c6bb4560b 100644 --- a/share/goodie/cheat_sheets/json/php.json +++ b/share/goodie/cheat_sheets/json/php.json @@ -1,40 +1,124 @@ { "id": "php_cheat_sheet", - "name": "php", - "description": "server_side_scripting_language", + "name": "PHP", + "description": "List of common php functions", "template_type": "code", "section_order": [ - "php array functions" + "php array functions", + "php string functions", + "regular expressions syntax" ], "sections": { "php array functions": [{ - "val": "values present in arr1 but not in other arguments", - "key": "array_diff(arr1,arr2,..)" + "val": "values present in first argument but not in other arguments", + "key": "array_diff()" }, { "val": "flipped array on success else null", - "key": "array_flip(arr)" + "key": "array_flip()" }, { - "val": "values present in arr1 and in other arguments", - "key": "array_intersect(arr1,arr2,..)" + "val": "values present in first argument and in other arguments", + "key": "array_intersect()" }, { - "val": "merge one or more arrays", - "key": "array_merge(arr1,arr2,..)" + "val": "merge one or more arrays in the first argument", + "key": "array_merge()" }, { "val": "pop the element off the end of array", - "key": "array_pop(arr)" + "key": "array_pop()" }, { "val": "push one or more elements onto the end of array", - "key": "array_push(arr,var1,var2,..)" + "key": "array_push()" }, { "val": "reverse array elements", - "key": "array_reverse(arr)" + "key": "array_reverse()" }, { "val": "count all elements in array", - "key": "count(arr)" + "key": "count()" }, { - "val": "searches for needle in arr and returns key", - "key": "array_search(needle,arr)" + "val": "searches for needle in array and returns key", + "key": "array_search()" + }], + "php string functions":[{ + "val": "return part of a string", + "key": "substr()" + }, { + "val": "output one or more string", + "key": "echo" + }, { + "val": "position of first occurrence of case insensitive substring", + "key": "strpos()" + }, { + "val": "make string lowercase", + "key": "strtolower()" + }, { + "val": "make string uppercase", + "key": "strtoupper()" + }, { + "val": "reverse a string", + "key": "strrev()" + }, { + "val": "returns string length", + "key": "strlen()" + }, { + "val": "convert a string to array", + "key": "str_split()" + }, { + "val": "binary safe string comparison", + "key": "strcmp()" + }, { + "val": "translate characters or replace substrings", + "key": "strtr()" + }, { + "val": "output a string", + "key": "print" + }], + "regular expressions syntax":[{ + "val": "start of string", + "key": "^" + }, { + "val": "end of string", + "key": "$" + }, { + "val": "any single character", + "key": "." + }, { + "val": "a or b", + "key": "(a|b)" + }, { + "val": "group section", + "key": "(...)" + }, { + "val": "in range (a, b or c)", + "key": "[abc]" + }, { + "val": "not in range", + "key": "[^abc]" + }, { + "val": "zero or one of a", + "key": "a?" + }, { + "val": "zero or more of a", + "key": "a*" + }, { + "val": "zero or more, ungreedy", + "key": "a*?" + }, { + "val": "one or more of a", + "key": "a+" + }, { + "val": "one or more, ungreedy", + "key": "a+?" + }, { + "val": "exactly 3 of a", + "key": "a{3}" + }, { + "val": "3 or more of a", + "key": "a{3,}" + }, { + "val": "up to 6 a", + "key": "a{,6}" + }, { + "val": "3 to 6 of a", + "key": "a{3,6}" }] - } } \ No newline at end of file From a9946d2a6b7089b38f80d52c1824e4c6842d237c Mon Sep 17 00:00:00 2001 From: JOBIN PHILIP ABRAHAM Date: Wed, 25 Nov 2015 20:02:34 +0530 Subject: [PATCH 144/379] Update chrome.json updated name and description --- share/goodie/cheat_sheets/json/chrome.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/goodie/cheat_sheets/json/chrome.json b/share/goodie/cheat_sheets/json/chrome.json index fc0e7f036..5dda05892 100644 --- a/share/goodie/cheat_sheets/json/chrome.json +++ b/share/goodie/cheat_sheets/json/chrome.json @@ -1,9 +1,9 @@ { "id": "chrome_cheat_sheet", - "name": "Chrome", + "name": " Google Chrome", - "description": "Web Browser by Google", + "description": "Google Chrome Keyboard shorcuts", "metadata": { "sourceName": "Chrome Help", From fe28670021d21eb200b2282e43be8f769d037df2 Mon Sep 17 00:00:00 2001 From: JOBIN PHILIP ABRAHAM Date: Wed, 25 Nov 2015 20:08:27 +0530 Subject: [PATCH 145/379] Update chrome.json --- share/goodie/cheat_sheets/json/chrome.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/goodie/cheat_sheets/json/chrome.json b/share/goodie/cheat_sheets/json/chrome.json index 5dda05892..a3f96347d 100644 --- a/share/goodie/cheat_sheets/json/chrome.json +++ b/share/goodie/cheat_sheets/json/chrome.json @@ -1,7 +1,7 @@ { "id": "chrome_cheat_sheet", - "name": " Google Chrome", + "name": "Google Chrome", "description": "Google Chrome Keyboard shorcuts", From ae4fb2f927062e2c4db38030b8af0068b1030cf6 Mon Sep 17 00:00:00 2001 From: JOBIN PHILIP ABRAHAM Date: Wed, 25 Nov 2015 20:21:26 +0530 Subject: [PATCH 146/379] Update chrome.json --- share/goodie/cheat_sheets/json/chrome.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/share/goodie/cheat_sheets/json/chrome.json b/share/goodie/cheat_sheets/json/chrome.json index a3f96347d..cd3c0ac21 100644 --- a/share/goodie/cheat_sheets/json/chrome.json +++ b/share/goodie/cheat_sheets/json/chrome.json @@ -11,7 +11,10 @@ }, "aliases": [ - "google chrome" + "google chrome", + "chrome keyboard shortcuts", + "google chrome keyboard shortcuts", + "chrome shortcuts" ], "template_type": "keyboard", From 74146391940a6c628aa8bb03f9fdd5ae3131c0d1 Mon Sep 17 00:00:00 2001 From: Zaahir Moolla Date: Wed, 25 Nov 2015 14:04:43 -0500 Subject: [PATCH 147/379] remove extra single quote, comment out tempaltes block to prevent overwriting Perl by default --- template/share/goodie/example/example.js | 28 ++++++++++++------------ 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/template/share/goodie/example/example.js b/template/share/goodie/example/example.js index 3a114c126..627d2adc9 100644 --- a/template/share/goodie/example/example.js +++ b/template/share/goodie/example/example.js @@ -1,9 +1,9 @@ -DDH.'<: $lia_id :>' = DDH.'<: $lia_id :>' || {}; +DDH.<: $lia_id :> = DDH.<: $lia_id :> || {}; (function(DDH) { "use strict"; - console.log("DDH.'<: $lia_id :>'.build"); // remove this before submitting pull request + console.log("DDH.<: $lia_id :>.build"); // remove this before submitting pull request // define private variables and functions here // @@ -13,7 +13,7 @@ DDH.'<: $lia_id :>' = DDH.'<: $lia_id :>' || {}; // b = '', // c = ''; - DDH.'<: $lia_id :>'.build = function(ops) { + DDH.<: $lia_id :>.build = function(ops) { return { @@ -40,17 +40,17 @@ DDH.'<: $lia_id :>' = DDH.'<: $lia_id :>' || {}; // }; // }, - templates: { - group: 'text', - - // options: { - // - // }, - - // variants: { - // - // } - }, + // templates: { + // group: 'text', + // + // options: { + // + // }, + // + // variants: { + // + // } + // }, // Function that executes after template content is displayed onShow: function() { From 1f17140b3ef6fc322c1e971e253c15c02b0b5f5d Mon Sep 17 00:00:00 2001 From: Mailkov Date: Thu, 26 Nov 2015 18:33:34 +0000 Subject: [PATCH 148/379] Issue #1595 - Add images and set template --- lib/DDG/Goodie/Zodiac.pm | 18 ++++++++++++++---- share/goodie/zodiac/aries.png | Bin 0 -> 496 bytes share/goodie/zodiac/cancer.png | Bin 0 -> 689 bytes share/goodie/zodiac/capricornus.png | Bin 0 -> 511 bytes share/goodie/zodiac/gemini.png | Bin 0 -> 746 bytes share/goodie/zodiac/leo.png | Bin 0 -> 497 bytes share/goodie/zodiac/libra.png | Bin 0 -> 408 bytes share/goodie/zodiac/pisces.png | Bin 0 -> 568 bytes share/goodie/zodiac/sagittarius.png | Bin 0 -> 544 bytes share/goodie/zodiac/scorpio.png | Bin 0 -> 708 bytes share/goodie/zodiac/taurus.png | Bin 0 -> 504 bytes share/goodie/zodiac/virgo.png | Bin 0 -> 478 bytes 12 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 share/goodie/zodiac/aries.png create mode 100644 share/goodie/zodiac/cancer.png create mode 100644 share/goodie/zodiac/capricornus.png create mode 100644 share/goodie/zodiac/gemini.png create mode 100644 share/goodie/zodiac/leo.png create mode 100644 share/goodie/zodiac/libra.png create mode 100644 share/goodie/zodiac/pisces.png create mode 100644 share/goodie/zodiac/sagittarius.png create mode 100644 share/goodie/zodiac/scorpio.png create mode 100644 share/goodie/zodiac/taurus.png create mode 100644 share/goodie/zodiac/virgo.png diff --git a/lib/DDG/Goodie/Zodiac.pm b/lib/DDG/Goodie/Zodiac.pm index e7b57d8d4..fb50bd5d8 100644 --- a/lib/DDG/Goodie/Zodiac.pm +++ b/lib/DDG/Goodie/Zodiac.pm @@ -30,17 +30,27 @@ handle remainder => sub { # Return Nothing if the User Provided Date is Invalid return unless $zodiacdate; + + #Star Sign + my $zodiacsign = ucfirst(zodiac_date_name($zodiacdate)); # Return the Star Sign - my $result="Zodiac for " . date_output_string($zodiacdate) . ": " . ucfirst(zodiac_date_name($zodiacdate)); + my $result="Zodiac for " . date_output_string($zodiacdate) . ": " . $zodiacsign; # Input String my $input = date_output_string($zodiacdate); return $result, structured_answer => { - input => [html_enc($input)], - operation => 'Zodiac', - result => html_enc(ucfirst(zodiac_date_name($zodiacdate))) + id => "zodiac", + name => "Zodiac", + data => { + image => "/share/goodie/zodiac/" . lc($zodiacsign) . ".png", + title => $zodiacsign, + subtitle => $input + }, + templates => { + group => "icon", + } }; }; diff --git a/share/goodie/zodiac/aries.png b/share/goodie/zodiac/aries.png new file mode 100644 index 0000000000000000000000000000000000000000..d5b5878e2d249d18153dd2c8f97cde93e119a25a GIT binary patch literal 496 zcmV z*DTGQ6Xnkf3IGZ|D*xLRFjNEG0XIc?(gjUy9$^z-fM!vCY-=&ji{%^wCPw+O%c@6o ztvhTD7Dsu~5;L{8&>eOJ3!*&PUpMfF&0G)o$(B)mZ0dLiM%YC^0AH48+U#p{d%Md3 z04%U)ln<9F+AWcd?Hn7Wu!q}pSG4CN8~dV_<5zBekV75s1n0WOW8U?n#)c{=-u;o4 zF<7X9;mYnO&-=tDZnbG-o=A`wI?4)eCqwFR}3e#oPDSfzR z^I@d$v#gGZ6n?R;>86;ccugaP?MUa=Bctwps$r`VS#9&MjyF0000uHK}r=1k+qAWZBc4ccC|edKWtKC+i1?PCR(ffq~` z12By@!5LPuza#8vI8KW4Y=}?H9f>jR=SMu`829_g4`}+qNA7csXYj2(j1h@N48sah zmNgt}(&)v!MjOm%b4D+wbgJc|JY$*P8Vmr~8#;xP6Qrotez@plL4``5FAJj2igf+4coIV#4Ue0pL{|w7$l* zm=~1wf`yG0|FM;Kz@AaeIDT-Q*`m#%avTzE=5)8=#)u*o#r4rxl3KHn!7CB{ymN`RunU{G1B1vu3NubH0|b@qAa%< zid!O=ufh3t@u9Nbx1-CzH<1f4Mf#6!=Xh6n!aGLzK^@fmV7PZY<|@b8);#Gi3L=-k z!T6EM1mN$;WhD69t2T*}tm{>OgOQQTa}rHQMF|eqka#X~`A$z~7VjrxIa5#HMJ_+; z?KR8AAS~xqz5N)uJP2q?)T|c+u$~&dQ+qISIS5d5xTgT`!~nbvc*@~wfCD3!g(coH zuGKt>zX#nwk6O)m-jY~2@_A3e00000NkvXXu0mjfN?TN~ literal 0 HcmV?d00001 diff --git a/share/goodie/zodiac/capricornus.png b/share/goodie/zodiac/capricornus.png new file mode 100644 index 0000000000000000000000000000000000000000..9c8271424f258aa849652a027ed85c370ac8d9ea GIT binary patch literal 511 zcmVZQHipxOP+{s1?<=ZQFV_gJ;|JtKEyQy7oS+`&8$PwLG)__%|ylDRI27 zlv!ek#~l>KU>Tb^Lq`?pWb-H%2b+wUwvJ-4o(ULa*(e4pN7zRN&W!w7+js7a&=q|m ze^&Q{Uu@$hlv_LU=XN~kNpNE1&!)bk%KKJ|d|BQ=b&au0JEr>h!j6)#O{**0%PspTiyFOjo+g8wUAaePzDz zlf`;DIo)6*&QB*vbjR+7KO5=>?)HwjIU)i zK2jJctA`?m7u40)+d3HIJI&iKQg~5aRRPJec5tR=OxIAa)U2{ZU8h9@_Vk1w)H)(k zxLSP&Mibnmitec~exkY-TOpd@Dped3DIB7{3!+KR19Xlwu2rkd_0bF`0S=8c?gjkd zExSgu90|rpDp!J^Y!ofBE4V9CISed`R@fMv6R9lcbFe|HpBP*e>AVWgZ&PY}JJQ)( zC3;6IjKt^hSMa!{rduOg002ovPDHLkV1g$_ B?+*X~ literal 0 HcmV?d00001 diff --git a/share/goodie/zodiac/gemini.png b/share/goodie/zodiac/gemini.png new file mode 100644 index 0000000000000000000000000000000000000000..f1e6afb5fb46c3688b53dd31266cd76811fd0ed6 GIT binary patch literal 746 zcmVCcrtuEowPJ!bfJ_6RR!s0)z?YfE zmw@kz30@1hBGb46aBVTcNrv!~v6;qLKVitEVuEv2@S~n z-Ze8{tlp`H0q~@Q)h7)Hc?JMOjtR#4q1mkfiRg&f7~u(NdNr+2u0f|Xa6#-`APsbC zSl7R8Cy!vc_av#{h1h!mzf1C-<#@zSn%6FNr4LmACpl1(Q}JW${)kg0Imn5CiVt16 z=3s{kR$A_5M#giiBn_Z33TOlklC;IQ9jPT+ zcPs_KVAx?q6fgq9IS7E|Q9d+F(g>zT0aHMuB+dDP6D64d#zp~Sz<5a}<_j(Y3;`A< zpHeIU3sF|o*L~u9oVVFJw`=yNi zz{g?w5bT~WxH;$x)2(3Zl(99qHB5bAi+sUZ;QTOM1m>oUx!|Js*Kt<9;OO}7E&&rW zzKbr2AJXW2!3{x2m^#6TlraKyhp7X!M)?5ug!5iV|KMl>_lD^nh@wJ+nMMe@ySQLi zIJ+U!=m}?6alsqHc_U;RH-+UIe>n5Mt>tE cB_$<)0P~2nnbSsnP5=M^07*qoM6N<$f~N>lzyJUM literal 0 HcmV?d00001 diff --git a/share/goodie/zodiac/leo.png b/share/goodie/zodiac/leo.png new file mode 100644 index 0000000000000000000000000000000000000000..6fd28c6983e152f96632dc0f98f91b0ef00fbfca GIT binary patch literal 497 zcmVvZ;>@*2W>R zD7ZjxKv(O=!exD5nAvl&@L0jEdYjd7C&j|zQ*$%I-BybQ&kg3Ss}mwSt2)wE?s4nn z?^35a#Ev$wqIEoMqV8gYOJ*Wj%2n) zBRfnkpMqx`Y*tU&*<+eYGR8iU%R%pUIdgJuSryVoNPD`}^j z%bn nNaQjNHTQm$N~Kb%v_MP%=n!z{gd{J400000NkvXXu0mjf%4+LA literal 0 HcmV?d00001 diff --git a/share/goodie/zodiac/libra.png b/share/goodie/zodiac/libra.png new file mode 100644 index 0000000000000000000000000000000000000000..0c05e7de8c88f7a983f884e0fbac6805c676e1fd GIT binary patch literal 408 zcmV;J0cZY+P)(Q|K=TARBl;vbj1+hR+}$U9%>&@>w%|;-YrWrk?8bjd^?u^XKj#eR z8Z=GQwEqHk$>V^13c34h3JdwE^w$)g0kOmb$G@iV0th1#IQ=z+4g6I3YYHFG2tX}& z4ZjLNV1mQ>#7A04Cz|KKqOch=;E+D*zLf{2kSFZ&l2|Tjr=KHin9HC0uP}{;+KlD>Ma|C~T4PjRK%~^Svy#)v68zsoy-hu;TMlf^Yy*&$1f&_azMJtI0Gc`!Ix0?VpNV>P% z05wRkw~8FL*};}Rxy!{}M{P)_RKIuTk{NnVINK2X=3D0o`(M&xjyZR+|W3Qm{27dc$2zLilh*?RDOL-F@U#}B8Qcd zb7BN~Zu6~mzBDcR_)RHt*baV+KBoEFI$yg@FGk=T$;!wfc_#)i$!tro!W~*Mh$GCG z{2Do|25(2ngO-DJ)=HMR&+*zOImnrwwMoUtk;5YJRg^4K-&2vp_h7xrQLsvVmqrfn zNzRCZFVwZofsw--lBc6!j=DaGJYJBj(u&aWuX-+yJbqMhLlj(Kt6lrdZjr+bef()s z6kKh)om=OS$YGLyz;?;aQF6BVc5IUiBai83I!@PK4mI0Heu|2HJ!*}S{N literal 0 HcmV?d00001 diff --git a/share/goodie/zodiac/sagittarius.png b/share/goodie/zodiac/sagittarius.png new file mode 100644 index 0000000000000000000000000000000000000000..1241633a9bdd539607eb9db5a73226cfbb427546 GIT binary patch literal 544 zcmV+*0^j|KP)j?^KgaGV?{96Y~a-k*ZWGl}c_f z-p5YREh@)#CTnzP%wv!<=7kQ5N--5o)IAokp^4szO7RDnp;s*8B5WCz;ZU>iY$U=k zGu;K-{|g73q2Qk z=w-MXD@EALLN~|1xYa^CL>^9ahhZ^?Cz$6uz2aZ&SJ0eE_zg_3TFL;Q1rCX#7z+-M z6u!kwL!v0)nMmbkG#C9l922RWg_<2E6qFCEloE#~v iWHMfh|F=@9RGJNhuX}& literal 0 HcmV?d00001 diff --git a/share/goodie/zodiac/scorpio.png b/share/goodie/zodiac/scorpio.png new file mode 100644 index 0000000000000000000000000000000000000000..6811128418beff4775702a38b7ca3feb0723d554 GIT binary patch literal 708 zcmV;#0z3VQP)j8x>t-<+4Az97EuFM*urfE>HVDjXKMl$(nWS!6e47Qm7RHeZJK1ZF~O;al6j4lN?1*O6YTG4LB z(kU+lmn0{c)~dD_j>xP&LA{5~9OhQEy;V&cT{frFdZl1>1vmNWrh+OfB*)mIky|H8-B+bfKgG!^Bt`2|xg8TRa{ z&g1`IxUXgNw&qD1WK-{i+%0EW`vy_5n!WAl9J^aqr))YbX?N$?(cV@I;=n>igBH*x zpVqAEXbVNv&1EQlc9VG=>3MbXsqvg6&EqCNW2m{K35TgQQ&wCipD(kjGpRK!if&6h zo0BP|F{l0vwv2KTE3;JZ+2v^ce5)AW>+e{zclRx&%!U77IFCiTe>e5Lf8tkLclR!0 zo*){QR}bE>r^B?%ro#bt_lhnw#&ieZDReoaH(JkQK2@W}ryjL-Z+3qjvE5Sn0Z;y8 z*F*R{9%0qL5 literal 0 HcmV?d00001 diff --git a/share/goodie/zodiac/taurus.png b/share/goodie/zodiac/taurus.png new file mode 100644 index 0000000000000000000000000000000000000000..76c5201a570e3f398616461c958126735be7a3fa GIT binary patch literal 504 zcmVhPXM27T7~6>O~gLG%UhI`CS@WI7yEPb>ub59+8FPHI8t-yuOQU-0QCh zdl+qt;g0r(-jXeKTx6rK&(?P4dWY{luG^QR6* zm~Jt)_}@X1l@88c-!lNc9T>ae3tQY0*;)Ui;{X#J8woT542b;P3YI!661g7medOmc zP$N=sBH;GO&z<0{NWq@wfDXM)Eg6|J$#K9QdTtinT)im$N50Z|HLFw@bIf>*$& uQ3~H%XrgN(1(%p$ny;f!C=?2XGFbz*RglDH$4SNj0000-gHVI@0T?uBFY@jW{43-TPCzyAvl6gesG=W{Fu52JD&w=gKA|GWK z%1NHHpLnu`$lL)Y$sD4viI;4qfC8X903Vn|I}(}-Thg10yrBiBctRt6M=ngQUGKnGF Date: Thu, 26 Nov 2015 21:28:27 +0000 Subject: [PATCH 149/379] Issue #1591 - insert elClass --- lib/DDG/Goodie/Zodiac.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/DDG/Goodie/Zodiac.pm b/lib/DDG/Goodie/Zodiac.pm index fb50bd5d8..15f9b0cdb 100644 --- a/lib/DDG/Goodie/Zodiac.pm +++ b/lib/DDG/Goodie/Zodiac.pm @@ -50,6 +50,9 @@ handle remainder => sub { }, templates => { group => "icon", + elClass => { + iconImage => "bg-clr--blue-light" + } } }; }; From 47dfaa76cce9764773ea1fa2ab65a4e0f72aedd0 Mon Sep 17 00:00:00 2001 From: amitdev Date: Fri, 27 Nov 2015 09:09:37 +0000 Subject: [PATCH 150/379] Fix typos in currency and source URL --- share/goodie/cheat_sheets/json/currency.json | 76 ++++++++++---------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/share/goodie/cheat_sheets/json/currency.json b/share/goodie/cheat_sheets/json/currency.json index 0bd133f61..b9a195c0c 100644 --- a/share/goodie/cheat_sheets/json/currency.json +++ b/share/goodie/cheat_sheets/json/currency.json @@ -4,7 +4,7 @@ "description": "List of countries and their official currencies, organized by continent", "metadata": { "sourceName": "Wikipedia", - "sourceUrl": "https://en.wikipedia.org/wiki/List_of_countries_and_capitals_with_currency_and_language" + "sourceUrl": "https://en.wikipedia.org/wiki/Currency_symbol" }, "template_type": "reference", "section_order": [ @@ -36,11 +36,11 @@ }, { "key": "Cameroon", - "val": "CFA franc" + "val": "CFA Franc" }, { "key": "Egypt", - "val": "£ (Egyptian pound)" + "val": "£ (Egyptian Pound)" }, { "key": "Ethiopia", @@ -48,11 +48,11 @@ }, { "key": "Ghana", - "val": "¢ (Ghana cedi)" + "val": "¢ (Ghana Cedi)" }, { "key": "Kenya", - "val": "Ksh (Kenyan shilling)" + "val": "Ksh (Kenyan Shilling)" }, { "key": "Libya", @@ -60,7 +60,7 @@ }, { "key": "Mali", - "val": "CFA franc" + "val": "CFA Franc" }, { "key": "Nigeria", @@ -68,15 +68,15 @@ }, { "key": "South Africa", - "val": "R (South African rand)" + "val": "R (South African Rand)" }, { "key": "Sudan", - "val": "SDG (Sudanese pound)" + "val": "SDG (Sudanese Pound)" }, { "key": "Uganda", - "val": "Ush (Ugandan shilling)" + "val": "Ush (Ugandan Shilling)" } ], "Asia": [ @@ -86,7 +86,7 @@ }, { "key": "Bahrain", - "val": "BHD (Bahraini dinar)" + "val": "BHD (Bahraini Dinar)" }, { "key": "Bangladesh", @@ -94,15 +94,15 @@ }, { "key": "China", - "val": "¥ (Renminbi or yuan)" + "val": "¥ (Renminbi or Yuan)" }, { "key": "Hong Kong", - "val": "$ (Hong Kong dollar)" + "val": "$ (Hong Kong Dollar)" }, { "key": "India", - "val": "₹ (Indian rupee)" + "val": "₹ (Indian Rupee)" }, { "key": "Japan", @@ -110,7 +110,7 @@ }, { "key": "Kuwait", - "val": "KWD (Kuwaiti dinar)" + "val": "KWD (Kuwaiti Dinar)" }, { "key": "Thailand", @@ -128,7 +128,7 @@ }, { "key": "France", - "val": " (Euro CFP franc)" + "val": "€ (Euro)" }, { "key": "Germany", @@ -144,11 +144,11 @@ }, { "key": "Russia", - "val": "руб (Russian ruble)" + "val": "руб (Russian Ruble)" }, { "key": "Switzerland", - "val": "CHF (Swiss franc)" + "val": "CHF (Swiss Franc)" }, { "key": "Spain", @@ -158,31 +158,31 @@ "North America": [ { "key": "Antigua and Barbuda", - "val": "$ (East Caribbean dollar)" + "val": "$ (East Caribbean Dollar)" }, { "key": "Bahamas", - "val": "$ (Bahamian dollar)" + "val": "$ (Bahamian Dollar)" }, { "key": "Barbados", - "val": "$ (Barbadian dollar)" + "val": "$ (Barbadian Dollar)" }, { "key": "Belize", - "val": "$ (Belize dollar)" + "val": "$ (Belize Dollar)" }, { "key": "Bermuda", - "val": "$ (Bermudian dollar)" + "val": "$ (Bermudian Dollar)" }, { "key": "Canada", - "val": "$ (Canadian dollar)" + "val": "$ (Canadian Dollar)" }, { "key": "Costa Rica", - "val": " (Costa Rican colon)" + "val": " (Costa Rican Colon)" }, { "key": "Cuba", @@ -194,15 +194,15 @@ }, { "key": "El Salvador", - "val": "$ (United States dollar)" + "val": "$ (United States Dollar)" }, { "key": "Guatemala", - "val": "Q (Guatemalan quetzal)" + "val": "Q (Guatemalan Quetzal)" }, { "key": "Jamaica", - "val": "$ (Jamaican dollar)" + "val": "$ (Jamaican Dollar)" }, { "key": "Mexico", @@ -210,11 +210,11 @@ }, { "key": "Panama", - "val": "$ (United States dollar)" + "val": "$ (United States Dollar)" }, { "key": "United States of America", - "val": "$ (United States dollar)" + "val": "$ (United States Dollar)" } ], "South America": [ @@ -240,7 +240,7 @@ }, { "key": "Ecuador", - "val": "$ (United States dollar)" + "val": "$ (United States Dollar)" }, { "key": "Falkland Islands", @@ -252,7 +252,7 @@ }, { "key": "Guyana", - "val": "$ (Guyanese dollar)" + "val": "$ (Guyanese Dollar)" }, { "key": "Paraguay", @@ -264,7 +264,7 @@ }, { "key": "Suriname", - "val": "SRD (Surinamese dollar)" + "val": "SRD (Surinamese Dollar)" }, { "key": "Uruguay", @@ -272,21 +272,21 @@ }, { "key": "Venezuela", - "val": "Bs (Bolívar fuerte)" + "val": "Bs (Bolívar Fuerte)" } ], "Oceania": [ { "key": "Australia", - "val": "$ (Australian dollar)" + "val": "$ (Australian Dollar)" }, { "key": "Fiji", - "val": "$ (Fijian dollar)" + "val": "$ (Fijian Dollar)" }, { "key": "New Zealand", - "val": "$ (New Zealand dollar)" + "val": "$ (New Zealand Dollar)" }, { "key": "Vanuatu", @@ -294,11 +294,11 @@ }, { "key": "American Samoa", - "val": "$ (United States dollar)" + "val": "$ (United States Dollar)" }, { "key": "Cook Islands", - "val": "$ (Cook Islands dollar)" + "val": "$ (Cook Islands Dollar)" } ], "Antartica": [ From d4461f1ddb1cecb4744fbeac8dfdbb8dc152e96b Mon Sep 17 00:00:00 2001 From: JOBIN PHILIP ABRAHAM Date: Fri, 27 Nov 2015 16:45:31 +0530 Subject: [PATCH 151/379] Create 8085.json --- share/goodie/cheat_sheets/json/8085.json | 230 +++++++++++++++++++++++ 1 file changed, 230 insertions(+) create mode 100644 share/goodie/cheat_sheets/json/8085.json diff --git a/share/goodie/cheat_sheets/json/8085.json b/share/goodie/cheat_sheets/json/8085.json new file mode 100644 index 000000000..599ef0df4 --- /dev/null +++ b/share/goodie/cheat_sheets/json/8085.json @@ -0,0 +1,230 @@ +{ + "id": "8085_cheat_sheet", + "name": "8085 Instruction Set", + "description": "8085 instructions and their explanations", + "metadata": { + "sourceName": "IITK", + "sourceUrl": "http://home.iitk.ac.in/~ajalan/8085_is_details.pdf" + }, + "template_type": "reference", + "section_order": [ + "Data Transfer Instructions", + "Arithmetic Instructions", + "Logical Instructions", + "Rotate Instructions", + "Control Transfer Instructions", + "Control Instructions" + ], + "aliases": [ + "8085 instructionset", + "8085 instruction set", + "8085 programming", + "8085 instructions" + ], + "sections": { + "Data Transfer Instructions": [ + { + "key": "MOV Destination, Source", + "val": "Copies a word or byte of data from 'source' to 'destination'" + }, + { + "key": "MVI Destination, 8 bit data", + "val": "Copies the given byte of data to 'destination'" + }, + { + "key": "LDA 16-bit address", + "val": "Loads the 16-bit address in Accumulator" + }, + { + "key": "LXI Reg.Pair, 16-bit data", + "val": "Loads 16-bit data in the register pair " + }, + { + "key": "STA 16-bit address", + "val": "Stores the content of Accumulator in memory location specified by the 16-bit address " + }, + { + "key": "XCHG", + "val": "Contents of register H are exchanged with the contents of register D, and the contents of register L are exchanged with the contents of register E " + }, + { + "key": "LHLD 16-bit address", + "val": "Copies the contents of the memory location pointed out by the 16-bit address into register L and copies the contents of the next memory location into register H" + }, + { + "key": "SHLD 16-bit address", + "val": "Contents of register L are stored into the memory location specified by the 16-bit address in the operand and the contents of H register are stored into the next memory location" + }, + { + "key": "OUT 8-bit port address", + "val": "Contents of the accumulator are copied into the I/O port specified by the operand" + }, + { + "key": "IN 8-bit port address", + "val": "Contents of the input port designated in the operand are read and loaded into the accumulator." + } + ], + "Arithmetic Instructions": [ + { + "key": "ADD R/M", + "val": "Adds the content of register or memory location to the content of Accumulator and put the result in the Accumulator" + }, + { + "key": "SUB R/M", + "val": "Subtracts the content of register or memory location from the content of Accumulator and put the result in the Accumulator" + }, + { + "key": "INX Reg.pair", + "val": "Contents of the designated register pair are incremented by 1 " + }, + { + "key": "DCX Reg.pair", + "val": "Contents of the designated register pair are decremented by 1 " + }, + { + "key": "INR R/M", + "val": "Contents of the designated register or memory location is incremented by one" + }, + { + "key": "DCR R/M", + "val": "Contents of the designated register or memory location is decremented by one" + }, + { + "key": "DAA", + "val": "Decimal Adjust Accumulator" + } + ], + "Logical Instructions": [ + { + "key": "ANA R/M", + "val": "Content of the Accumulator is logically ANDed with the content of the operand" + }, + { + "key": "ANI 8-bit data", + "val": "Content of the Accumulator is logically ANDed with 8-bit data given as the operand" + }, + { + "key": "ORA R/M", + "val": "Content of the Accumulator is logically ORed with the content of the operand" + }, + { + "key": "ORI 8-bit data", + "val": "Content of the Accumulator is logically ANDed with 8-bit data given as the operand" + }, + { + "key": "XRA R/M", + "val": "Content of the Accumulator is Exclusive-ORed with the content of the operand" + }, + { + "key": "XRI 8-bit data", + "val": "Content of the Accumulator is Exclusive-ORed with 8-bit data given as the operand" + }, + { + "key": "CMP R/M", + "val": "Compares the content in the register or memory location with content in Accumulator" + }, + { + "key": "CPI 8-bit data", + "val": "Compares the 8-bit data given as the operand with content in Accumulator" + } + ], + "Rotate Instructions": [ + { + "key": "RCL", + "val": "Rotates each bits in the Accumulator to the left once.MSB is circled back into the LSB and CF contains a copy of the bit most recently moved out of the MSB" + }, + { + "key": "RCR", + "val": "Rotates each bits in the Accumulator to the right once.LSB is circled back into the MSB and CF contains a copy of the bit most recently moved out of the LSB" + }, + { + "key": "RAL", + "val": "Rotate accumulator left through carry" + }, + { + "key": "RAR", + "val": "Rotate accumulator right through carry" + }, + { + "key": "SHL Destination, Count", + "val": "Shifts each bit in the 'destination' to the left 'count' number of times and a 0 is put in the LSB position for each shift" + }, + { + "key": "SHR Destination, Count", + "val": "Shifts each bit in the 'destination' to the right 'count' number of times and a 0 is put in the MSB position for each shift" + } + ], + "Control Transfer Instructions": [ + { + "key": "JMP 16-bit address", + "val": "Unconditional jump to the specified 16-bit address" + }, + { + "key": "JC 16-bit address", + "val": "Jump to the specified 16-bit address if carry flag is set" + }, + { + "key": "JZ 16-bit address", + "val": "Jump to the specified 16-bit address if zero flag is set" + }, + { + "key": "JM 16-bit address", + "val": "Jump to the specified 16-bit address if sign flag is set" + }, + { + "key": "JP 16-bit address", + "val": "Jump to the specified 16-bit address if sign flag is zero" + }, + { + "key": "CALL 16-bit address", + "val": "Program sequence is transferred to the memory location specified by the 16-bit address" + }, + { + "key": "CC 16-bit address", + "val": "Program sequence is transferred to the memory location specified by the 16-bit address if carry flag is set" + }, + { + "key": "CZ 16-bit address", + "val": "Program sequence is transferred to the memory location specified by the 16-bit address if zero flag is set" + }, + { + "key": "CM 16-bit address", + "val": "Program sequence is transferred to the memory location specified by the 16-bit address if sign flag is set" + }, + { + "key": "CP 16-bit address", + "val": "Program sequence is transferred to the memory location specified by the 16-bit address if sign flag is zero" + } + ], + "Control Instructions": [ + { + "key": "NOP", + "val": "No operation is performed" + }, + { + "key": "HLT", + "val": "Halt and enter wait state" + }, + { + "key": "DI", + "val": "Disable interrupts" + }, + { + "key": "EI", + "val": "Enable interrupts" + }, + { + "key": "RIM", + "val": "Read interrupt mask" + }, + { + "key": "SIM", + "val": "Set interrupt mask" + }, + { + "key": "CLI", + "val": "Clear Interrupt Flag" + } + ] + } +} From 94715d63e0a2cfbc0dd5500206a741dd647836cb Mon Sep 17 00:00:00 2001 From: JOBIN PHILIP ABRAHAM Date: Fri, 27 Nov 2015 16:56:55 +0530 Subject: [PATCH 152/379] Delete 8085.json --- share/goodie/cheat_sheets/json/8085.json | 230 ----------------------- 1 file changed, 230 deletions(-) delete mode 100644 share/goodie/cheat_sheets/json/8085.json diff --git a/share/goodie/cheat_sheets/json/8085.json b/share/goodie/cheat_sheets/json/8085.json deleted file mode 100644 index 599ef0df4..000000000 --- a/share/goodie/cheat_sheets/json/8085.json +++ /dev/null @@ -1,230 +0,0 @@ -{ - "id": "8085_cheat_sheet", - "name": "8085 Instruction Set", - "description": "8085 instructions and their explanations", - "metadata": { - "sourceName": "IITK", - "sourceUrl": "http://home.iitk.ac.in/~ajalan/8085_is_details.pdf" - }, - "template_type": "reference", - "section_order": [ - "Data Transfer Instructions", - "Arithmetic Instructions", - "Logical Instructions", - "Rotate Instructions", - "Control Transfer Instructions", - "Control Instructions" - ], - "aliases": [ - "8085 instructionset", - "8085 instruction set", - "8085 programming", - "8085 instructions" - ], - "sections": { - "Data Transfer Instructions": [ - { - "key": "MOV Destination, Source", - "val": "Copies a word or byte of data from 'source' to 'destination'" - }, - { - "key": "MVI Destination, 8 bit data", - "val": "Copies the given byte of data to 'destination'" - }, - { - "key": "LDA 16-bit address", - "val": "Loads the 16-bit address in Accumulator" - }, - { - "key": "LXI Reg.Pair, 16-bit data", - "val": "Loads 16-bit data in the register pair " - }, - { - "key": "STA 16-bit address", - "val": "Stores the content of Accumulator in memory location specified by the 16-bit address " - }, - { - "key": "XCHG", - "val": "Contents of register H are exchanged with the contents of register D, and the contents of register L are exchanged with the contents of register E " - }, - { - "key": "LHLD 16-bit address", - "val": "Copies the contents of the memory location pointed out by the 16-bit address into register L and copies the contents of the next memory location into register H" - }, - { - "key": "SHLD 16-bit address", - "val": "Contents of register L are stored into the memory location specified by the 16-bit address in the operand and the contents of H register are stored into the next memory location" - }, - { - "key": "OUT 8-bit port address", - "val": "Contents of the accumulator are copied into the I/O port specified by the operand" - }, - { - "key": "IN 8-bit port address", - "val": "Contents of the input port designated in the operand are read and loaded into the accumulator." - } - ], - "Arithmetic Instructions": [ - { - "key": "ADD R/M", - "val": "Adds the content of register or memory location to the content of Accumulator and put the result in the Accumulator" - }, - { - "key": "SUB R/M", - "val": "Subtracts the content of register or memory location from the content of Accumulator and put the result in the Accumulator" - }, - { - "key": "INX Reg.pair", - "val": "Contents of the designated register pair are incremented by 1 " - }, - { - "key": "DCX Reg.pair", - "val": "Contents of the designated register pair are decremented by 1 " - }, - { - "key": "INR R/M", - "val": "Contents of the designated register or memory location is incremented by one" - }, - { - "key": "DCR R/M", - "val": "Contents of the designated register or memory location is decremented by one" - }, - { - "key": "DAA", - "val": "Decimal Adjust Accumulator" - } - ], - "Logical Instructions": [ - { - "key": "ANA R/M", - "val": "Content of the Accumulator is logically ANDed with the content of the operand" - }, - { - "key": "ANI 8-bit data", - "val": "Content of the Accumulator is logically ANDed with 8-bit data given as the operand" - }, - { - "key": "ORA R/M", - "val": "Content of the Accumulator is logically ORed with the content of the operand" - }, - { - "key": "ORI 8-bit data", - "val": "Content of the Accumulator is logically ANDed with 8-bit data given as the operand" - }, - { - "key": "XRA R/M", - "val": "Content of the Accumulator is Exclusive-ORed with the content of the operand" - }, - { - "key": "XRI 8-bit data", - "val": "Content of the Accumulator is Exclusive-ORed with 8-bit data given as the operand" - }, - { - "key": "CMP R/M", - "val": "Compares the content in the register or memory location with content in Accumulator" - }, - { - "key": "CPI 8-bit data", - "val": "Compares the 8-bit data given as the operand with content in Accumulator" - } - ], - "Rotate Instructions": [ - { - "key": "RCL", - "val": "Rotates each bits in the Accumulator to the left once.MSB is circled back into the LSB and CF contains a copy of the bit most recently moved out of the MSB" - }, - { - "key": "RCR", - "val": "Rotates each bits in the Accumulator to the right once.LSB is circled back into the MSB and CF contains a copy of the bit most recently moved out of the LSB" - }, - { - "key": "RAL", - "val": "Rotate accumulator left through carry" - }, - { - "key": "RAR", - "val": "Rotate accumulator right through carry" - }, - { - "key": "SHL Destination, Count", - "val": "Shifts each bit in the 'destination' to the left 'count' number of times and a 0 is put in the LSB position for each shift" - }, - { - "key": "SHR Destination, Count", - "val": "Shifts each bit in the 'destination' to the right 'count' number of times and a 0 is put in the MSB position for each shift" - } - ], - "Control Transfer Instructions": [ - { - "key": "JMP 16-bit address", - "val": "Unconditional jump to the specified 16-bit address" - }, - { - "key": "JC 16-bit address", - "val": "Jump to the specified 16-bit address if carry flag is set" - }, - { - "key": "JZ 16-bit address", - "val": "Jump to the specified 16-bit address if zero flag is set" - }, - { - "key": "JM 16-bit address", - "val": "Jump to the specified 16-bit address if sign flag is set" - }, - { - "key": "JP 16-bit address", - "val": "Jump to the specified 16-bit address if sign flag is zero" - }, - { - "key": "CALL 16-bit address", - "val": "Program sequence is transferred to the memory location specified by the 16-bit address" - }, - { - "key": "CC 16-bit address", - "val": "Program sequence is transferred to the memory location specified by the 16-bit address if carry flag is set" - }, - { - "key": "CZ 16-bit address", - "val": "Program sequence is transferred to the memory location specified by the 16-bit address if zero flag is set" - }, - { - "key": "CM 16-bit address", - "val": "Program sequence is transferred to the memory location specified by the 16-bit address if sign flag is set" - }, - { - "key": "CP 16-bit address", - "val": "Program sequence is transferred to the memory location specified by the 16-bit address if sign flag is zero" - } - ], - "Control Instructions": [ - { - "key": "NOP", - "val": "No operation is performed" - }, - { - "key": "HLT", - "val": "Halt and enter wait state" - }, - { - "key": "DI", - "val": "Disable interrupts" - }, - { - "key": "EI", - "val": "Enable interrupts" - }, - { - "key": "RIM", - "val": "Read interrupt mask" - }, - { - "key": "SIM", - "val": "Set interrupt mask" - }, - { - "key": "CLI", - "val": "Clear Interrupt Flag" - } - ] - } -} From 34223e902a248f59d0da73ef61646fb0f23e5298 Mon Sep 17 00:00:00 2001 From: JOBIN PHILIP ABRAHAM Date: Fri, 27 Nov 2015 16:57:16 +0530 Subject: [PATCH 153/379] Create cpp.json --- share/goodie/cheat_sheets/json/cpp.json | 195 ++++++++++++++++++++++++ 1 file changed, 195 insertions(+) create mode 100644 share/goodie/cheat_sheets/json/cpp.json diff --git a/share/goodie/cheat_sheets/json/cpp.json b/share/goodie/cheat_sheets/json/cpp.json new file mode 100644 index 000000000..afcb68e5c --- /dev/null +++ b/share/goodie/cheat_sheets/json/cpp.json @@ -0,0 +1,195 @@ + { + "id": "cpp_cheat_sheet", + "name": "C++", + "description": "A quick reference of c++ language", + "metadata": { + "sourceName": "CCU", + "sourceUrl": "http://www.cs.ccu.edu.tw/~damon/oop/,c++refcard.pdf" + }, + "template_type": "reference", + "section_order": [ + "Fundamental Data Types", + "Preprocessor Directives", + "Arithmetic Operators", + "Relational Operators", + "Logical Operators", + "Bitwise Operators", + "Namespaces", + "Console Input/Output", + "Class Member Protections" + ], + "aliases": [ + "c++", + "c plus plus" + ], + "sections": { + "Fundamental Data Types": [ + { + "key": "char", + "val": "Character (1 byte)" + }, + { + "key": "int", + "val": "Integer " + }, + { + "key": "float", + "val": "Floating point" + }, + { + "key": "bool", + "val": "True or false" + }, + { + "key": "void", + "val": "No value" + } + ], + "Preprocessor Directives": [ + { + "key": "#include ", + "val": "Include library file" + }, + { + "key": "#include \"filename\"", + "val": "Include user file" + }, + { + "key": "#define name text", + "val": "Define a macro" + }, + { + "key": "#define name(var) text", + "val": "Define a parameterized macro" + }, + { + "key": "#undef name", + "val": "Undefine a previously defined macro" + }, + { + "key": "#if, #else, #elif, #endif", + "val": "Conditional execution" + } + ], + "Arithmetic Operators": [ + { + "key": "+", + "val": "Adds two operands" + }, + { + "key": "−", + "val": "Subtracts second operand from the first" + }, + { + "key": "*", + "val": "Multiplies both operands" + }, + { + "key": "/", + "val": "Divides numerator by de-numerator" + }, + { + "key": "%", + "val": "Modulus Operator" + }, + { + "key": "++", + "val": "Increases the integer value by one" + }, + { + "key": "--", + "val": "Decreases the integer value by one" + } + ], + "Relational Operators": [ + { + "key": "==", + "val": "Checks for equality between operands" + }, + { + "key": "!=", + "val": "Checks for non equality between operands" + }, + { + "key": ">", + "val": "Checks if the value of left operand is greater than the value of right operand. If yes, then the condition becomes true." + }, + { + "key": "<", + "val": "Checks if the value of left operand is less than the value of right operand. If yes, then the condition becomes true." + }, + { + "key": ">=", + "val": "Checks if the value of left operand is greater than or equal to the value of right operand. If yes, then the condition becomes true." + }, + { + "key": "<=", + "val": "Checks if the value of left operand is less than or equal to the value of right operand. If yes, then the condition becomes true." + } + ], + "Logical Operators": [ + { + "key": "&&", + "val": "Logical AND operator" + }, + { + "key": "||", + "val": "Logical OR Operator" + }, + { + "key": "!", + "val": "Logical NOT Operator" + } + ], + "Bitwise Operators": [ + { + "key": "&", + "val": "Does the logical AND on the bits in the corresponding position of the operands in its binary form" + }, + { + "key": "|", + "val": "Does the logical OR on the bits in the corresponding position of the operands in its binary form" + }, + { + "key": "^", + "val": "Does XOR on the bits in the corresponding position of the operands in its binary form" + }, + { + "key": "~", + "val": "Inverts all the bits of operand" + }, + { + "key": "<<", + "val": "Takes two numbers, left shifts the bits of first operand, the second operand decides the number of places to shift" + }, + { + "key": ">>", + "val": "Takes two numbers, right shifts the bits of first operand, the second operand decides the number of places to shift" + } + ], + "Namespaces": [ + { + "key": "namespace name {...}", + "val": "Define namespace for the enclosed code" + }, + { + "key": "using name;", + "val": "Import function and variable definition from the given namespace into the current namespace" + } + ], + "Class Member Protections": [ + { + "key": "public", + "val": "Anyone outside the class may access these member functions and variables" + }, + { + "key": "private", + "val": "Only the class's member functions and friends may access the data." + }, + { + "key": "protected", + "val": "Only the class's member functions, friends, and derived classes may access." + } + ] + } +} From 13bb4dd58159ebfdf73000318b7d85ed2060cd8a Mon Sep 17 00:00:00 2001 From: JOBIN PHILIP ABRAHAM Date: Fri, 27 Nov 2015 17:02:01 +0530 Subject: [PATCH 154/379] Update cmus.json updated name,desc and section names --- share/goodie/cheat_sheets/json/cmus.json | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/share/goodie/cheat_sheets/json/cmus.json b/share/goodie/cheat_sheets/json/cmus.json index df04f66d2..b801ce6db 100644 --- a/share/goodie/cheat_sheets/json/cmus.json +++ b/share/goodie/cheat_sheets/json/cmus.json @@ -1,13 +1,13 @@ { "id": "cmus_cheat_sheet", - "name": "Cmus", - "description": "Console music player", + "name": "cmus", + "description": "cmus keyboard shortcuts", "metadata": { "sourceName": "GitHub", "sourceUrl": "https://github.com/cmus/cmus/blob/master/Doc/cmus.txt" }, "template_type": "keyboard", - "section_order": ["Cursor Movement", "Views", "Song navigation", "Adding / Removing tracks", "Browser movements", "Exiting", "Miscellaneous"], + "section_order": ["Cursor Movement", "Views", "Song Navigation", "Adding / Removing Tracks", "Browser Movements", "Exiting", "Miscellaneous"], "sections": { "Cursor Movement": [ { @@ -49,7 +49,7 @@ "key": "7" } ], - "Song navigation": [ + "Song Navigation": [ { "val": "Play / Restart", "key": "x" @@ -87,7 +87,7 @@ "key": "," } ], - "Adding / Removing tracks": [ + "Adding / Removing Tracks": [ { "val": "Add track / folder to library from browser view", "key": "a" @@ -109,7 +109,7 @@ "key": "[Shift] [d]" } ], - "Browser movements": [ + "Browser Movements": [ { "val": "Activate selection", "key": "[Space bar] / [Enter]" @@ -173,4 +173,3 @@ ] } } - From 7e17efcd11ee06d83512357d0a8d6f6785ffd408 Mon Sep 17 00:00:00 2001 From: Mailkov Date: Fri, 27 Nov 2015 13:32:57 +0000 Subject: [PATCH 155/379] Issue #1491 - fix review for Chess960.pm --- lib/DDG/Goodie/Chess960.pm | 2 +- t/Chess960.t | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/DDG/Goodie/Chess960.pm b/lib/DDG/Goodie/Chess960.pm index 26ef71301..d1306a9ea 100644 --- a/lib/DDG/Goodie/Chess960.pm +++ b/lib/DDG/Goodie/Chess960.pm @@ -136,7 +136,7 @@ handle query => sub { return 'Chess 960', structured_answer => { id => 'chess960', - name => 960, + name => 'Answer', data => { title => 'Chess960', subtitle => 'Position ' . $position_num, diff --git a/t/Chess960.t b/t/Chess960.t index 1e560d2ca..b6c1703ce 100644 --- a/t/Chess960.t +++ b/t/Chess960.t @@ -17,7 +17,7 @@ ddg_goodie_test( structured_answer => { data => '-ANY-', id => "chess960", - name => 960, + name => 'Answer', templates => { group => "text", item => 0, From 8a9c1d105ce83cfe5a4c4065a9e7e3d8862e8164 Mon Sep 17 00:00:00 2001 From: Mailkov Date: Fri, 27 Nov 2015 13:46:28 +0000 Subject: [PATCH 156/379] Issue #1491 - fix review for chess960.js --- share/goodie/chess960/chess960.js | 169 +++++++++++++++--------------- 1 file changed, 86 insertions(+), 83 deletions(-) diff --git a/share/goodie/chess960/chess960.js b/share/goodie/chess960/chess960.js index b0e464225..859a41000 100644 --- a/share/goodie/chess960/chess960.js +++ b/share/goodie/chess960/chess960.js @@ -1,94 +1,97 @@ DDH.chess960 = DDH.chess960 || {}; -DDH.chess960.build = function(ops) { - // Global Variables Declaration - var $tempChessboard, $container; - var squares, started; - var scheme = []; - var letters = ["H", "G", "F", "E", "D", "C", "B", "A"]; - var position = ops.data.position; +(function(DDH) { + "use strict"; + DDH.chess960.build = function(ops) { + // Global Variables Declaration + var $tempChessboard, $container; + var squares, started; + var scheme = []; + var letters = ["H", "G", "F", "E", "D", "C", "B", "A"]; + var position = ops.data.position; - for (var i = 0; i Date: Fri, 27 Nov 2015 14:00:41 +0000 Subject: [PATCH 157/379] Issue #1491 - fix review for content.handlebars --- share/goodie/chess960/chess960.css | 10 +++++----- share/goodie/chess960/chess960.js | 3 +-- share/goodie/chess960/content.handlebars | 24 ++++++++++-------------- 3 files changed, 16 insertions(+), 21 deletions(-) diff --git a/share/goodie/chess960/chess960.css b/share/goodie/chess960/chess960.css index 8259f1cd7..220777a90 100644 --- a/share/goodie/chess960/chess960.css +++ b/share/goodie/chess960/chess960.css @@ -1,4 +1,4 @@ -.zci--chess960 .zci--fenviewer span { +.zci--chess960 span { color:#333; display:block; font-size:27px; @@ -9,8 +9,8 @@ line-height: 1.5; } -.zci--chess960 .zci--fenviewer .chess_board { border: 2px solid #333; } -.zci--chess960 .zci--fenviewer .chess_board td { +.zci--chess960 .chess_board { border: 2px solid #333; } +.zci--chess960 .chess_board td { background:#fff; height:40px; text-align:center; @@ -18,7 +18,7 @@ width:40px; } -.zci--chess960 .zci--fenviewer .chess_board tr:nth-child(odd) td:nth-child(even), -.zci--chess960 .zci--fenviewer .chess_board tr:nth-child(even) td:nth-child(odd) { +.zci--chess960 .chess_board tr:nth-child(odd) td:nth-child(even), +.zci--chess960 .chess_board tr:nth-child(even) td:nth-child(odd) { background-color: #ddd; } \ No newline at end of file diff --git a/share/goodie/chess960/chess960.js b/share/goodie/chess960/chess960.js index 859a41000..06acae212 100644 --- a/share/goodie/chess960/chess960.js +++ b/share/goodie/chess960/chess960.js @@ -4,7 +4,7 @@ DDH.chess960 = DDH.chess960 || {}; "use strict"; DDH.chess960.build = function(ops) { // Global Variables Declaration - var $tempChessboard, $container; + var $tempChessboard; var squares, started; var scheme = []; var letters = ["H", "G", "F", "E", "D", "C", "B", "A"]; @@ -84,7 +84,6 @@ DDH.chess960 = DDH.chess960 || {}; if (!started) { started = true; - $container = $('#zci--fenviewer'); $tempChessboard = $('#chess_board'); squares = $('td.square'); diff --git a/share/goodie/chess960/content.handlebars b/share/goodie/chess960/content.handlebars index 18ab0bd7f..33033c861 100644 --- a/share/goodie/chess960/content.handlebars +++ b/share/goodie/chess960/content.handlebars @@ -1,15 +1,11 @@ -
- - - {{#loop rows}} - - {{#loop columns}} - - {{/loop}} - +
- -
+ {{#loop rows}} + + {{#loop columns}} + {{/loop}} -
+ +
- -
+
From ea9dccd54bebd11f3f62a6099ce9334cf83ec335 Mon Sep 17 00:00:00 2001 From: Mailkov Date: Fri, 27 Nov 2015 15:17:22 +0000 Subject: [PATCH 158/379] Issue #1491 - fix position pieces --- share/goodie/chess960/chess960.css | 2 +- share/goodie/chess960/chess960.js | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/share/goodie/chess960/chess960.css b/share/goodie/chess960/chess960.css index 220777a90..05330c23d 100644 --- a/share/goodie/chess960/chess960.css +++ b/share/goodie/chess960/chess960.css @@ -1,4 +1,4 @@ -.zci--chess960 span { +.zci--chess960 .chess_board span { color:#333; display:block; font-size:27px; diff --git a/share/goodie/chess960/chess960.js b/share/goodie/chess960/chess960.js index 06acae212..9b4432f5c 100644 --- a/share/goodie/chess960/chess960.js +++ b/share/goodie/chess960/chess960.js @@ -4,14 +4,13 @@ DDH.chess960 = DDH.chess960 || {}; "use strict"; DDH.chess960.build = function(ops) { // Global Variables Declaration - var $tempChessboard; var squares, started; var scheme = []; var letters = ["H", "G", "F", "E", "D", "C", "B", "A"]; var position = ops.data.position; - for (var i = 0; i Date: Fri, 27 Nov 2015 19:44:22 +0000 Subject: [PATCH 159/379] Issue #1595 - backcolor icon --- lib/DDG/Goodie/Zodiac.pm | 29 +- share/goodie/zodiac/aquarius.png | Bin 0 -> 499 bytes .../zodiac/{scorpio.png => scorpius.png} | Bin t/Zodiac.t | 610 ++++++++++++++---- 4 files changed, 512 insertions(+), 127 deletions(-) create mode 100644 share/goodie/zodiac/aquarius.png rename share/goodie/zodiac/{scorpio.png => scorpius.png} (100%) diff --git a/lib/DDG/Goodie/Zodiac.pm b/lib/DDG/Goodie/Zodiac.pm index 15f9b0cdb..9a08862dc 100644 --- a/lib/DDG/Goodie/Zodiac.pm +++ b/lib/DDG/Goodie/Zodiac.pm @@ -9,6 +9,7 @@ use warnings; use DateTime::Event::Zodiac qw(zodiac_date_name); +zci is_cached => 0; zci answer_type => "zodiac"; triggers startend => "zodiac","zodiac sign","starsign","star sign"; @@ -21,6 +22,22 @@ category "dates"; topics "special_interest"; attribution email => 'nomady@zoho.com', github => ['https://github.com/n0mady','NOMADY']; + +my @colors = qw(bg-clr--blue-light bg-clr--green bg-clr--red bg-clr--grey); + +sub element_sign { + my @sign = @_; + my $versign = lc($sign[0]); + # element Water + return 0 if ($versign =~ m/(cancer|scorpius|pisces)/); + # element Water + return 1 if ($versign =~ m/(taurus|virgo|capricornus)/); + # element Water + return 2 if ($versign =~ m/(aries|sagittarius|leo)/); + # element Water + return 3 if ($versign =~ m/(libra|gemini|aquarius)/); + return 0; +} handle remainder => sub { my $datestring = $_; # The remainder should just be the string for their date. @@ -39,10 +56,15 @@ handle remainder => sub { # Input String my $input = date_output_string($zodiacdate); + + my $index = element_sign($zodiacsign); + + # Background Color Icon + my $bgcolor = $colors[$index]; return $result, structured_answer => { id => "zodiac", - name => "Zodiac", + name => "Dates", data => { image => "/share/goodie/zodiac/" . lc($zodiacsign) . ".png", title => $zodiacsign, @@ -51,7 +73,10 @@ handle remainder => sub { templates => { group => "icon", elClass => { - iconImage => "bg-clr--blue-light" + iconImage => $bgcolor . " circle" + }, + variants => { + iconImage => 'large' } } }; diff --git a/share/goodie/zodiac/aquarius.png b/share/goodie/zodiac/aquarius.png new file mode 100644 index 0000000000000000000000000000000000000000..2d0ecd5c8a8309e86f944adbe339ba97580027d5 GIT binary patch literal 499 zcmV2SO;LY>-R=ol8NbieFSQNm2LApt2g;OsV7wUq_ZuPBEIBKc9 zoW!*Fg#E#8CjsUBAukoNJucn*gd8`^-$D1ZygZ2$aS0m$XcBg}%gasR=6L@Vn3)T4 zn2`NJMojOiLjVqj-L3L+Gk7{4;YlH3_qe<~1~L7rS_fcj*u4Qb0C+vlTiOsn)3Eyz zun+Ks<4(9C9^swZ+G&>#?hLzM0J8x<+n(qjvEKllfgmq7A`M~5P}o?}J2_iTKEE}8~)P1oV4&k&>)x^fya{;-UT`ZQ|ItECRxCs z;5ZoEma;IHJfKT(?3$*qU2trliqO5FS}@fBw2I19-8%fm-rE$9FM002ovPDHLkV1k}s>aPF* literal 0 HcmV?d00001 diff --git a/share/goodie/zodiac/scorpio.png b/share/goodie/zodiac/scorpius.png similarity index 100% rename from share/goodie/zodiac/scorpio.png rename to share/goodie/zodiac/scorpius.png diff --git a/t/Zodiac.t b/t/Zodiac.t index f6712fb7b..422f32ad9 100644 --- a/t/Zodiac.t +++ b/t/Zodiac.t @@ -16,27 +16,54 @@ ddg_goodie_test([qw( 'Zodiac 21st March 1967' => test_zci( 'Zodiac for 21 Mar 1967: Aries', structured_answer => { - input => ['21 Mar 1967'], - operation => 'Zodiac', - result => 'Aries' - } + id => "zodiac", + name => "Dates", + data => '-ANY-', + templates => { + group => 'icon', + elClass => { + iconImage => 'bg-clr--red circle' + }, + variants => { + iconImage => 'large' + } + } + } ), 'StarSign 30 Mar' => test_zci( 'Zodiac for 30 Mar 2015: Aries', structured_answer => { - input => ['30 Mar 2015'], - operation => 'Zodiac', - result => 'Aries' + id => "zodiac", + name => "Dates", + data => '-ANY-', + templates => { + group => 'icon', + elClass => { + iconImage => 'bg-clr--red circle' + }, + variants => { + iconImage => 'large' + } + } } ), '20 April star sign' => test_zci( 'Zodiac for 20 Apr 2015: Aries', structured_answer => { - input => ['20 Apr 2015'], - operation => 'Zodiac', - result => 'Aries' + id => "zodiac", + name => "Dates", + data => '-ANY-', + templates => { + group => 'icon', + elClass => { + iconImage => 'bg-clr--red circle' + }, + variants => { + iconImage => 'large' + } + } } ), @@ -44,17 +71,35 @@ ddg_goodie_test([qw( 'Zodiac 21st April 2014' => test_zci( 'Zodiac for 21 Apr 2014: Taurus', structured_answer => { - input => ['21 Apr 2014'], - operation => 'Zodiac', - result => 'Taurus' + id => "zodiac", + name => "Dates", + data => '-ANY-', + templates => { + group => 'icon', + elClass => { + iconImage => 'bg-clr--green circle' + }, + variants => { + iconImage => 'large' + } + } } ), 'StarSign 27 Apr' => test_zci( 'Zodiac for 27 Apr 2015: Taurus', structured_answer => { - input => ['27 Apr 2015'], - operation => 'Zodiac', - result => 'Taurus' + id => "zodiac", + name => "Dates", + data => '-ANY-', + templates => { + group => 'icon', + elClass => { + iconImage => 'bg-clr--green circle' + }, + variants => { + iconImage => 'large' + } + } } ), @@ -62,45 +107,90 @@ ddg_goodie_test([qw( '21 May star sign' => test_zci( 'Zodiac for 21 May 2015: Gemini', structured_answer => { - input => ['21 May 2015'], - operation => 'Zodiac', - result => 'Gemini' + id => "zodiac", + name => "Dates", + data => '-ANY-', + templates => { + group => 'icon', + elClass => { + iconImage => 'bg-clr--grey circle' + }, + variants => { + iconImage => 'large' + } + } } ), 'Zodiac 22nd May 1500' => test_zci( 'Zodiac for 22 May 1500: Gemini', structured_answer => { - input => ['22 May 1500'], - operation => 'Zodiac', - result => 'Gemini' + id => "zodiac", + name => "Dates", + data => '-ANY-', + templates => { + group => 'icon', + elClass => { + iconImage => 'bg-clr--grey circle' + }, + variants => { + iconImage => 'large' + } + } } ), 'Zodiac 21.05.1965' => test_zci( 'Zodiac for 21 May 1965: Gemini', structured_answer => { - input => ['21 May 1965'], - operation => 'Zodiac', - result => 'Gemini' + id => "zodiac", + name => "Dates", + data => '-ANY-', + templates => { + group => 'icon', + elClass => { + iconImage => 'bg-clr--grey circle' + }, + variants => { + iconImage => 'large' + } + } } ), 'StarSign 31 May' => test_zci( 'Zodiac for 31 May 2015: Gemini', structured_answer => { - input => ['31 May 2015'], - operation => 'Zodiac', - result => 'Gemini' + id => "zodiac", + name => "Dates", + data => '-ANY-', + templates => { + group => 'icon', + elClass => { + iconImage => 'bg-clr--grey circle' + }, + variants => { + iconImage => 'large' + } + } } ), '21 jun star sign' => test_zci( 'Zodiac for 21 Jun 2015: Gemini', structured_answer => { - input => ['21 Jun 2015'], - operation => 'Zodiac', - result => 'Gemini' + id => "zodiac", + name => "Dates", + data => '-ANY-', + templates => { + group => 'icon', + elClass => { + iconImage => 'bg-clr--grey circle' + }, + variants => { + iconImage => 'large' + } + } } ), @@ -108,27 +198,54 @@ ddg_goodie_test([qw( 'Zodiac 22nd June 1889' => test_zci( 'Zodiac for 22 Jun 1889: Cancer', structured_answer => { - input => ['22 Jun 1889'], - operation => 'Zodiac', - result => 'Cancer' + id => "zodiac", + name => "Dates", + data => '-ANY-', + templates => { + group => 'icon', + elClass => { + iconImage => 'bg-clr--blue-light circle' + }, + variants => { + iconImage => 'large' + } + } } ), 'StarSign 30 June 2017' => test_zci( 'Zodiac for 30 Jun 2017: Cancer', structured_answer => { - input => ['30 Jun 2017'], - operation => 'Zodiac', - result => 'Cancer' + id => "zodiac", + name => "Dates", + data => '-ANY-', + templates => { + group => 'icon', + elClass => { + iconImage => 'bg-clr--blue-light circle' + }, + variants => { + iconImage => 'large' + } + } } ), '22nd july star sign' => test_zci( 'Zodiac for 22 Jul 2015: Cancer', structured_answer => { - input => ['22 Jul 2015'], - operation => 'Zodiac', - result => 'Cancer' + id => "zodiac", + name => "Dates", + data => '-ANY-', + templates => { + group => 'icon', + elClass => { + iconImage => 'bg-clr--blue-light circle' + }, + variants => { + iconImage => 'large' + } + } } ), @@ -136,36 +253,72 @@ ddg_goodie_test([qw( 'Zodiac 23 July 1654' => test_zci( 'Zodiac for 23 Jul 1654: Leo', structured_answer => { - input => ['23 Jul 1654'], - operation => 'Zodiac', - result => 'Leo' + id => "zodiac", + name => "Dates", + data => '-ANY-', + templates => { + group => 'icon', + elClass => { + iconImage => 'bg-clr--red circle' + }, + variants => { + iconImage => 'large' + } + } } ), 'StarSign 24th July' => test_zci( 'Zodiac for 24 Jul 2015: Leo', structured_answer => { - input => ['24 Jul 2015'], - operation => 'Zodiac', - result => 'Leo' + id => "zodiac", + name => "Dates", + data => '-ANY-', + templates => { + group => 'icon', + elClass => { + iconImage => 'bg-clr--red circle' + }, + variants => { + iconImage => 'large' + } + } } ), '22 aug star sign' => test_zci( 'Zodiac for 22 Aug 2015: Leo', structured_answer => { - input => ['22 Aug 2015'], - operation => 'Zodiac', - result => 'Leo' + id => "zodiac", + name => "Dates", + data => '-ANY-', + templates => { + group => 'icon', + elClass => { + iconImage => 'bg-clr--red circle' + }, + variants => { + iconImage => 'large' + } + } } ), 'Zodiac 23rd Aug 1700' => test_zci( 'Zodiac for 23 Aug 1700: Leo', structured_answer => { - input => ['23 Aug 1700'], - operation => 'Zodiac', - result => 'Leo' + id => "zodiac", + name => "Dates", + data => '-ANY-', + templates => { + group => 'icon', + elClass => { + iconImage => 'bg-clr--red circle' + }, + variants => { + iconImage => 'large' + } + } } ), @@ -173,9 +326,18 @@ ddg_goodie_test([qw( 'StarSign 1 Sep' => test_zci( 'Zodiac for 01 Sep 2015: Virgo', structured_answer => { - input => ['01 Sep 2015'], - operation => 'Zodiac', - result => 'Virgo' + id => "zodiac", + name => "Dates", + data => '-ANY-', + templates => { + group => 'icon', + elClass => { + iconImage => 'bg-clr--green circle' + }, + variants => { + iconImage => 'large' + } + } } ), @@ -183,27 +345,54 @@ ddg_goodie_test([qw( '23rd Sep star sign' => test_zci( 'Zodiac for 23 Sep 2015: Libra', structured_answer => { - input => ['23 Sep 2015'], - operation => 'Zodiac', - result => 'Libra' + id => "zodiac", + name => "Dates", + data => '-ANY-', + templates => { + group => 'icon', + elClass => { + iconImage => 'bg-clr--grey circle' + }, + variants => { + iconImage => 'large' + } + } } ), 'Zodiac 24 September 2001' => test_zci( 'Zodiac for 24 Sep 2001: Libra', structured_answer => { - input => ['24 Sep 2001'], - operation => 'Zodiac', - result => 'Libra' + id => "zodiac", + name => "Dates", + data => '-ANY-', + templates => { + group => 'icon', + elClass => { + iconImage => 'bg-clr--grey circle' + }, + variants => { + iconImage => 'large' + } + } } ), 'StarSign 7th October' => test_zci( 'Zodiac for 07 Oct 2015: Libra', structured_answer => { - input => ['07 Oct 2015'], - operation => 'Zodiac', - result => 'Libra' + id => "zodiac", + name => "Dates", + data => '-ANY-', + templates => { + group => 'icon', + elClass => { + iconImage => 'bg-clr--grey circle' + }, + variants => { + iconImage => 'large' + } + } } ), @@ -211,27 +400,54 @@ ddg_goodie_test([qw( '23 oct star sign' => test_zci( 'Zodiac for 23 Oct 2015: Scorpius', structured_answer => { - input => ['23 Oct 2015'], - operation => 'Zodiac', - result => 'Scorpius' + id => "zodiac", + name => "Dates", + data => '-ANY-', + templates => { + group => 'icon', + elClass => { + iconImage => 'bg-clr--blue-light circle' + }, + variants => { + iconImage => 'large' + } + } } ), 'Zodiac 24 October 1213' => test_zci( 'Zodiac for 24 Oct 1213: Scorpius', structured_answer => { - input => ['24 Oct 1213'], - operation => 'Zodiac', - result => 'Scorpius' - } + id => "zodiac", + name => "Dates", + data => '-ANY-', + templates => { + group => 'icon', + elClass => { + iconImage => 'bg-clr--blue-light circle' + }, + variants => { + iconImage => 'large' + } + } + } ), 'StarSign 9th November' => test_zci( 'Zodiac for 09 Nov 2015: Scorpius', structured_answer => { - input => ['09 Nov 2015'], - operation => 'Zodiac', - result => 'Scorpius' + id => "zodiac", + name => "Dates", + data => '-ANY-', + templates => { + group => 'icon', + elClass => { + iconImage => 'bg-clr--blue-light circle' + }, + variants => { + iconImage => 'large' + } + } } ), @@ -239,36 +455,72 @@ ddg_goodie_test([qw( '22 nov star sign' => test_zci( 'Zodiac for 22 Nov 2015: Sagittarius', structured_answer => { - input => ['22 Nov 2015'], - operation => 'Zodiac', - result => 'Sagittarius' + id => "zodiac", + name => "Dates", + data => '-ANY-', + templates => { + group => 'icon', + elClass => { + iconImage => 'bg-clr--red circle' + }, + variants => { + iconImage => 'large' + } + } } ), 'Zodiac 23 Nov 1857' => test_zci( 'Zodiac for 23 Nov 1857: Sagittarius', structured_answer => { - input => ['23 Nov 1857'], - operation => 'Zodiac', - result => 'Sagittarius' + id => "zodiac", + name => "Dates", + data => '-ANY-', + templates => { + group => 'icon', + elClass => { + iconImage => 'bg-clr--red circle' + }, + variants => { + iconImage => 'large' + } + } } ), 'StarSign 6 Dec' => test_zci( 'Zodiac for 06 Dec 2015: Sagittarius', structured_answer => { - input => ['06 Dec 2015'], - operation => 'Zodiac', - result => 'Sagittarius' + id => "zodiac", + name => "Dates", + data => '-ANY-', + templates => { + group => 'icon', + elClass => { + iconImage => 'bg-clr--red circle' + }, + variants => { + iconImage => 'large' + } + } } ), '21 Dec star sign' => test_zci( 'Zodiac for 21 Dec 2015: Sagittarius', structured_answer => { - input => ['21 Dec 2015'], - operation => 'Zodiac', - result => 'Sagittarius' + id => "zodiac", + name => "Dates", + data => '-ANY-', + templates => { + group => 'icon', + elClass => { + iconImage => 'bg-clr--red circle' + }, + variants => { + iconImage => 'large' + } + } } ), @@ -276,45 +528,90 @@ ddg_goodie_test([qw( 'Zodiac 22nd December' => test_zci( 'Zodiac for 22 Dec 2015: Capricornus', structured_answer => { - input => ['22 Dec 2015'], - operation => 'Zodiac', - result => 'Capricornus' + id => "zodiac", + name => "Dates", + data => '-ANY-', + templates => { + group => 'icon', + elClass => { + iconImage => 'bg-clr--green circle' + }, + variants => { + iconImage => 'large' + } + } } ), 'StarSign 23 Dec 1378' => test_zci( 'Zodiac for 23 Dec 1378: Capricornus', structured_answer => { - input => ['23 Dec 1378'], - operation => 'Zodiac', - result => 'Capricornus' + id => "zodiac", + name => "Dates", + data => '-ANY-', + templates => { + group => 'icon', + elClass => { + iconImage => 'bg-clr--green circle' + }, + variants => { + iconImage => 'large' + } + } } ), 'starsign 31 Dec 2009' => test_zci( 'Zodiac for 31 Dec 2009: Capricornus', structured_answer => { - input => ['31 Dec 2009'], - operation => 'Zodiac', - result => 'Capricornus' + id => "zodiac", + name => "Dates", + data => '-ANY-', + templates => { + group => 'icon', + elClass => { + iconImage => 'bg-clr--green circle' + }, + variants => { + iconImage => 'large' + } + } } ), '31.12.2100 zodiac' => test_zci( 'Zodiac for 31 Dec 2100: Capricornus', structured_answer => { - input => ['31 Dec 2100'], - operation => 'Zodiac', - result => 'Capricornus' + id => "zodiac", + name => "Dates", + data => '-ANY-', + templates => { + group => 'icon', + elClass => { + iconImage => 'bg-clr--green circle' + }, + variants => { + iconImage => 'large' + } + } } ), '1 Jan zodiac' => test_zci( 'Zodiac for 01 Jan 2015: Capricornus', structured_answer => { - input => ['01 Jan 2015'], - operation => 'Zodiac', - result => 'Capricornus' + id => "zodiac", + name => "Dates", + data => '-ANY-', + templates => { + group => 'icon', + elClass => { + iconImage => 'bg-clr--green circle' + }, + variants => { + iconImage => 'large' + } + } } ), @@ -322,27 +619,54 @@ ddg_goodie_test([qw( '20 Jan star sign' => test_zci( 'Zodiac for 20 Jan 2015: Aquarius', structured_answer => { - input => ['20 Jan 2015'], - operation => 'Zodiac', - result => 'Aquarius' + id => "zodiac", + name => "Dates", + data => '-ANY-', + templates => { + group => 'icon', + elClass => { + iconImage => 'bg-clr--grey circle' + }, + variants => { + iconImage => 'large' + } + } } ), 'Zodiac 21st Jan' => test_zci( 'Zodiac for 21 Jan 2015: Aquarius', structured_answer => { - input => ['21 Jan 2015'], - operation => 'Zodiac', - result => 'Aquarius' + id => "zodiac", + name => "Dates", + data => '-ANY-', + templates => { + group => 'icon', + elClass => { + iconImage => 'bg-clr--grey circle' + }, + variants => { + iconImage => 'large' + } + } } ), 'StarSign 1st Feb' => test_zci( 'Zodiac for 01 Feb 2015: Aquarius', structured_answer => { - input => ['01 Feb 2015'], - operation => 'Zodiac', - result => 'Aquarius' + id => "zodiac", + name => "Dates", + data => '-ANY-', + templates => { + group => 'icon', + elClass => { + iconImage => 'bg-clr--grey circle' + }, + variants => { + iconImage => 'large' + } + } } ), @@ -350,35 +674,71 @@ ddg_goodie_test([qw( '19 Feb star sign' => test_zci( 'Zodiac for 19 Feb 2015: Pisces', structured_answer => { - input => ['19 Feb 2015'], - operation => 'Zodiac', - result => 'Pisces' + id => "zodiac", + name => "Dates", + data => '-ANY-', + templates => { + group => 'icon', + elClass => { + iconImage => 'bg-clr--blue-light circle' + }, + variants => { + iconImage => 'large' + } + } } ), 'Zodiac 20th Feb 1967' => test_zci( 'Zodiac for 20 Feb 1967: Pisces', - structured_answer => { - input => ['20 Feb 1967'], - operation => 'Zodiac', - result => 'Pisces' + structured_answer => { + id => "zodiac", + name => "Dates", + data => '-ANY-', + templates => { + group => 'icon', + elClass => { + iconImage => 'bg-clr--blue-light circle' + }, + variants => { + iconImage => 'large' + } + } } ), 'StarSign 1st Mar' => test_zci( 'Zodiac for 01 Mar 2015: Pisces', - structured_answer => { - input => ['01 Mar 2015'], - operation => 'Zodiac', - result => 'Pisces' + structured_answer => { + id => "zodiac", + name => "Dates", + data => '-ANY-', + templates => { + group => 'icon', + elClass => { + iconImage => 'bg-clr--blue-light circle' + }, + variants => { + iconImage => 'large' + } + } } ), '20 Mar star sign' => test_zci( 'Zodiac for 20 Mar 2015: Pisces', - structured_answer => { - input => ['20 Mar 2015'], - operation => 'Zodiac', - result => 'Pisces' + structured_answer => { + id => "zodiac", + name => "Dates", + data => '-ANY-', + templates => { + group => 'icon', + elClass => { + iconImage => 'bg-clr--blue-light circle' + }, + variants => { + iconImage => 'large' + } + } } ), From 8c76346533ef029200c9e7c203dd2f9df6d7423c Mon Sep 17 00:00:00 2001 From: JOBIN PHILIP ABRAHAM Date: Sat, 28 Nov 2015 08:32:58 +0530 Subject: [PATCH 160/379] Update gimp.json updaed name,source name and url,desc --- share/goodie/cheat_sheets/json/gimp.json | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/share/goodie/cheat_sheets/json/gimp.json b/share/goodie/cheat_sheets/json/gimp.json index fcf69b480..d932a0fdf 100644 --- a/share/goodie/cheat_sheets/json/gimp.json +++ b/share/goodie/cheat_sheets/json/gimp.json @@ -1,9 +1,10 @@ { "id": "gimp_cheat_sheet", - "name": "Gimp", - "description": "Graphics Editor", + "name": "GIMP", + "description": "Keyboard shortcuts for GIMP(GNU Image Manipulation Program) graphics editor", "metadata": { - "sourceName": "GimpCheatSheet" + "sourceName": "Jeffkayser" + "sourceUrl": "https://jeffkayser.com/static/cheatsheets/cheatsheet_gimp-letter.pdf" }, "template_type": "keyboard", "section_order": [ @@ -460,4 +461,4 @@ } ] } -} \ No newline at end of file +} From 08df2f00b434e8d28b236280c1afd53a30dd6bca Mon Sep 17 00:00:00 2001 From: JOBIN PHILIP ABRAHAM Date: Sat, 28 Nov 2015 08:35:42 +0530 Subject: [PATCH 161/379] Update gimp.json --- share/goodie/cheat_sheets/json/gimp.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/goodie/cheat_sheets/json/gimp.json b/share/goodie/cheat_sheets/json/gimp.json index d932a0fdf..d47f71f50 100644 --- a/share/goodie/cheat_sheets/json/gimp.json +++ b/share/goodie/cheat_sheets/json/gimp.json @@ -3,7 +3,7 @@ "name": "GIMP", "description": "Keyboard shortcuts for GIMP(GNU Image Manipulation Program) graphics editor", "metadata": { - "sourceName": "Jeffkayser" + "sourceName": "Jeffkayser", "sourceUrl": "https://jeffkayser.com/static/cheatsheets/cheatsheet_gimp-letter.pdf" }, "template_type": "keyboard", From 034f680afc6a36d822cbc3d135878b60634bd764 Mon Sep 17 00:00:00 2001 From: amitdev Date: Sat, 28 Nov 2015 09:19:32 +0000 Subject: [PATCH 162/379] Added Scala cheatsheet --- share/goodie/cheat_sheets/json/scala.json | 131 ++++++++++++++++++++++ 1 file changed, 131 insertions(+) create mode 100644 share/goodie/cheat_sheets/json/scala.json diff --git a/share/goodie/cheat_sheets/json/scala.json b/share/goodie/cheat_sheets/json/scala.json new file mode 100644 index 000000000..0f5507ac0 --- /dev/null +++ b/share/goodie/cheat_sheets/json/scala.json @@ -0,0 +1,131 @@ +{ + "id": "scala_cheat_sheet", + "name": "Scala", + "metadata": { + "sourceName": "Scala docs", + "sourceUrl": "http://docs.scala-lang.org/cheatsheets/" + }, + "template_type": "terminal", + "section_order": [ "Program Compilation and Execution", + "Variables", + "Statements", + "Functions", + "Data structures", + "Packages"], + "sections": { + "Program Compilation and Execution" : [ + { + "key" : "scalac Hello.j­ava", + "val" : "Compile Scala File" + }, + { + "key" : "scala Hello", + "val" : "Execute Scala Program" + }, + { + "key" : "scala", + "val" : "Start Scala interactive shell" + } + ], + "Variables": [ + { + "key" : "var x = 5", + "val" : "Variable (type inferred)" + }, + { + "key" : "val x = 5", + "val" : "Constant (type inferred)" + }, + { + "key" : "var x: Double = 5", + "val" : "Variable (explicit type)" + } + ], + "Statements": [ + { + "val" : "If Statement", + "key" : "if (check) happy else sad" + + }, + { + + "val" : "While Loop", + "key" : "while (x < 5) \\{ println(x); x += 1 \\}" + }, + { + "val" : "Do While Loop ", + "key" : "do \\{ println(x); x += 1 \\} while (x < 5)" + + }, + { "val" : "For comprehension - basic iteration", + "key" : "for (i <- 1 to 5) \\{ println(i) \\}" + }, + { "val" : "For comprehension - cross product", + "key" : "for (x <- xs; y <- ys) yield x*y" + }, + { + "val" : "Exce­ption Handling", + "key" : "try \\{ fun(); \\} catch \\{ case e: Exception => println(\"exception caught\"); \\}" + } + ], + "Functions": [ + { + "val" : "Define Function", + "key" : "def square(x: Int) = \\{ x * x \\}" + }, + { + "val" : "Function with call by name parameters", + "key" : "def f(x: => R)" + }, + { + "val" : "Anonymous function", + "key" : "(x:R) => x*x" + }, + { + "val" : "Function currying", + "key" : "def zscore(mean:R, sd:R) = (x:R) => (x-mean)/sd" + } + ], + "Data structures": [ + { + "val" : "Tuple", + "key" : "(1, 2, 3)" + }, + { + "val" : "Tuple unpacking", + "key" : "var (x,y,z) = (1,2,3)" + }, + { + "val" : "List (immutable)", + "key" : "var xs = List(1,2,3)" + }, + { + "val" : "Set (immutable)", + "key" : "var xs = Set(1,2,3)" + }, + { + "val" : "Map (immutable)", + "key" : "Map(1 -> \"one\", 2 -> \"two\")" + } + ], + "Packages": [ + { + "val" : "Selective Import", + "key" : "import scala.collection.Vector" + }, + { + "val" : "Wildcard Import", + "key" : "import scala.collection._" + }, + { + "val" : "Renaming Import", + "key" : "import scala.collection.\\{ Vector => Vec28 \\}" + }, + { + "val" : "Declare Package", + "key" : "package pkg" + } + ] + + } +} From 83d43f37a661acfa9dd690d30ecb406ab2af1527 Mon Sep 17 00:00:00 2001 From: Mailkov Date: Sat, 28 Nov 2015 10:03:18 +0000 Subject: [PATCH 163/379] Issue #1595 - fix image path --- lib/DDG/Goodie/Zodiac.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/DDG/Goodie/Zodiac.pm b/lib/DDG/Goodie/Zodiac.pm index 9a08862dc..0e5e5723d 100644 --- a/lib/DDG/Goodie/Zodiac.pm +++ b/lib/DDG/Goodie/Zodiac.pm @@ -22,7 +22,10 @@ category "dates"; topics "special_interest"; attribution email => 'nomady@zoho.com', github => ['https://github.com/n0mady','NOMADY']; - + + +my $goodieVersion = $DDG::GoodieBundle::OpenSourceDuckDuckGo::VERSION // 999; + my @colors = qw(bg-clr--blue-light bg-clr--green bg-clr--red bg-clr--grey); sub element_sign { @@ -66,7 +69,7 @@ handle remainder => sub { id => "zodiac", name => "Dates", data => { - image => "/share/goodie/zodiac/" . lc($zodiacsign) . ".png", + image => "/share/goodie/zodiac/". $goodieVersion . "/" . lc($zodiacsign) . ".png", title => $zodiacsign, subtitle => $input }, From 18438bd58ff62b3d6cdc7d728b109f8fc5df3db0 Mon Sep 17 00:00:00 2001 From: Mailkov Date: Sat, 28 Nov 2015 10:46:31 +0000 Subject: [PATCH 164/379] Issue #437 - create file Scramble.pm Scramble.t --- lib/DDG/Goodie/Scramble.pm | 80 ++++++++++++++++++++++++++++++++++++++ t/Scramble.t | 22 +++++++++++ 2 files changed, 102 insertions(+) create mode 100644 lib/DDG/Goodie/Scramble.pm create mode 100644 t/Scramble.t diff --git a/lib/DDG/Goodie/Scramble.pm b/lib/DDG/Goodie/Scramble.pm new file mode 100644 index 000000000..97a04e5c4 --- /dev/null +++ b/lib/DDG/Goodie/Scramble.pm @@ -0,0 +1,80 @@ +package DDG::Goodie::Scramble; +# ABSTRACT: Returns an scramble based on the supplied query. + +use strict; +use DDG::Goodie; +use List::Util qw( shuffle ); + +my @keywords = qw(anagram anagrams); +my @connectors = qw(of for); +my @commands = qw(find show); + +my @triggers; +foreach my $kw (@keywords) { + foreach my $con (@connectors) { + push @triggers, join(' ', $kw, $con); # scramble for, scramble of, etc. + foreach my $com (@commands) { + push @triggers, join(' ', $com, $kw, $con); # find scramble of, show scrambles for, etc. + } + } + push @triggers, $kw; # Trigger order appears to matter, so the bare keywords after the others +} + +zci answer_type => 'scramble'; +zci is_cached => 1; + +triggers start => @triggers; + +primary_example_queries "scramble of filter"; +secondary_example_queries "find scramble for partial men"; +description "find the scramble(s) of your query"; +name "Scramble"; +code_url "https://github.com/duckduckgo/zeroclickinfo-goodies/blob/master/lib/DDG/Goodie/Scramble.pm"; +category "transformations"; +topics "words_and_games"; + + +# Handle statement +handle remainder => sub { + + my $remainder = $_; + + # Optional - Guard against no remainder + # I.E. the query is only 'triggerWord' or 'trigger phrase' + # + # return unless $remainder; + + # Optional - Regular expression guard + # Use this approach to ensure the remainder matches a pattern + # I.E. it only contains letters, or numbers, or contains certain words + # + # return unless qr/^\w+|\d{5}$/; + + return "plain text response", + structured_answer => { + + # ID - Must be unique and match Instant Answer page + # E.g. https://duck.co/ia/view/calculator has `id => 'calculator'`` + id => '', + + # Name - Used for Answer Bar Tab + # Value should be chosen from existing Instant Answer topics + # see https://duck.co/duckduckhack/display_reference#codenamecode-emstringem-required + name => 'Answer', + + data => { + title => "My Instant Answer Title", + subtitle => "My Subtitle", + # image => "http://website.com/image.png" + }, + + templates => { + group => "text", + # options => { + # + # } + } + }; +}; + +1; diff --git a/t/Scramble.t b/t/Scramble.t new file mode 100644 index 000000000..bf89979cd --- /dev/null +++ b/t/Scramble.t @@ -0,0 +1,22 @@ +#!/usr/bin/env perl + +use strict; +use warnings; +use Test::More; +use DDG::Test::Goodie; + +zci answer_type => "scramble"; +zci is_cached => 1; + +ddg_goodie_test( + [qw( DDG::Goodie::Scramble )], + # At a minimum, be sure to include tests for all: + # - primary_example_queries + # - secondary_example_queries + 'example query' => test_zci('query'), + # Try to include some examples of queries on which it might + # appear that your answer will trigger, but does not. + 'bad example query' => undef, +); + +done_testing; From 21d41980517d53ad016da006aca6f5be6ebbc6df Mon Sep 17 00:00:00 2001 From: Mailkov Date: Sat, 28 Nov 2015 10:51:27 +0000 Subject: [PATCH 165/379] Issue #1595 - fix name template --- lib/DDG/Goodie/Zodiac.pm | 2 +- t/Zodiac.t | 80 ++++++++++++++++++++-------------------- 2 files changed, 41 insertions(+), 41 deletions(-) diff --git a/lib/DDG/Goodie/Zodiac.pm b/lib/DDG/Goodie/Zodiac.pm index 0e5e5723d..8c5f6f7d8 100644 --- a/lib/DDG/Goodie/Zodiac.pm +++ b/lib/DDG/Goodie/Zodiac.pm @@ -67,7 +67,7 @@ handle remainder => sub { return $result, structured_answer => { id => "zodiac", - name => "Dates", + name => "Answer", data => { image => "/share/goodie/zodiac/". $goodieVersion . "/" . lc($zodiacsign) . ".png", title => $zodiacsign, diff --git a/t/Zodiac.t b/t/Zodiac.t index 422f32ad9..2ceafea88 100644 --- a/t/Zodiac.t +++ b/t/Zodiac.t @@ -17,7 +17,7 @@ ddg_goodie_test([qw( 'Zodiac for 21 Mar 1967: Aries', structured_answer => { id => "zodiac", - name => "Dates", + name => "Answer", data => '-ANY-', templates => { group => 'icon', @@ -35,7 +35,7 @@ ddg_goodie_test([qw( 'Zodiac for 30 Mar 2015: Aries', structured_answer => { id => "zodiac", - name => "Dates", + name => "Answer", data => '-ANY-', templates => { group => 'icon', @@ -53,7 +53,7 @@ ddg_goodie_test([qw( 'Zodiac for 20 Apr 2015: Aries', structured_answer => { id => "zodiac", - name => "Dates", + name => "Answer", data => '-ANY-', templates => { group => 'icon', @@ -72,7 +72,7 @@ ddg_goodie_test([qw( 'Zodiac for 21 Apr 2014: Taurus', structured_answer => { id => "zodiac", - name => "Dates", + name => "Answer", data => '-ANY-', templates => { group => 'icon', @@ -89,7 +89,7 @@ ddg_goodie_test([qw( 'Zodiac for 27 Apr 2015: Taurus', structured_answer => { id => "zodiac", - name => "Dates", + name => "Answer", data => '-ANY-', templates => { group => 'icon', @@ -108,7 +108,7 @@ ddg_goodie_test([qw( 'Zodiac for 21 May 2015: Gemini', structured_answer => { id => "zodiac", - name => "Dates", + name => "Answer", data => '-ANY-', templates => { group => 'icon', @@ -126,7 +126,7 @@ ddg_goodie_test([qw( 'Zodiac for 22 May 1500: Gemini', structured_answer => { id => "zodiac", - name => "Dates", + name => "Answer", data => '-ANY-', templates => { group => 'icon', @@ -144,7 +144,7 @@ ddg_goodie_test([qw( 'Zodiac for 21 May 1965: Gemini', structured_answer => { id => "zodiac", - name => "Dates", + name => "Answer", data => '-ANY-', templates => { group => 'icon', @@ -162,7 +162,7 @@ ddg_goodie_test([qw( 'Zodiac for 31 May 2015: Gemini', structured_answer => { id => "zodiac", - name => "Dates", + name => "Answer", data => '-ANY-', templates => { group => 'icon', @@ -180,7 +180,7 @@ ddg_goodie_test([qw( 'Zodiac for 21 Jun 2015: Gemini', structured_answer => { id => "zodiac", - name => "Dates", + name => "Answer", data => '-ANY-', templates => { group => 'icon', @@ -199,7 +199,7 @@ ddg_goodie_test([qw( 'Zodiac for 22 Jun 1889: Cancer', structured_answer => { id => "zodiac", - name => "Dates", + name => "Answer", data => '-ANY-', templates => { group => 'icon', @@ -217,7 +217,7 @@ ddg_goodie_test([qw( 'Zodiac for 30 Jun 2017: Cancer', structured_answer => { id => "zodiac", - name => "Dates", + name => "Answer", data => '-ANY-', templates => { group => 'icon', @@ -235,7 +235,7 @@ ddg_goodie_test([qw( 'Zodiac for 22 Jul 2015: Cancer', structured_answer => { id => "zodiac", - name => "Dates", + name => "Answer", data => '-ANY-', templates => { group => 'icon', @@ -254,7 +254,7 @@ ddg_goodie_test([qw( 'Zodiac for 23 Jul 1654: Leo', structured_answer => { id => "zodiac", - name => "Dates", + name => "Answer", data => '-ANY-', templates => { group => 'icon', @@ -272,7 +272,7 @@ ddg_goodie_test([qw( 'Zodiac for 24 Jul 2015: Leo', structured_answer => { id => "zodiac", - name => "Dates", + name => "Answer", data => '-ANY-', templates => { group => 'icon', @@ -290,7 +290,7 @@ ddg_goodie_test([qw( 'Zodiac for 22 Aug 2015: Leo', structured_answer => { id => "zodiac", - name => "Dates", + name => "Answer", data => '-ANY-', templates => { group => 'icon', @@ -308,7 +308,7 @@ ddg_goodie_test([qw( 'Zodiac for 23 Aug 1700: Leo', structured_answer => { id => "zodiac", - name => "Dates", + name => "Answer", data => '-ANY-', templates => { group => 'icon', @@ -327,7 +327,7 @@ ddg_goodie_test([qw( 'Zodiac for 01 Sep 2015: Virgo', structured_answer => { id => "zodiac", - name => "Dates", + name => "Answer", data => '-ANY-', templates => { group => 'icon', @@ -346,7 +346,7 @@ ddg_goodie_test([qw( 'Zodiac for 23 Sep 2015: Libra', structured_answer => { id => "zodiac", - name => "Dates", + name => "Answer", data => '-ANY-', templates => { group => 'icon', @@ -364,7 +364,7 @@ ddg_goodie_test([qw( 'Zodiac for 24 Sep 2001: Libra', structured_answer => { id => "zodiac", - name => "Dates", + name => "Answer", data => '-ANY-', templates => { group => 'icon', @@ -382,7 +382,7 @@ ddg_goodie_test([qw( 'Zodiac for 07 Oct 2015: Libra', structured_answer => { id => "zodiac", - name => "Dates", + name => "Answer", data => '-ANY-', templates => { group => 'icon', @@ -401,7 +401,7 @@ ddg_goodie_test([qw( 'Zodiac for 23 Oct 2015: Scorpius', structured_answer => { id => "zodiac", - name => "Dates", + name => "Answer", data => '-ANY-', templates => { group => 'icon', @@ -419,7 +419,7 @@ ddg_goodie_test([qw( 'Zodiac for 24 Oct 1213: Scorpius', structured_answer => { id => "zodiac", - name => "Dates", + name => "Answer", data => '-ANY-', templates => { group => 'icon', @@ -437,7 +437,7 @@ ddg_goodie_test([qw( 'Zodiac for 09 Nov 2015: Scorpius', structured_answer => { id => "zodiac", - name => "Dates", + name => "Answer", data => '-ANY-', templates => { group => 'icon', @@ -456,7 +456,7 @@ ddg_goodie_test([qw( 'Zodiac for 22 Nov 2015: Sagittarius', structured_answer => { id => "zodiac", - name => "Dates", + name => "Answer", data => '-ANY-', templates => { group => 'icon', @@ -474,7 +474,7 @@ ddg_goodie_test([qw( 'Zodiac for 23 Nov 1857: Sagittarius', structured_answer => { id => "zodiac", - name => "Dates", + name => "Answer", data => '-ANY-', templates => { group => 'icon', @@ -492,7 +492,7 @@ ddg_goodie_test([qw( 'Zodiac for 06 Dec 2015: Sagittarius', structured_answer => { id => "zodiac", - name => "Dates", + name => "Answer", data => '-ANY-', templates => { group => 'icon', @@ -510,7 +510,7 @@ ddg_goodie_test([qw( 'Zodiac for 21 Dec 2015: Sagittarius', structured_answer => { id => "zodiac", - name => "Dates", + name => "Answer", data => '-ANY-', templates => { group => 'icon', @@ -529,7 +529,7 @@ ddg_goodie_test([qw( 'Zodiac for 22 Dec 2015: Capricornus', structured_answer => { id => "zodiac", - name => "Dates", + name => "Answer", data => '-ANY-', templates => { group => 'icon', @@ -547,7 +547,7 @@ ddg_goodie_test([qw( 'Zodiac for 23 Dec 1378: Capricornus', structured_answer => { id => "zodiac", - name => "Dates", + name => "Answer", data => '-ANY-', templates => { group => 'icon', @@ -565,7 +565,7 @@ ddg_goodie_test([qw( 'Zodiac for 31 Dec 2009: Capricornus', structured_answer => { id => "zodiac", - name => "Dates", + name => "Answer", data => '-ANY-', templates => { group => 'icon', @@ -583,7 +583,7 @@ ddg_goodie_test([qw( 'Zodiac for 31 Dec 2100: Capricornus', structured_answer => { id => "zodiac", - name => "Dates", + name => "Answer", data => '-ANY-', templates => { group => 'icon', @@ -601,7 +601,7 @@ ddg_goodie_test([qw( 'Zodiac for 01 Jan 2015: Capricornus', structured_answer => { id => "zodiac", - name => "Dates", + name => "Answer", data => '-ANY-', templates => { group => 'icon', @@ -620,7 +620,7 @@ ddg_goodie_test([qw( 'Zodiac for 20 Jan 2015: Aquarius', structured_answer => { id => "zodiac", - name => "Dates", + name => "Answer", data => '-ANY-', templates => { group => 'icon', @@ -638,7 +638,7 @@ ddg_goodie_test([qw( 'Zodiac for 21 Jan 2015: Aquarius', structured_answer => { id => "zodiac", - name => "Dates", + name => "Answer", data => '-ANY-', templates => { group => 'icon', @@ -656,7 +656,7 @@ ddg_goodie_test([qw( 'Zodiac for 01 Feb 2015: Aquarius', structured_answer => { id => "zodiac", - name => "Dates", + name => "Answer", data => '-ANY-', templates => { group => 'icon', @@ -675,7 +675,7 @@ ddg_goodie_test([qw( 'Zodiac for 19 Feb 2015: Pisces', structured_answer => { id => "zodiac", - name => "Dates", + name => "Answer", data => '-ANY-', templates => { group => 'icon', @@ -693,7 +693,7 @@ ddg_goodie_test([qw( 'Zodiac for 20 Feb 1967: Pisces', structured_answer => { id => "zodiac", - name => "Dates", + name => "Answer", data => '-ANY-', templates => { group => 'icon', @@ -710,7 +710,7 @@ ddg_goodie_test([qw( 'Zodiac for 01 Mar 2015: Pisces', structured_answer => { id => "zodiac", - name => "Dates", + name => "Answer", data => '-ANY-', templates => { group => 'icon', @@ -728,7 +728,7 @@ ddg_goodie_test([qw( 'Zodiac for 20 Mar 2015: Pisces', structured_answer => { id => "zodiac", - name => "Dates", + name => "Answer", data => '-ANY-', templates => { group => 'icon', From 541108b7f8bba9b775e12bc56436ea4308fc3e3c Mon Sep 17 00:00:00 2001 From: Mailkov Date: Sat, 28 Nov 2015 11:29:40 +0000 Subject: [PATCH 166/379] Issue #437 - fix Anagram.pm answers only with anagrams --- lib/DDG/Goodie/Anagram.pm | 6 ++---- t/Anagram.t | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/DDG/Goodie/Anagram.pm b/lib/DDG/Goodie/Anagram.pm index 38255ee05..817d3d06c 100644 --- a/lib/DDG/Goodie/Anagram.pm +++ b/lib/DDG/Goodie/Anagram.pm @@ -102,10 +102,8 @@ handle remainder => sub { $response = join ', ', sort { $a cmp $b } @output; $operation = 'Anagrams of'; } else { - do { - $response = join '', shuffle split(//, $word); - } while (length($word) > 1 && $response eq $word); - $operation = 'Scrambled letters of'; + $response = ''; + $operation = 'There is not anagrams for '; } return $response, diff --git a/t/Anagram.t b/t/Anagram.t index 801dcfc83..dd71a17d5 100644 --- a/t/Anagram.t +++ b/t/Anagram.t @@ -38,7 +38,7 @@ ddg_goodie_test( '-ANY-', structured_answer => { input => ['favorite'], - operation => 'Scrambled letters of', + operation => 'There is not anagrams for ', result => '-ANY-', } ), @@ -46,7 +46,7 @@ ddg_goodie_test( '-ANY-', structured_answer => { input => ['Mixing it up'], - operation => 'Scrambled letters of', + operation => 'There is not anagrams for ', result => '-ANY-', } ), From a78ff68b3ce68ca4a21f535f18721eadd7320693 Mon Sep 17 00:00:00 2001 From: JOBIN PHILIP ABRAHAM Date: Sat, 28 Nov 2015 19:57:09 +0530 Subject: [PATCH 167/379] Update gimp.json --- share/goodie/cheat_sheets/json/gimp.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/goodie/cheat_sheets/json/gimp.json b/share/goodie/cheat_sheets/json/gimp.json index d47f71f50..27f61aba0 100644 --- a/share/goodie/cheat_sheets/json/gimp.json +++ b/share/goodie/cheat_sheets/json/gimp.json @@ -1,7 +1,7 @@ { "id": "gimp_cheat_sheet", "name": "GIMP", - "description": "Keyboard shortcuts for GIMP(GNU Image Manipulation Program) graphics editor", + "description": "Keyboard shortcuts for GIMP (GNU Image Manipulation Program) graphics editor", "metadata": { "sourceName": "Jeffkayser", "sourceUrl": "https://jeffkayser.com/static/cheatsheets/cheatsheet_gimp-letter.pdf" From aa48a8076524663a1860891e882b40c535630c8c Mon Sep 17 00:00:00 2001 From: mickeypash Date: Sat, 28 Nov 2015 19:49:10 +0000 Subject: [PATCH 168/379] Removed redundant files from the pull request --- lib/DDG/Goodie/IsAwesome/mickeypash.pm | 34 -------------------------- t/IsAwesome/mickeypash.t | 19 -------------- 2 files changed, 53 deletions(-) delete mode 100644 lib/DDG/Goodie/IsAwesome/mickeypash.pm delete mode 100644 t/IsAwesome/mickeypash.t diff --git a/lib/DDG/Goodie/IsAwesome/mickeypash.pm b/lib/DDG/Goodie/IsAwesome/mickeypash.pm deleted file mode 100644 index f99b8eb3e..000000000 --- a/lib/DDG/Goodie/IsAwesome/mickeypash.pm +++ /dev/null @@ -1,34 +0,0 @@ -package DDG::Goodie::IsAwesome::mickeypash; -# ABSTRACT: Write an abstract here -# Start at https://duck.co/duckduckhack/goodie_overview if you are new -# to instant answer development - -use DDG::Goodie; -use strict; - -zci answer_type => "is_awesome_mickeypash"; -zci is_cached => 1; - -# Metadata. See https://duck.co/duckduckhack/metadata for help in filling out this section. -name "IsAwesome mickeypash"; -description "Succinct explanation of what this instant answer does"; -primary_example_queries "first example query", "second example query"; -secondary_example_queries "optional -- demonstrate any additional triggers"; -# Uncomment and complete: https://duck.co/duckduckhack/metadata#category -# category ""; -# Uncomment and complete: https://duck.co/duckduckhack/metadata#topics -# topics ""; -code_url "https://github.com/duckduckgo/zeroclickinfo-goodies/blob/master/lib/DDG/Goodie/IsAwesome/mickeypash.pm"; -attribution github => ["mickeypash", "Mickey Pash"], - twitter => "mickeypash"; - -# Triggers -triggers start => "duckduckhack mickeypash"; - -# Handle statement -handle remainder => sub { - return if $_; - return "mickeypash is awesome and has successfully completed the DuckDuckHack Goodie tutorial!"; -}; - -1; diff --git a/t/IsAwesome/mickeypash.t b/t/IsAwesome/mickeypash.t deleted file mode 100644 index ef8158890..000000000 --- a/t/IsAwesome/mickeypash.t +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env perl - -use strict; -use warnings; -use Test::More; -use DDG::Test::Goodie; - -zci answer_type => "is_awesome_mickeypash"; -zci is_cached => 1; - -ddg_goodie_test( - [qw( - DDG::Goodie::IsAwesome::mickeypash - )], - 'duckduckhack mickeypash' => test_zci('mickeypash is awesome and has successfully completed the DuckDuckHack Goodie tutorial!'), - 'duckduckhack mickeypash is awesome' => undef, -); - -done_testing; From 4f7ce0b98e967bd5015a3ecd2f033e51dbbab478 Mon Sep 17 00:00:00 2001 From: mickeypash Date: Sat, 28 Nov 2015 19:53:32 +0000 Subject: [PATCH 169/379] Change the name to Bulgarian Phrases --- share/goodie/cheat_sheets/bulgarian.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/goodie/cheat_sheets/bulgarian.json b/share/goodie/cheat_sheets/bulgarian.json index 1bf412048..85e89af8e 100644 --- a/share/goodie/cheat_sheets/bulgarian.json +++ b/share/goodie/cheat_sheets/bulgarian.json @@ -1,6 +1,6 @@ { "id" : "bulgarian_cheat_sheet", - "name" : "Bulgarian Cheat Sheet", + "name" : "Bulgarian Phrases", "metadata" : { "sourceName" : "Linguanaut", "sourceUrl" : "http://www.linguanaut.com/english_bulgarian.htm" From b4ac09f232a51eb1dab1eb4dd72f48060f7469a8 Mon Sep 17 00:00:00 2001 From: jonk1993 Date: Sat, 28 Nov 2015 20:38:44 +0000 Subject: [PATCH 170/379] merged with master --- share/goodie/cheat_sheets/json/starcraft2.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/goodie/cheat_sheets/json/starcraft2.json b/share/goodie/cheat_sheets/json/starcraft2.json index 56570b77d..be4240fec 100644 --- a/share/goodie/cheat_sheets/json/starcraft2.json +++ b/share/goodie/cheat_sheets/json/starcraft2.json @@ -12,7 +12,7 @@ "sc2" ], "template_type": "reference", - "section_order": ["Resources and Research", "Units", "Game Modifications", "Wings of Liberty Only"], + "section_order": ["Resources and Research", "Game Modifications", "Units", "Wings of Liberty Only"], "sections": { "Units": [ { @@ -102,7 +102,7 @@ "val": "Opens all missions" }, { - "key": "horadriccube", + "key": "HoradricCube", "val": "Opens all research options" }, { From 4e4224dd8cdb40360d77a49d035d78b052288df0 Mon Sep 17 00:00:00 2001 From: amitdev Date: Sun, 29 Nov 2015 04:53:46 +0000 Subject: [PATCH 171/379] Changed source to scala lang --- share/goodie/cheat_sheets/json/scala.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/goodie/cheat_sheets/json/scala.json b/share/goodie/cheat_sheets/json/scala.json index 0f5507ac0..7e1fb865e 100644 --- a/share/goodie/cheat_sheets/json/scala.json +++ b/share/goodie/cheat_sheets/json/scala.json @@ -2,7 +2,7 @@ "id": "scala_cheat_sheet", "name": "Scala", "metadata": { - "sourceName": "Scala docs", + "sourceName": "Scala-Lang", "sourceUrl": "http://docs.scala-lang.org/cheatsheets/" }, "template_type": "terminal", From 3826aba60eb22699f0ab33cb208e1c0c2006ba6c Mon Sep 17 00:00:00 2001 From: JOBIN PHILIP ABRAHAM Date: Sun, 29 Nov 2015 11:32:28 +0530 Subject: [PATCH 172/379] Update gimp.json --- share/goodie/cheat_sheets/json/gimp.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/goodie/cheat_sheets/json/gimp.json b/share/goodie/cheat_sheets/json/gimp.json index 27f61aba0..c15278e87 100644 --- a/share/goodie/cheat_sheets/json/gimp.json +++ b/share/goodie/cheat_sheets/json/gimp.json @@ -4,7 +4,7 @@ "description": "Keyboard shortcuts for GIMP (GNU Image Manipulation Program) graphics editor", "metadata": { "sourceName": "Jeffkayser", - "sourceUrl": "https://jeffkayser.com/static/cheatsheets/cheatsheet_gimp-letter.pdf" + "sourceUrl": "https://jeffkayser.com/static/cheatsheets/cheatsheet_gimp.png" }, "template_type": "keyboard", "section_order": [ From 45d324384cfba8547ed91970cccaaf241578661b Mon Sep 17 00:00:00 2001 From: JOBIN PHILIP ABRAHAM Date: Sun, 29 Nov 2015 11:42:38 +0530 Subject: [PATCH 173/379] Update ed.json updated name ,desc ,source name and section names --- share/goodie/cheat_sheets/json/ed.json | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/share/goodie/cheat_sheets/json/ed.json b/share/goodie/cheat_sheets/json/ed.json index b7a86878c..fe4055c84 100644 --- a/share/goodie/cheat_sheets/json/ed.json +++ b/share/goodie/cheat_sheets/json/ed.json @@ -1,17 +1,17 @@ { "id": "ed_cheat_sheet", - "name": "ed(1)", - "description": "Line-oriented Text Editor", + "name": "ed", + "description": "Basic commands for ed, a line-oriented text editor", "metadata": { - "sourceName": "EdCheatSheet", + "sourceName": "Freebsd", "sourceUrl": "https://www.freebsd.org/cgi/man.cgi?ed%281%29" }, "template_type": "keyboard", "section_order": [ - "Editing commands", - "File manipulation commands", - "Display commands", - "Other commands", + "Editing Commands", + "File Manipulation Commands", + "Display Commands", + "Other Commands", "Addressing", "Invocation" ], @@ -76,7 +76,7 @@ "val": "A line marked with {letter} (see the [k] command below)" } ], - "Editing commands": [ + "Editing Commands": [ { "key": "[.]a", "val": "Insert below the current line, end with a single period" @@ -118,7 +118,7 @@ "val": "Copy (yank) the specified range (GNU extension)" } ], - "File manipulation commands": [ + "File Manipulation Commands": [ { "key": "e \\[filename\\]", "val": "Edit the file [filename]" @@ -172,7 +172,7 @@ "val": "Prompt for the DES encryption key (BSD extension)" } ], - "Display commands": [ + "Display Commands": [ { "key": "h", "val": "Print help on the last error" @@ -202,7 +202,7 @@ "val": "Display N lines of text" } ], - "Other commands": [ + "Other Commands": [ { "key": "[1,$]g/\\{re\\}/\\{command-list\\}", "val": "Execute {command-list} on all lines matching {re}" From acca9affcd813257bcf6e548a16388cd53b580aa Mon Sep 17 00:00:00 2001 From: Mailkov Date: Sun, 29 Nov 2015 14:28:36 +0000 Subject: [PATCH 174/379] Issue #437 - fix grammar error --- lib/DDG/Goodie/Anagram.pm | 2 +- t/Anagram.t | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/DDG/Goodie/Anagram.pm b/lib/DDG/Goodie/Anagram.pm index 817d3d06c..98a8a5ba0 100644 --- a/lib/DDG/Goodie/Anagram.pm +++ b/lib/DDG/Goodie/Anagram.pm @@ -103,7 +103,7 @@ handle remainder => sub { $operation = 'Anagrams of'; } else { $response = ''; - $operation = 'There is not anagrams for '; + $operation = 'There are no anagrams for '; } return $response, diff --git a/t/Anagram.t b/t/Anagram.t index dd71a17d5..b806dc9c1 100644 --- a/t/Anagram.t +++ b/t/Anagram.t @@ -38,7 +38,7 @@ ddg_goodie_test( '-ANY-', structured_answer => { input => ['favorite'], - operation => 'There is not anagrams for ', + operation => 'There are no anagrams for ', result => '-ANY-', } ), @@ -46,7 +46,7 @@ ddg_goodie_test( '-ANY-', structured_answer => { input => ['Mixing it up'], - operation => 'There is not anagrams for ', + operation => 'There are no anagrams for ', result => '-ANY-', } ), From 71a3a005739aa5785ad38902678f341055b6bd02 Mon Sep 17 00:00:00 2001 From: Mailkov Date: Sun, 29 Nov 2015 15:29:14 +0000 Subject: [PATCH 175/379] Issue #437 - end Scramble.pm Scramble.t --- lib/DDG/Goodie/Scramble.pm | 62 ++++++++++++++++++++++---------------- t/Scramble.t | 24 ++++++++++----- 2 files changed, 53 insertions(+), 33 deletions(-) diff --git a/lib/DDG/Goodie/Scramble.pm b/lib/DDG/Goodie/Scramble.pm index 97a04e5c4..0a426baf3 100644 --- a/lib/DDG/Goodie/Scramble.pm +++ b/lib/DDG/Goodie/Scramble.pm @@ -5,7 +5,7 @@ use strict; use DDG::Goodie; use List::Util qw( shuffle ); -my @keywords = qw(anagram anagrams); +my @keywords = qw(scramble scrambles); my @connectors = qw(of for); my @commands = qw(find show); @@ -33,46 +33,56 @@ code_url "https://github.com/duckduckgo/zeroclickinfo-goodies/blob/master/lib/DD category "transformations"; topics "words_and_games"; +# Calculate the frequency of the characters in a string +sub calc_freq { + my ($str) = @_; + my %freqs; + + for (split //, lc $str) { + $freqs{$_} += 1; + } + + return \%freqs; +} # Handle statement handle remainder => sub { - my $remainder = $_; + my $word = $_; + $word =~ s/^"(.*)"$/$1/; - # Optional - Guard against no remainder - # I.E. the query is only 'triggerWord' or 'trigger phrase' - # - # return unless $remainder; + return unless $word; # Need a word. + + my $match_word = lc $word; + $match_word =~ s/[^a-z]//g; + return unless $match_word; - # Optional - Regular expression guard - # Use this approach to ensure the remainder matches a pattern - # I.E. it only contains letters, or numbers, or contains certain words - # - # return unless qr/^\w+|\d{5}$/; + my $response; + do { + $response = join '', shuffle split(//, $word); + } while (length($word) > 1 && $response eq $word); - return "plain text response", + my $operation; + if ($response) { + $operation = 'Scramble of'; + } else { + $response = ''; + $operation = 'There are no scrambles of'; + } + + return $operation . ' ' . $word, structured_answer => { - # ID - Must be unique and match Instant Answer page - # E.g. https://duck.co/ia/view/calculator has `id => 'calculator'`` - id => '', - - # Name - Used for Answer Bar Tab - # Value should be chosen from existing Instant Answer topics - # see https://duck.co/duckduckhack/display_reference#codenamecode-emstringem-required - name => 'Answer', + id => 'scramble', + name => 'Words & games', data => { - title => "My Instant Answer Title", - subtitle => "My Subtitle", - # image => "http://website.com/image.png" + title => $response, + subtitle => $operation . ' ' . $word, }, templates => { group => "text", - # options => { - # - # } } }; }; diff --git a/t/Scramble.t b/t/Scramble.t index bf89979cd..3ffd9dfbe 100644 --- a/t/Scramble.t +++ b/t/Scramble.t @@ -10,13 +10,23 @@ zci is_cached => 1; ddg_goodie_test( [qw( DDG::Goodie::Scramble )], - # At a minimum, be sure to include tests for all: - # - primary_example_queries - # - secondary_example_queries - 'example query' => test_zci('query'), - # Try to include some examples of queries on which it might - # appear that your answer will trigger, but does not. - 'bad example query' => undef, + 'scramble of filter' => test_zci( + 'Scramble of filter', + structured_answer => { + id => 'scramble', + name => 'Words & games', + + data => '-ANY-', + + templates => { + group => "text", + } + }, + ), + 'scramble of' => undef, + 'Scramble for' => undef, + 'Scrambles for ""' => undef, + 'Scrambles for "867-5309"' => undef, ); done_testing; From db789be089f7914adb9c95621dcc1cc2ad03c880 Mon Sep 17 00:00:00 2001 From: Mailkov Date: Sun, 29 Nov 2015 15:38:04 +0000 Subject: [PATCH 176/379] Issue #437 - fix scramble of words --- lib/DDG/Goodie/Scramble.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/DDG/Goodie/Scramble.pm b/lib/DDG/Goodie/Scramble.pm index 0a426baf3..fcc72be84 100644 --- a/lib/DDG/Goodie/Scramble.pm +++ b/lib/DDG/Goodie/Scramble.pm @@ -59,8 +59,8 @@ handle remainder => sub { my $response; do { - $response = join '', shuffle split(//, $word); - } while (length($word) > 1 && $response eq $word); + $response = join '', shuffle split(//, $match_word); + } while (length($match_word) > 1 && $response eq $match_word); my $operation; if ($response) { From fc154e1108c12e91d446e740f734afa7c7386620 Mon Sep 17 00:00:00 2001 From: Mailkov Date: Sun, 29 Nov 2015 15:48:55 +0000 Subject: [PATCH 177/379] Issue #437 - add attribution --- lib/DDG/Goodie/Scramble.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/DDG/Goodie/Scramble.pm b/lib/DDG/Goodie/Scramble.pm index fcc72be84..5029129ef 100644 --- a/lib/DDG/Goodie/Scramble.pm +++ b/lib/DDG/Goodie/Scramble.pm @@ -33,6 +33,11 @@ code_url "https://github.com/duckduckgo/zeroclickinfo-goodies/blob/master/lib/DD category "transformations"; topics "words_and_games"; +attribution github => ["https://github.com/loganom", 'loganom'], + github => ["https://github.com/beardlybread", "beardlybread"], + github => ['https://github.com/gdrooid', 'gdrooid'], + email => ['gdrooid@openmailbox.org', 'gdrooid']; + # Calculate the frequency of the characters in a string sub calc_freq { my ($str) = @_; From ce846a3323691ccba41869ea8994f43233de8ce9 Mon Sep 17 00:00:00 2001 From: Zaahir Moolla Date: Sun, 29 Nov 2015 10:52:51 -0500 Subject: [PATCH 178/379] Used escaped markdown so the raw markdown isn't required This should simplify things. Clearly, many people aren't reading/understanding the current instructions --- pull_request_template_cheat_sheet.md | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/pull_request_template_cheat_sheet.md b/pull_request_template_cheat_sheet.md index 9f61f30a7..9b36644e2 100644 --- a/pull_request_template_cheat_sheet.md +++ b/pull_request_template_cheat_sheet.md @@ -2,42 +2,42 @@ ## How To Use This Template -1) Use the **raw** text at https://raw.githubusercontent.com/duckduckgo/zeroclickinfo-goodies/master/pull_request_template_cheat_sheet.md +1) Copy and paste the questions below into the description of your GitHub pull request -2) Copy and paste the questions (from the raw text) into the description of your GitHub pull request and fill in the questions there, as appropriate. +2) Fill in the answers to the questions as needed -3) Preview the text before posting by clicking the "Preview changes" button above text box. The questions should remain bolded so it's easier for everyone to read +3) Preview the text before posting by clicking the "**Preview changes**" button above the text box (The questions should be bolded so it's easier for everyone to read) -4) Do not include these instructions when you paste the questions into the Pull Request description! +4) Do ***not*** include these instructions when you paste the questions into the Pull Request description! ## Demo ![Demo GIF](http://cl.ly/image/1O0n39092K3q/download/Screen%20Recording%202015-08-29%20at%2009.31%20AM.gif) -## Copy and Paste the Raw Text Below Into Your Pull Request +## Copy and Paste the Text Below Into Your Pull Request -**What does your Instant Answer do?** +\*\*What does your Instant Answer do?\*\* -**What is the data source for your Instant Answer? (Provide a link if possible)** +\*\*What is the data source for your Instant Answer? (Provide a link if possible)\*\* -**Why did you choose this data source?** +\*\*Why did you choose this data source?\*\* -**Are there any other alternative (better) data sources?** +\*\*Are there any other alternative (better) data sources?\*\* -**Which communities will this Instant Answer be especially useful for? (gamers, book lovers, etc)** +\*\*Which communities will this Instant Answer be especially useful for? (gamers, book lovers, etc)\*\* -**Is this Instant Answer connected to a DuckDuckHack [Instant Answer idea](https://duck.co/ideas)?** +\*\*Is this Instant Answer connected to a DuckDuckHack [Instant Answer idea](https://duck.co/ideas)?\*\* -**Are you having any problems? Do you need our help with anything?** +\*\*Are you having any problems? Do you need our help with anything?\*\* -**Where did you hear about DuckDuckHack? (For first time contributors)** +\*\*Where did you hear about DuckDuckHack? (For first time contributors)\*\* -**What does the Instant Answer look like? (Provide a screenshot for new or updated Instant Answers)** +\*\*What does the Instant Answer look like? (Provide a screenshot for new or updated Instant Answers)\*\* From 0663a6b863727cb20ebac73a1343c9207a978218 Mon Sep 17 00:00:00 2001 From: Mailkov Date: Sun, 29 Nov 2015 16:23:49 +0000 Subject: [PATCH 179/379] Issue #437 - modified answer --- lib/DDG/Goodie/Scramble.pm | 4 ++-- t/Scramble.t | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/DDG/Goodie/Scramble.pm b/lib/DDG/Goodie/Scramble.pm index 5029129ef..7e62a0bc2 100644 --- a/lib/DDG/Goodie/Scramble.pm +++ b/lib/DDG/Goodie/Scramble.pm @@ -83,11 +83,11 @@ handle remainder => sub { data => { title => $response, - subtitle => $operation . ' ' . $word, + subtitle => $operation . ' ' . $word }, templates => { - group => "text", + group => "text" } }; }; diff --git a/t/Scramble.t b/t/Scramble.t index 3ffd9dfbe..38470acca 100644 --- a/t/Scramble.t +++ b/t/Scramble.t @@ -19,7 +19,7 @@ ddg_goodie_test( data => '-ANY-', templates => { - group => "text", + group => "text" } }, ), From 2b8014983375e2e200f3878dc4d902898f6c9d0d Mon Sep 17 00:00:00 2001 From: jonk1993 Date: Sun, 29 Nov 2015 18:37:19 +0000 Subject: [PATCH 180/379] Addressed PR comments: removed 'cheat sheet' from name and removed 'starcraft2' from aliases --- share/goodie/cheat_sheets/json/starcraft2.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/share/goodie/cheat_sheets/json/starcraft2.json b/share/goodie/cheat_sheets/json/starcraft2.json index be4240fec..906fb6b25 100644 --- a/share/goodie/cheat_sheets/json/starcraft2.json +++ b/share/goodie/cheat_sheets/json/starcraft2.json @@ -1,13 +1,12 @@ { "id": "starcraft2_cheat_sheet", - "name": "Starcraft 2 Cheat Sheet", + "name": "Starcraft 2", "description": "Cheat codes for the campaign and offline custom games of Starcraft 2", "metadata": { "sourceName": "Battle.net Cheats", "sourceUrl": "http://us.battle.net/sc2/en/blog/9135373/game-guide-starcraft-ii-cheat-codes-3-1-2012" }, "aliases": [ - "starcraft2", "starcraft 2", "sc2" ], From 40734f7e4a2ba67fb679c0063070bf8e08f98b10 Mon Sep 17 00:00:00 2001 From: tagawa Date: Mon, 30 Nov 2015 07:46:52 +0000 Subject: [PATCH 181/379] Added Japanese prefectures cheat sheet --- .../json/japanese-prefectures.json | 232 ++++++++++++++++++ 1 file changed, 232 insertions(+) create mode 100644 share/goodie/cheat_sheets/json/japanese-prefectures.json diff --git a/share/goodie/cheat_sheets/json/japanese-prefectures.json b/share/goodie/cheat_sheets/json/japanese-prefectures.json new file mode 100644 index 000000000..930a0d415 --- /dev/null +++ b/share/goodie/cheat_sheets/json/japanese-prefectures.json @@ -0,0 +1,232 @@ +{ + "id": "japanese_prefectures_cheat_sheet", + "name": "Japanese Prefectures", + "description": "Japanese prefectures grouped by region, along with their capital cities", + "metadata": { + "sourceName": "Wikipedia", + "sourceUrl": "https://en.wikipedia.org/wiki/Prefectures_of_Japan" + }, + "aliases": [ + "japan prefecture", + "japan prefectures", + "japanese prefecture", + "prefectures of japan" + ], + "template_type": "reference", + "section_order": [ + "Hokkaidō", + "Tōhoku", + "Kantō", + "Chūbu", + "Kansai", + "Chūgoku", + "Shikoku", + "Kyūshū" + ], + "sections": { + "Hokkaidō": [ + { + "key": "Hokkaidō (北海道)", + "val": "Sapporō (札幌市)" + } + ], + "Tōhoku": [ + { + "key": "Aomori (青森県)", + "val": "Aomori (青森市)" + }, + { + "key": "Iwate (岩手県)", + "val": "Morioka (盛岡市)" + }, + { + "key": "Miyagi (宮城県)", + "val": "Sendai (仙台市)" + }, + { + "key": "Akita (秋田県)", + "val": "Akita (秋田市)" + }, + { + "key": "Yamagata (山形県)", + "val": "Yamagata (山形市)" + }, + { + "key": "Fukushima (福島県)", + "val": "Fukushima (福島市)" + } + ], + "Kantō": [ + { + "key": "Ibaraki (茨城県)", + "val": "Mito (水戸市)" + }, + { + "key": "Tochigi (栃木県)", + "val": "Utsunomiya (宇都宮市)" + }, + { + "key": "Gunma (群馬県)", + "val": "Maebashi (前橋市)" + }, + { + "key": "Saitama (埼玉県)", + "val": "Saitama (さいたま市)" + }, + { + "key": "Chiba (千葉県)", + "val": "Chiba (千葉市)" + }, + { + "key": "Tōkyō (東京都)", + "val": "Tōkyō (東京)" + }, + { + "key": "Kanagawa (神奈川県)", + "val": "Yokohama (横浜市)" + } + ], + "Chūbu": [ + { + "key": "Niigata (新潟県)", + "val": "Niigata (新潟市)" + }, + { + "key": "Toyama (富山県)", + "val": "Toyama (富山市)" + }, + { + "key": "Ishikawa (石川県)", + "val": "Kanazawa (金沢市)" + }, + { + "key": "Fukui (福井県)", + "val": "Fukui (福井市)" + }, + { + "key": "Yamanashi (山梨県)", + "val": "Kōfu (甲府市)" + }, + { + "key": "Nagano (長野県)", + "val": "Nagano (長野市)" + }, + { + "key": "Gifu (岐阜県)", + "val": "Gifu (岐阜市)" + }, + { + "key": "Shizuoka (静岡県)", + "val": "Shizuoka (静岡市)" + }, + { + "key": "Aichi (愛知県)", + "val": "Nagoya (名古屋市)" + } + ], + "Kansai": [ + { + "key": "Mie (三重県)", + "val": "Tsu (津市)" + }, + { + "key": "Shiga (滋賀県)", + "val": "Ōtsu (大津市)" + }, + { + "key": "Kyōto (京都府)", + "val": "Kyōto (京都市)" + }, + { + "key": "Ōsaka (大阪府)", + "val": "Ōsaka (大阪市)" + }, + { + "key": "Hyōgo (兵庫県)", + "val": "Kōbe (神戸市)" + }, + { + "key": "Nara (奈良県)", + "val": "Nara (奈良市)" + }, + { + "key": "Wakayama (和歌山県)", + "val": "Wakayama (和歌山市)" + } + ], + "Chūgoku": [ + { + "key": "Tottori (鳥取県)", + "val": "Tottori (鳥取市)" + }, + { + "key": "Shimane (島根県)", + "val": "Matsue (松江市)" + }, + { + "key": "Okayama (岡山県)", + "val": "Okayama (岡山市)" + }, + { + "key": "Hiroshima (広島県)", + "val": "Hiroshima (広島市)" + }, + { + "key": "Yamaguchi (山口県)", + "val": "Yamaguchi (山口市)" + } + ], + "Shikoku": [ + { + "key": "Tokushima (徳島県)", + "val": "Tokushima (徳島市)" + }, + { + "key": "Kagawa (香川県)", + "val": "Takamatsu (高松市)" + }, + { + "key": "Ehime (愛媛県)", + "val": "Matsuyama (松山市)" + }, + { + "key": "Kōchi (高知県)", + "val": "Kōchi (高知市)" + } + ], + "Kyūshū": [ + { + "key": "Fukuoka (福岡県)", + "val": "Fukuoka (福岡市)" + }, + { + "key": "Saga (佐賀県)", + "val": "Saga (佐賀市)" + }, + { + "key": "Nagasaki (長崎県)", + "val": "Nagasaki (長崎市)" + }, + { + "key": "Kumamoto (熊本県)", + "val": "Kumamoto (熊本市)" + }, + { + "key": "Ōita (大分県)", + "val": "Ōita (大分市)" + }, + { + "key": "Miyazaki (宮崎県)", + "val": "Miyazaki (宮崎市)" + }, + { + "key": "Kagoshima (鹿児島県)", + "val": "Kagoshima (鹿児島市)" + }, + { + "key": "Okinawa (沖縄県)", + "val": "Naha (那覇市)" + } + ] + } +} \ No newline at end of file From d52704c8b0be5cb0288a5d5ee90087216c7bb1d4 Mon Sep 17 00:00:00 2001 From: Daniel Davis Date: Mon, 30 Nov 2015 17:01:46 +0900 Subject: [PATCH 182/379] Kabaddi cheat sheet: Added 'kabaddi' as an alias --- share/goodie/cheat_sheets/json/kabaddi-terms.json | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/share/goodie/cheat_sheets/json/kabaddi-terms.json b/share/goodie/cheat_sheets/json/kabaddi-terms.json index 41d6d148e..349df365c 100644 --- a/share/goodie/cheat_sheets/json/kabaddi-terms.json +++ b/share/goodie/cheat_sheets/json/kabaddi-terms.json @@ -6,7 +6,13 @@ "sourceName": "ProKabaddi League", "sourceUrl": "http://www.prokabaddi.com/prokabaddi-rules" }, - "aliases": ["kabaddi words", "kabaddi definitions", "words used in kabaddi", "terms used in kabaddi"], + "aliases": [ + "kabaddi", + "kabaddi words", + "kabaddi definitions", + "words used in kabaddi", + "terms used in kabaddi" + ], "template_type": "reference", "section_order": [ "Court related terms", From 018f1a4790e4d6d6afb7e838e9011fb7249600f6 Mon Sep 17 00:00:00 2001 From: Mailkov Date: Mon, 30 Nov 2015 15:27:56 +0000 Subject: [PATCH 183/379] Issue #1163 - Convert Average.p to use template --- lib/DDG/Goodie/Average.pm | 20 ++- share/goodie/average/average.css | 6 +- share/goodie/average/content.handlebars | 12 ++ t/Average.t | 160 ++++++++++++++++++++++-- 4 files changed, 186 insertions(+), 12 deletions(-) create mode 100644 share/goodie/average/content.handlebars diff --git a/lib/DDG/Goodie/Average.pm b/lib/DDG/Goodie/Average.pm index fdb3ed22d..511616315 100644 --- a/lib/DDG/Goodie/Average.pm +++ b/lib/DDG/Goodie/Average.pm @@ -65,7 +65,25 @@ handle remainder => sub { $rms += ($_ ** 2) for @nums; $rms /= $len; $rms = sqrt $rms; - return "Mean: $mean; Median: $med; Root Mean Square: $rms", html => "
Mean: $mean
Median: $med
Root Mean Square: $rms
"; + + return "Mean: $mean; Median: $med; Root Mean Square: $rms", + structured_answer => { + id => 'average', + name => 'Math', + data => { + mean => $mean, + median => $med, + rms => $rms + }, + templates => { + group => 'text', + item => 0, + options => { + content => 'DDH.average.content' + } + } + }; + }; 1; diff --git a/share/goodie/average/average.css b/share/goodie/average/average.css index 8a58bf08c..28e2a274c 100644 --- a/share/goodie/average/average.css +++ b/share/goodie/average/average.css @@ -1,11 +1,11 @@ -.zci--answer .average--container { +.zci--average .c-base__content { font-size: 1.2em; } -.zci--answer .average--key { +.zci--average .average--key { font-weight: 300; } -.zci--answer .average--value { +.zci--average .average--value { font-weight: 500; } \ No newline at end of file diff --git a/share/goodie/average/content.handlebars b/share/goodie/average/content.handlebars new file mode 100644 index 000000000..cd504c549 --- /dev/null +++ b/share/goodie/average/content.handlebars @@ -0,0 +1,12 @@ +
+ Mean: + {{mean}} +
+
+ Median: + {{median}} +
+
+ Root Mean Square: + {{rms}} +
\ No newline at end of file diff --git a/t/Average.t b/t/Average.t index 985dba175..2ef796fcc 100644 --- a/t/Average.t +++ b/t/Average.t @@ -12,14 +12,158 @@ ddg_goodie_test( [qw( DDG::Goodie::Average )], - '1 2 3 avg' => test_zci("Mean: 2; Median: 2; Root Mean Square: 2.16024689946929", html => qr/Mean:/), - 'mean 1, 2, 3' => test_zci("Mean: 2; Median: 2; Root Mean Square: 2.16024689946929", html => qr/Mean:/), - 'root mean square 1,2,3' => test_zci("Mean: 2; Median: 2; Root Mean Square: 2.16024689946929", html => qr/Mean:/), - "average 12 45 78 1234.12" => test_zci("Mean: 342.28; Median: 61.5; Root Mean Square: 618.72958034993", html => qr/Mean:/), - "average 12, 45, 78, 1234.12" => test_zci("Mean: 342.28; Median: 61.5; Root Mean Square: 618.72958034993", html => qr/Mean:/), - "average 12;45;78;1234.12" => test_zci("Mean: 342.28; Median: 61.5; Root Mean Square: 618.72958034993", html => qr/Mean:/), - 'average 12, 45, 78, 1234' => test_zci('Mean: 342.25; Median: 61.5; Root Mean Square: 618.669742269654', html => qr/Mean:/), - 'avg 1,2,3' => test_zci('Mean: 2; Median: 2; Root Mean Square: 2.16024689946929', html => qr/Mean:/), + '1 2 3 avg' => test_zci( + "Mean: 2; Median: 2; Root Mean Square: 2.16024689946929", + structured_answer => { + id => 'average', + name => 'Math', + data => { + mean => 2, + median => 2, + rms => 2.16024689946929 + }, + templates => { + group => 'text', + item => 0, + options => { + content => 'DDH.average.content' + } + } + } + ), + 'mean 1, 2, 3' => test_zci( + "Mean: 2; Median: 2; Root Mean Square: 2.16024689946929", + structured_answer => { + id => 'average', + name => 'Math', + data => { + mean => 2, + median => 2, + rms => 2.16024689946929 + }, + templates => { + group => 'text', + item => 0, + options => { + content => 'DDH.average.content' + } + } + } + ), + 'root mean square 1,2,3' => test_zci( + "Mean: 2; Median: 2; Root Mean Square: 2.16024689946929", + structured_answer => { + id => 'average', + name => 'Math', + data => { + mean => 2, + median => 2, + rms => 2.16024689946929 + }, + templates => { + group => 'text', + item => 0, + options => { + content => 'DDH.average.content' + } + } + } + ), + "average 12 45 78 1234.12" => test_zci( + "Mean: 342.28; Median: 61.5; Root Mean Square: 618.72958034993", + structured_answer => { + id => 'average', + name => 'Math', + data => { + mean => 342.28, + median => 61.5, + rms => 618.72958034993 + }, + templates => { + group => 'text', + item => 0, + options => { + content => 'DDH.average.content' + } + } + } + ), + "average 12, 45, 78, 1234.12" => test_zci( + "Mean: 342.28; Median: 61.5; Root Mean Square: 618.72958034993", + structured_answer => { + id => 'average', + name => 'Math', + data => { + mean => 342.28, + median => 61.5, + rms => 618.72958034993 + }, + templates => { + group => 'text', + item => 0, + options => { + content => 'DDH.average.content' + } + } + } + ), + "average 12;45;78;1234.12" => test_zci( + "Mean: 342.28; Median: 61.5; Root Mean Square: 618.72958034993", + structured_answer => { + id => 'average', + name => 'Math', + data => { + mean => 342.28, + median => 61.5, + rms => 618.72958034993 + }, + templates => { + group => 'text', + item => 0, + options => { + content => 'DDH.average.content' + } + } + } + ), + 'average 12, 45, 78, 1234' => test_zci( + 'Mean: 342.25; Median: 61.5; Root Mean Square: 618.669742269654', + structured_answer => { + id => 'average', + name => 'Math', + data => { + mean => 342.25, + median => 61.5, + rms => 618.669742269654 + }, + templates => { + group => 'text', + item => 0, + options => { + content => 'DDH.average.content' + } + } + } + ), + 'avg 1,2,3' => test_zci( + 'Mean: 2; Median: 2; Root Mean Square: 2.16024689946929', + structured_answer => { + id => 'average', + name => 'Math', + data => { + mean => 2, + median => 2, + rms => 2.16024689946929 + }, + templates => { + group => 'text', + item => 0, + options => { + content => 'DDH.average.content' + } + } + } + ), #Should not trigger 'average temperature philadelphia 2012 january' => undef, From 68c4e2feb98e26b2c753dcc175beaee15f01d2d6 Mon Sep 17 00:00:00 2001 From: Mailkov Date: Mon, 30 Nov 2015 15:44:13 +0000 Subject: [PATCH 184/379] Issue #437 - change answer --- lib/DDG/Goodie/Scramble.pm | 17 ++++------------- t/Scramble.t | 13 ++++--------- 2 files changed, 8 insertions(+), 22 deletions(-) diff --git a/lib/DDG/Goodie/Scramble.pm b/lib/DDG/Goodie/Scramble.pm index 7e62a0bc2..c9ffb678e 100644 --- a/lib/DDG/Goodie/Scramble.pm +++ b/lib/DDG/Goodie/Scramble.pm @@ -77,19 +77,10 @@ handle remainder => sub { return $operation . ' ' . $word, structured_answer => { - - id => 'scramble', - name => 'Words & games', - - data => { - title => $response, - subtitle => $operation . ' ' . $word - }, - - templates => { - group => "text" - } - }; + input => [html_enc($word)], + operation => $operation, + result => html_enc($response) + }; }; 1; diff --git a/t/Scramble.t b/t/Scramble.t index 38470acca..942c357d7 100644 --- a/t/Scramble.t +++ b/t/Scramble.t @@ -13,15 +13,10 @@ ddg_goodie_test( 'scramble of filter' => test_zci( 'Scramble of filter', structured_answer => { - id => 'scramble', - name => 'Words & games', - - data => '-ANY-', - - templates => { - group => "text" - } - }, + input => ['filter'], + operation => 'Scramble of', + result => '-ANY-', + } ), 'scramble of' => undef, 'Scramble for' => undef, From f6ad5cd0e05f60ea7fddfd1491bffba3c165d12d Mon Sep 17 00:00:00 2001 From: Mailkov Date: Mon, 30 Nov 2015 16:55:02 +0000 Subject: [PATCH 185/379] Issue #437 - corrects review --- lib/DDG/Goodie/Anagram.pm | 3 +-- lib/DDG/Goodie/Scramble.pm | 20 ++++---------------- t/Anagram.t | 18 ++---------------- 3 files changed, 7 insertions(+), 34 deletions(-) diff --git a/lib/DDG/Goodie/Anagram.pm b/lib/DDG/Goodie/Anagram.pm index 98a8a5ba0..a1043a35a 100644 --- a/lib/DDG/Goodie/Anagram.pm +++ b/lib/DDG/Goodie/Anagram.pm @@ -102,8 +102,7 @@ handle remainder => sub { $response = join ', ', sort { $a cmp $b } @output; $operation = 'Anagrams of'; } else { - $response = ''; - $operation = 'There are no anagrams for '; + return; } return $response, diff --git a/lib/DDG/Goodie/Scramble.pm b/lib/DDG/Goodie/Scramble.pm index c9ffb678e..5a46899ec 100644 --- a/lib/DDG/Goodie/Scramble.pm +++ b/lib/DDG/Goodie/Scramble.pm @@ -36,29 +36,18 @@ topics "words_and_games"; attribution github => ["https://github.com/loganom", 'loganom'], github => ["https://github.com/beardlybread", "beardlybread"], github => ['https://github.com/gdrooid', 'gdrooid'], + github => ['https://github.com/Mailkov', 'Mailkov'], email => ['gdrooid@openmailbox.org', 'gdrooid']; -# Calculate the frequency of the characters in a string -sub calc_freq { - my ($str) = @_; - my %freqs; - - for (split //, lc $str) { - $freqs{$_} += 1; - } - - return \%freqs; -} - # Handle statement -handle remainder => sub { +handle remainder_lc => sub { my $word = $_; $word =~ s/^"(.*)"$/$1/; return unless $word; # Need a word. - my $match_word = lc $word; + my $match_word = $word; $match_word =~ s/[^a-z]//g; return unless $match_word; @@ -71,8 +60,7 @@ handle remainder => sub { if ($response) { $operation = 'Scramble of'; } else { - $response = ''; - $operation = 'There are no scrambles of'; + return; } return $operation . ' ' . $word, diff --git a/t/Anagram.t b/t/Anagram.t index b806dc9c1..4eb2d3589 100644 --- a/t/Anagram.t +++ b/t/Anagram.t @@ -34,22 +34,6 @@ ddg_goodie_test( result => 'logarithm', } ), - 'anagrams of favorite' => test_zci( - '-ANY-', - structured_answer => { - input => ['favorite'], - operation => 'There are no anagrams for ', - result => '-ANY-', - } - ), - 'anagrams of "Mixing it up"' => test_zci( - '-ANY-', - structured_answer => { - input => ['Mixing it up'], - operation => 'There are no anagrams for ', - result => '-ANY-', - } - ), 'anagram times' => test_zci( 'emits, items, mites, smite', structured_answer => { @@ -87,6 +71,8 @@ ddg_goodie_test( 'Anagrams for' => undef, 'anagrams for ""' => undef, 'anagrams for "867-5309"' => undef, + 'anagrams of favorite' => undef, + 'anagrams of "Mixing it up"' => undef, ); done_testing; From 83827c7b788e3277e2fdf7c378295faed5494465 Mon Sep 17 00:00:00 2001 From: Mailkov Date: Mon, 30 Nov 2015 17:17:04 +0000 Subject: [PATCH 186/379] Issue #437 - fix is_cached --- lib/DDG/Goodie/Scramble.pm | 2 +- t/Scramble.t | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/DDG/Goodie/Scramble.pm b/lib/DDG/Goodie/Scramble.pm index 5a46899ec..50b77f41e 100644 --- a/lib/DDG/Goodie/Scramble.pm +++ b/lib/DDG/Goodie/Scramble.pm @@ -21,7 +21,7 @@ foreach my $kw (@keywords) { } zci answer_type => 'scramble'; -zci is_cached => 1; +zci is_cached => 0; triggers start => @triggers; diff --git a/t/Scramble.t b/t/Scramble.t index 942c357d7..a489c8c13 100644 --- a/t/Scramble.t +++ b/t/Scramble.t @@ -6,7 +6,7 @@ use Test::More; use DDG::Test::Goodie; zci answer_type => "scramble"; -zci is_cached => 1; +zci is_cached => 0; ddg_goodie_test( [qw( DDG::Goodie::Scramble )], From 24fb6a2d3bb3bbf563c0cb31e00689a878d08fc5 Mon Sep 17 00:00:00 2001 From: Mailkov Date: Mon, 30 Nov 2015 17:25:52 +0000 Subject: [PATCH 187/379] Issue #437 - fix review 2 --- lib/DDG/Goodie/Scramble.pm | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lib/DDG/Goodie/Scramble.pm b/lib/DDG/Goodie/Scramble.pm index 50b77f41e..faeec1eae 100644 --- a/lib/DDG/Goodie/Scramble.pm +++ b/lib/DDG/Goodie/Scramble.pm @@ -38,6 +38,8 @@ attribution github => ["https://github.com/loganom", 'loganom'], github => ['https://github.com/gdrooid', 'gdrooid'], github => ['https://github.com/Mailkov', 'Mailkov'], email => ['gdrooid@openmailbox.org', 'gdrooid']; + +my $operation = 'Scramble of'; # Handle statement handle remainder_lc => sub { @@ -56,14 +58,9 @@ handle remainder_lc => sub { $response = join '', shuffle split(//, $match_word); } while (length($match_word) > 1 && $response eq $match_word); - my $operation; - if ($response) { - $operation = 'Scramble of'; - } else { - return; - } + return unless $response; - return $operation . ' ' . $word, + return "$operation $word", structured_answer => { input => [html_enc($word)], operation => $operation, From 25849f9a8eb8d3cb2b887a9b38ab63bf526d57e2 Mon Sep 17 00:00:00 2001 From: harisphnx Date: Tue, 1 Dec 2015 15:44:49 +0000 Subject: [PATCH 188/379] suggestions edited --- share/goodie/cheat_sheets/json/c.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/share/goodie/cheat_sheets/json/c.json b/share/goodie/cheat_sheets/json/c.json index c617b25f4..7c3deb270 100644 --- a/share/goodie/cheat_sheets/json/c.json +++ b/share/goodie/cheat_sheets/json/c.json @@ -1,7 +1,7 @@ { "id": "c_cheat_sheet", - "name": "C Cheat Sheet", - "description": "Computer Programming Language", + "name": "C Language", + "description": "Overview of Basic Operators, Order of Precedence, Escape Sequences and Conversion Characters", "metadata": { "sourceName": "C for Beginners", "sourceUrl": "http://www.dummies.com/how-to/content/beginning-c-programming-for-dummies-cheat-sheet.html" @@ -114,7 +114,7 @@ ], "Bitwise Operators": [ { - "val": "Bitwise NOT", + "val": "Bitwise NOT / One's Complement", "key": "~a" }, { From 0d6efe57ecc6e2497966106c3d5fa203472fec43 Mon Sep 17 00:00:00 2001 From: Mailkov Date: Tue, 1 Dec 2015 15:58:04 +0000 Subject: [PATCH 189/379] Issue #1163 - Convert ColorCodes to use template --- lib/DDG/Goodie/ColorCodes.pm | 121 +++++-------- share/goodie/color_codes/color_codes.css | 28 +-- share/goodie/color_codes/content.handlebars | 45 +++++ t/ColorCodes.t | 178 ++++++++++++++++++-- 4 files changed, 264 insertions(+), 108 deletions(-) create mode 100644 share/goodie/color_codes/content.handlebars diff --git a/lib/DDG/Goodie/ColorCodes.pm b/lib/DDG/Goodie/ColorCodes.pm index fc5549570..899d1e1f0 100755 --- a/lib/DDG/Goodie/ColorCodes.pm +++ b/lib/DDG/Goodie/ColorCodes.pm @@ -59,7 +59,8 @@ code_url 'https://github.com/duckduckgo/zeroclickinfo-goodies/blob/master/lib/DD category 'conversions'; topics 'programming'; attribution cpan => 'CRZEDPSYC', - github => ['http://github.com/mintsoft', 'Rob Emery']; + github => ['http://github.com/mintsoft', 'Rob Emery'], + github => ['http://github.com/Mailkov', 'Melchiorre Alastra']; my %trigger_invert = map { $_ => 1 } (qw( inverse negative opposite )); my %trigger_filler = map { $_ => 1 } (qw( code )); @@ -72,61 +73,6 @@ sub percentify { return @out; } -sub create_output { - my (%input) = @_; - my ($text, $html) = ("",""); - - (my $hex_for_links = $input{'hex'}) =~ s/^#//; - my $hex = "Hex: ".uc($input{'hex'}); - my $rgb = "RGBA(" . join(", ", @{$input{'rgb'}}) . ", ".$input{'alpha'}.")"; - my $rgb_pct = "RGB(" . join(", ", @{$input{'rgb_percentage'}}) . ")"; - my $hsl = "HSL(" . join(", ", @{$input{'hsl'}}) . ")"; - my $cmyb = "CMYB(" . join(", ", @{$input{'cmyb'}}) . ")"; - my @analogous_colors = @{$input{'analogous'}}; - my $complementary = uc $input{'complementary'}; - - #greyscale colours have no hue and saturation - my $show_column_2 = !($input{'hsl'}->[0] eq 0 && $input{'hsl'}->[1] eq '0%'); - - $text = "$hex ~ $rgb ~ $rgb_pct ~ $hsl ~ $cmyb"; - my $column_2_text = "\n" . - "Complementary: #$complementary\n" . - "Analogous: ".(join ", ", map { "#".uc $_ } @analogous_colors); - - my $comps = "
" - . "" - . "
" - . "

Complementary #:

" - . qq[$complementary] - . "

"; - - my $analogs = "
" - . (join "", map { " "; } @analogous_colors) - . "
" - . "

Analogous #:

" . (join ", ", map { qq[].(uc $_).'' } @analogous_colors) . "

"; - - $html = "
" - . "

$hex

$rgb

$hsl

$cmyb

" - . "

Images" - . " | " - . "Info" - . " | " - . "Picker

" - . "
"; - - my $column_2_html = "
" - . "
$comps
" - . "
$analogs
" - . "
"; - - if ($show_column_2) { - $html.= $column_2_html; - $text.= $column_2_text; - } - - return ($text, $html); -} - handle matches => sub { my $color; @@ -165,8 +111,8 @@ handle matches => sub { $type = 'rgb8'; # We asked for rgb8 from our dictionary, so make sure our type matches. }; } - - my $col = try { Convert::Color->new("$type:$color") }; # Everything should be ready for conversion now. + + my $col = try { Convert::Color->new("$type:$color") }; # Everything should be ready for conversion now. return unless $col; # Guess not. if ($inverse) { # We triggered on the inverse, so do the flip. @@ -178,30 +124,53 @@ handle matches => sub { my $complementary = $color_mix->complementary($hex_code); my @analogous = $color_mix->analogous($hex_code,12,12); - @analogous = ($analogous[1], $analogous[11]); + @analogous = (uc($analogous[1]), uc($analogous[11])); my @rgb = $col->as_rgb8->rgb8; my $hsl = $col->as_hsl; my @rgb_pct = percentify($col->as_rgb->rgb); my @cmyk = percentify($col->as_cmyk->cmyk); - my %outdata = ( - hex => '#' . $hex_code, - rgb => \@rgb, - rgb_percentage => \@rgb_pct, - hsl => [round($hsl->hue), percentify($hsl->saturation), percentify($hsl->lightness)], - cmyb => \@cmyk, - alpha => $alpha, - complementary => $complementary, - analogous => \@analogous - ); - my ($text, $html_text) = create_output(%outdata); + my @hsl = (round($hsl->hue), percentify($hsl->saturation), percentify($hsl->lightness)); - return $text, - html => '
' - . '' - . $html_text - . "
"; + my $hexc = 'Hex: #' . uc($hex_code); + my $rgb = 'RGBA(' . join(', ', @rgb) . ', ' . $alpha . ')'; + my $hslc = 'HSL(' . join(', ', @hsl) . ')'; + my $cmyb = 'CMYB(' . join(', ', @cmyk) . ')'; + my $rgb_pct = 'RGB(' . join(', ', @rgb_pct) . ')'; + + $complementary = uc($complementary); + + #greyscale colours have no hue and saturation + my $show_column_2 = !($hsl[0] eq 0 && $hsl[1] eq '0%'); + + my $column_2 = ''; + + if ($show_column_2) { + $column_2 = "\n" . "Complementary: #$complementary" . "\n" . "Analogous: #$analogous[0], #$analogous[1]"; + } + + return "$hexc ~ $rgb ~ $rgb_pct ~ $hslc ~ $cmyb$column_2", + structured_answer => { + id => 'color_codes', + name => 'Programming', + data => { + hex_code => $hex_code, + hexc => $hexc, + rgb => $rgb, + hslc => $hslc, + cmyb => $cmyb, + show_column_2 => $show_column_2, + analogous => \@analogous, + complementary => $complementary, + }, + templates => { + group => 'text', + item => 0, + options => { + content => 'DDH.color_codes.content' + } + } + }; }; 1; diff --git a/share/goodie/color_codes/color_codes.css b/share/goodie/color_codes/color_codes.css index 0380fa75c..59cd0d813 100755 --- a/share/goodie/color_codes/color_codes.css +++ b/share/goodie/color_codes/color_codes.css @@ -1,4 +1,4 @@ -.zci--answer .zci--color-codes .colorcodesbox { +.zci--color_codes .colorcodesbox { height: 120px; width: 120px; margin: 5px; @@ -9,12 +9,12 @@ display: inline-block; } -.zci--answer .zci--color-codes .circle { +.zci--color_codes .circle { border-radius: 50%; border: 2px solid rgba(0,0,0,0.15); } -.zci--answer .zci--color-codes .mini-color { +.zci--color_codes .mini-color { display: inline-block; width: 32px; height: 32px; @@ -22,61 +22,61 @@ vertical-align: bottom; } -.zci--answer .zci--color-codes .complementary .mini-color { +.zci--color_codes .complementary .mini-color { margin-left: 23px; } -.zci--answer .zci--color-codes .mini-color:nth-of-type(n+2) { +.zci--color_codes .mini-color:nth-of-type(n+2) { margin-left: -0.7em; } -.zci--answer .zci--color-codes p.no_vspace { +.zci--color_codes p.no_vspace { margin: 0; padding: 0; } -.zci--answer .zci--color-codes .column1 +.zci--color_codes .column1 { display: inline-block; height: 125px; padding-top: 7px; } -.zci--answer .zci--color-codes .column2 { +.zci--color_codes .column2 { display: inline-block; height: 90px; width: 16em; margin-left: 2em; } -.zci--answer .zci--color-codes .cols_column { +.zci--color_codes .cols_column { display: inline-block; width: 5em; margin-left: -2px; margin-right: 4px; } -.zci--answer .zci--color-codes .desc_column { +.zci--color_codes .desc_column { display: inline-block; width: 10em; } -.zci--answer .zci--color-codes .complementary { +.zci--color_codes .complementary { margin-bottom: 0.25em; } -.zci--answer .zci--color-codes .separator { +.zci--color_codes .separator { color: #d0d0d0; } @media screen and (max-width: 420px) { - .zci--answer .zci--color-codes .colorcodesbox { + .zci--color_codes .colorcodesbox { width: 80px; height: 80px; margin-top: 15px; } - .zci--answer .zci--color-codes .column1 { + .zci--color_codes .column1 { padding-top: 0; } } diff --git a/share/goodie/color_codes/content.handlebars b/share/goodie/color_codes/content.handlebars new file mode 100644 index 000000000..71eae3a77 --- /dev/null +++ b/share/goodie/color_codes/content.handlebars @@ -0,0 +1,45 @@ + + +{{#if show_column_2}} +
+
+
+ + +
+
+

Complementary #:

+ {{complementary}} +

+
+ +
+
+
+ {{#each analogous}} + + {{/each}} +
+
+

Analogous #:

+

+ {{#each analogous}} + {{this}} + {{/each}} +

+
+
+
+{{/if}} \ No newline at end of file diff --git a/t/ColorCodes.t b/t/ColorCodes.t index d1eadb0c3..1abbb272b 100755 --- a/t/ColorCodes.t +++ b/t/ColorCodes.t @@ -10,26 +10,82 @@ zci is_cached => 1; my @green_args = ( 'Hex: #00FF00 ~ RGBA(0, 255, 0, 1) ~ RGB(0%, 100%, 0%) ~ HSL(120, 100%, 50%) ~ CMYB(100%, 0%, 100%, 0%)'."\n".'Complementary: #FF00FF'."\n".'Analogous: #00FF80, #80FF00', - html => qr/background:#00ff00/ + structured_answer => { + id => 'color_codes', + name => 'Programming', + data => '-ANY-', + templates => { + group => 'text', + item => 0, + options => { + content => 'DDH.color_codes.content' + } + } + } ); + ddg_goodie_test( [qw(DDG::Goodie::ColorCodes)], 'hex color code for cyan' => test_zci( 'Hex: #00FFFF ~ RGBA(0, 255, 255, 1) ~ RGB(0%, 100%, 100%) ~ HSL(180, 100%, 50%) ~ CMYB(100%, 0%, 0%, 0%)'."\n".'Complementary: #FF0000'."\n".'Analogous: #0080FF, #00FF80', - html => qr/background:#00ffff/, + structured_answer => { + id => 'color_codes', + name => 'Programming', + data => '-ANY-', + templates => { + group => 'text', + item => 0, + options => { + content => 'DDH.color_codes.content' + } + } + } ), 'RGB(173,216,230)' => test_zci( 'Hex: #ADD8E6 ~ RGBA(173, 216, 230, 1) ~ RGB(68%, 85%, 90%) ~ HSL(195, 53%, 79%) ~ CMYB(25%, 6%, 0%, 10%)'."\n".'Complementary: #E6BAAC'."\n".'Analogous: #ACBAE6, #ACE6D7', - html => qr/background:#add8e6/, + structured_answer => { + id => 'color_codes', + name => 'Programming', + data => '-ANY-', + templates => { + group => 'text', + item => 0, + options => { + content => 'DDH.color_codes.content' + } + } + } ), 'hsl 194 0.53 0.79' => test_zci( 'Hex: #ADD8E5 ~ RGBA(173, 216, 229, 1) ~ RGB(68%, 85%, 90%) ~ HSL(194, 53%, 79%) ~ CMYB(25%, 6%, 0%, 10%)'."\n".'Complementary: #E6BBAE'."\n".'Analogous: #AEBDE6, #AEE6D7', - html => qr/background:#add8e5/, + structured_answer => { + id => 'color_codes', + name => 'Programming', + data => '-ANY-', + templates => { + group => 'text', + item => 0, + options => { + content => 'DDH.color_codes.content' + } + } + } ), 'cmyk(0.12, 0, 0, 0)' => test_zci( 'Hex: #E0FFFF ~ RGBA(224, 255, 255, 1) ~ RGB(88%, 100%, 100%) ~ HSL(180, 100%, 94%) ~ CMYB(12%, 0%, 0%, 0%)'."\n".'Complementary: #FFE0E0'."\n".'Analogous: #E0F0FF, #E0FFF0', - html => qr/background:#e0ffff/, + structured_answer => { + id => 'color_codes', + name => 'Programming', + data => '-ANY-', + templates => { + group => 'text', + item => 0, + options => { + content => 'DDH.color_codes.content' + } + } + } ), '#00ff00' => test_zci(@green_args), '#0f0' => test_zci(@green_args), @@ -37,37 +93,125 @@ ddg_goodie_test( '#0f0 to cmyk' => test_zci(@green_args), 'inverse of the color red' => test_zci( 'Hex: #00FFFF ~ RGBA(0, 255, 255, 1) ~ RGB(0%, 100%, 100%) ~ HSL(180, 100%, 50%) ~ CMYB(100%, 0%, 0%, 0%)'."\n".'Complementary: #FF0000'."\n".'Analogous: #0080FF, #00FF80', - html => qr/background:#00ffff/, - ), + structured_answer => { + id => 'color_codes', + name => 'Programming', + data => '-ANY-', + templates => { + group => 'text', + item => 0, + options => { + content => 'DDH.color_codes.content' + } + } + } +), 'RGB(0 255 0)\'s inverse' => test_zci( 'Hex: #FF00FF ~ RGBA(255, 0, 255, 1) ~ RGB(100%, 0%, 100%) ~ HSL(300, 100%, 50%) ~ CMYB(0%, 100%, 0%, 0%)'."\n".'Complementary: #00FF00'."\n".'Analogous: #FF0080, #8000FF', - html => qr/background:#ff00ff/, + structured_answer => { + id => 'color_codes', + name => 'Programming', + data => '-ANY-', + templates => { + group => 'text', + item => 0, + options => { + content => 'DDH.color_codes.content' + } + } + } ), 'html bluishblack' => test_zci( 'Hex: #202428 ~ RGBA(32, 36, 40, 1) ~ RGB(13%, 14%, 16%) ~ HSL(210, 11%, 14%) ~ CMYB(20%, 10%, 0%, 84%)'."\n".'Complementary: #292521'."\n".'Analogous: #212129, #212929', - html => qr/background:#202428/, + structured_answer => { + id => 'color_codes', + name => 'Programming', + data => '-ANY-', + templates => { + group => 'text', + item => 0, + options => { + content => 'DDH.color_codes.content' + } + } + } ), # Single full HTML check. 'red html code' => test_zci( 'Hex: #FF0000 ~ RGBA(255, 0, 0, 1) ~ RGB(100%, 0%, 0%) ~ HSL(0, 100%, 50%) ~ CMYB(0%, 100%, 100%, 0%)'."\n".'Complementary: #00FFFF'."\n".'Analogous: #FF8000, #FF0080', - html => qq(

Hex: #FF0000

RGBA(255, 0, 0, 1)

HSL(0, 100%, 50%)

CMYB(0%, 100%, 100%, 0%)

Images | Info | Picker

Complementary #:

00FFFF

Analogous #:

FF8000, FF0080

) - ), + structured_answer => { + id => 'color_codes', + name => 'Programming', + data => '-ANY-', + templates => { + group => 'text', + item => 0, + options => { + content => 'DDH.color_codes.content' + } + } + } +), 'RGBA(99,60,176,0.5)' => test_zci( 'Hex: #633CB0 ~ RGBA(99, 60, 176, 0.5) ~ RGB(39%, 24%, 69%) ~ HSL(260, 49%, 46%) ~ CMYB(44%, 66%, 0%, 31%)'."\n".'Complementary: #89B03C'."\n".'Analogous: #9D3CB0, #3C4FB0', - html => qr/background:#633cb0/ + structured_answer => { + id => 'color_codes', + name => 'Programming', + data => '-ANY-', + templates => { + group => 'text', + item => 0, + options => { + content => 'DDH.color_codes.content' + } + } + } ), '#dc5f3c' => test_zci( 'Hex: #DC5F3C ~ RGBA(220, 95, 60, 1) ~ RGB(86%, 37%, 24%) ~ HSL(13, 70%, 55%) ~ CMYB(0%, 57%, 73%, 14%)'."\n".'Complementary: #3BB9DB'."\n".'Analogous: #DBAE3B, #DB3B69', - html => qr/background:#dc5f3c/ + structured_answer => { + id => 'color_codes', + name => 'Programming', + data => '-ANY-', + templates => { + group => 'text', + item => 0, + options => { + content => 'DDH.color_codes.content' + } + } + } ), #Colours with no hue shouldn't have complements or analogs '#000000' => test_zci( 'Hex: #000000 ~ RGBA(0, 0, 0, 1) ~ RGB(0%, 0%, 0%) ~ HSL(0, 0%, 0%) ~ CMYB(0%, 0%, 0%, 100%)', - html => qq(

Hex: #000000

RGBA(0, 0, 0, 1)

HSL(0, 0%, 0%)

CMYB(0%, 0%, 0%, 100%)

Images | Info | Picker

) + structured_answer => { + id => 'color_codes', + name => 'Programming', + data => '-ANY-', + templates => { + group => 'text', + item => 0, + options => { + content => 'DDH.color_codes.content' + } + } + } ), '#FFFFFF' => test_zci( 'Hex: #FFFFFF ~ RGBA(255, 255, 255, 1) ~ RGB(100%, 100%, 100%) ~ HSL(0, 0%, 100%) ~ CMYB(0%, 0%, 0%, 0%)', - html => qq(

Hex: #FFFFFF

RGBA(255, 255, 255, 1)

HSL(0, 0%, 100%)

CMYB(0%, 0%, 0%, 0%)

Images | Info | Picker

) + structured_answer => { + id => 'color_codes', + name => 'Programming', + data => '-ANY-', + templates => { + group => 'text', + item => 0, + options => { + content => 'DDH.color_codes.content' + } + } + } ), # Queries to ignore. 'bluishblack html' => undef, @@ -75,6 +219,4 @@ ddg_goodie_test( 'wield color' => undef, ); -done_testing; - - +done_testing; \ No newline at end of file From 639fbc01543ef7465b31fe4ed50543fa6b5cf821 Mon Sep 17 00:00:00 2001 From: Jamy Golden Date: Tue, 1 Dec 2015 18:39:58 +0200 Subject: [PATCH 190/379] Create Sketch cheatsheet --- share/goodie/cheat_sheets/json/sketch.json | 357 +++++++++++++++++++++ 1 file changed, 357 insertions(+) create mode 100644 share/goodie/cheat_sheets/json/sketch.json diff --git a/share/goodie/cheat_sheets/json/sketch.json b/share/goodie/cheat_sheets/json/sketch.json new file mode 100644 index 000000000..f141d33da --- /dev/null +++ b/share/goodie/cheat_sheets/json/sketch.json @@ -0,0 +1,357 @@ +{ + "id": "sketch_cheat_sheet", + "name": "Sketch", + "description": "List of keyboard shortcuts for Sketch", + "metadata": { + "sourceName": "Sketch Shortcuts", + "sourceUrl": "http://sketchshortcuts.com/" + }, + "aliases": [ + "sketch", + "mac sketch", + "apple sketch", + "osx sketch" + ], + "template_type": "keyboard", + "section_order": [ + "Insert", + "Type", + "Canvas View", + "Window", + "Editing Shapes", + "Editing Layers", + "Arranging Layers, Groups and Artboards" + ], + "sections": { + "Insert": [ + { + "key": "A", + "val": "New Artboard" + }, + { + "key": "S", + "val": "Slice" + }, + { + "key": "R", + "val": "Rectangle" + }, + { + "key": "U", + "val": "Rounded Rectangle" + }, + { + "key": "O", + "val": "Oval" + }, + { + "key": "L", + "val": "Line" + }, + { + "key": "V", + "val": "Vector Point" + }, + { + "key": "P", + "val": "Pencil" + }, + { + "key": "T", + "val": "Text" + } + ], + "Type": [ + { + "key": "[⌘] [B]", + "val": "Bold" + }, + { + "key": "[⌘] [I]", + "val": "Italic" + }, + { + "key": "[⌘] [U]", + "val": "Underline" + }, + { + "key": "[Alt] [⌘] [+]", + "val": "Increase Font Size" + }, + { + "key": "[Alt] [⌘] [–]", + "val": "Decrease Font Size" + }, + { + "key": "[Alt] [Control] [L]", + "val": "Increase Character Spacing" + }, + { + "key": "[Alt] [Control] [T]", + "val": "Decrease Character Spacing" + }, + { + "key": "[⌘] [T]", + "val": "Change Font" + }, + { + "key": "[Shift] [⌘] [O]", + "val": "Convert Text to Outlines" + }, + { + "key": "[⌘] [Shift] [\\{]", + "val": "Align Left" + }, + { + "key": "[⌘] [Shift] [|]", + "val": "Align Center" + }, + { + "key": "[⌘] [Shift] [\\}]", + "val": "Align Right" + }, + { + "key": "[Control] [⌘] [Space]", + "val": "Special Characters" + } + ], + "Canvas View": [ + { + "key": "[⌘] [+]", + "val": "Zoom In" + }, + { + "key": "[⌘] [-]", + "val": "Zoom Out" + }, + { + "key": "[⌘] [0]", + "val": "Actual Size" + }, + { + "key": "[⌘] [1]", + "val": "Center Canvas" + }, + { + "key": "[⌘] [2]", + "val": "Zoom Selection" + }, + { + "key": "[⌘] [3]", + "val": "Center Selection" + }, + { + "key": "§", + "val": "Temporary Zoom to Actual Size" + }, + { + "key": "[Alt] [Tab]", + "val": "Focus on First Input Field" + }, + { + "key": "[Control] [R]", + "val": "Toggle Rulers" + }, + { + "key": "[Control] [G]", + "val": "Toggle Grid" + }, + { + "key": "[Control] [L]", + "val": "Toggle Layer Guides" + }, + { + "key": "[Control] [P]", + "val": "Toggle Pixels" + }, + { + "key": "[Control] [H]", + "val": "Toggle Selection Handles" + }, + { + "key": "[Control] [X]", + "val": "Toggle Pixel Grid" + }, + { + "key": "[Space], drag", + "val": "Move canvas" + } + ], + "Window": [ + { + "key": "[⌘] [~]", + "val": "Toggle between Documents" + }, + { + "key": "[Alt] [⌘] [1]", + "val": "Toggle Layers List" + }, + { + "key": "[Alt] [⌘] [2]", + "val": "Toggle Inspector" + }, + { + "key": "[Alt] [⌘] [3]", + "val": "Toggle Layers, Inspector" + }, + { + "key": "[Alt] [⌘] [T]", + "val": "Toggle Toolbar" + }, + { + "key": "[⌘] [.]", + "val": "Presentation Mode" + }, + { + "key": "[Control] [⌘] [F]", + "val": "Enter Fullscreen" + } + ], + "Editing Shapes": [ + { + "key": "[⌘] [Alt]", + "val": "Keep Current Selection" + }, + { + "key": "[Control] [⌘] [M]", + "val": "Use as Mask span (Works for Layers & Groups)" + }, + { + "key": "[Alt] [⌘] [U]", + "val": "Union" + }, + { + "key": "[Alt] [⌘] [S]", + "val": "Substract" + }, + { + "key": "[Alt] [⌘] [I]", + "val": "Intersect" + }, + { + "key": "[Alt] [⌘] [X]", + "val": "Difference" + }, + { + "key": "[⌘] [←] / [→] / [↑] / [↓]", + "val": "Change Object Size" + }, + { + "key": "[Shift] [⌘] [←] / [→] / [↑] / [↓]", + "val": "Change Units by 10" + }, + { + "key": "[1] / [2] / [3] / [4]", + "val": "Change Vector Point Style" + } + ], + "Editing Layers": [ + { + "key": "Alt", + "val": "Show Distance to other Layers" + }, + { + "key": "[Alt] [⌘]", + "val": "Show Distance to other Layers inside Group" + }, + { + "key": "[Alt], drag", + "val": "Duplicate" + }, + { + "key": "[⌘] [D]", + "val": "Duplicate" + }, + { + "key": "[Alt] [⌘] [C]", + "val": "Copy Style" + }, + { + "key": "[Alt] [⌘] [V]", + "val": "Paste Style" + }, + { + "key": "[Control] [C]", + "val": "Color Picker" + }, + { + "key": "[⌘] [T]", + "val": "Transform" + }, + { + "key": "[Shift] [⌘] [R]", + "val": "Rotate" + }, + { + "key": "F", + "val": "Toggle Fill" + }, + { + "key": "B", + "val": "Toggle Border" + } + ], + "Arranging Layers, Groups and Artboards": [ + { + "key": "[Alt] [⌘] [↑]", + "val": "Bring Forward" + }, + { + "key": "[Control] [Alt] [⌘] [↑]", + "val": "Bring to Front" + }, + { + "key": "[Alt] [⌘] [↓]", + "val": "Send Backward" + }, + { + "key": "[Control] [Alt] [⌘] [↓]", + "val": "Sent to Back" + }, + { + "key": "[Shift] [⌘] [H]", + "val": "Hide" + }, + { + "key": "[Shift] [⌘] [L]", + "val": "Lock" + }, + { + "key": "[⌘] [R]", + "val": "Rename" + }, + { + "key": "[⌘] [G]", + "val": "Group Layers" + }, + { + "key": "[Shift] [⌘] [G]", + "val": "Ungroup Layers" + }, + { + "key": "[Shift] [Tab]", + "val": "Select Above Layer" + }, + { + "key": "Tab", + "val": "Select Layer Below" + }, + { + "key": "Esc", + "val": "Select Parent Artboard" + }, + { + "key": "[⌘] [F]", + "val": "Find Layer by Name" + }, + { + "key": "[Fn] [↑]", + "val": "Select Above Page" + }, + { + "key": "[Fn] [↓]", + "val": "Select Page Below" + } + ] + } +} From 56b9279c5ab76b9a8b74ba9dc6133dbcf502b97f Mon Sep 17 00:00:00 2001 From: Mailkov Date: Tue, 1 Dec 2015 18:20:50 +0000 Subject: [PATCH 191/379] Issue #1163 - switch to simple structured Answer --- lib/DDG/Goodie/Average.pm | 77 ++++++------ share/goodie/average/average.css | 11 -- share/goodie/average/content.handlebars | 12 -- t/Average.t | 154 +++++------------------- 4 files changed, 74 insertions(+), 180 deletions(-) delete mode 100644 share/goodie/average/average.css delete mode 100644 share/goodie/average/content.handlebars diff --git a/lib/DDG/Goodie/Average.pm b/lib/DDG/Goodie/Average.pm index 511616315..7f10a9a5e 100644 --- a/lib/DDG/Goodie/Average.pm +++ b/lib/DDG/Goodie/Average.pm @@ -17,9 +17,23 @@ code_url 'https://github.com/duckduckgo/zeroclickinfo-goodies/blob/master/lib/DD category 'calculations'; topics 'math'; attribution twitter => ['crazedpsyc','crazedpsyc'], - cpan => ['CRZEDPSYC','crazedpsyc']; + cpan => ['CRZEDPSYC','crazedpsyc'], + github => ['http://github.com/Mailkov', 'Melchiorre Alastra']; -handle remainder => sub { + + +handle query => sub { + + my $query = $_; + + my $type; + if ($query =~ m/root mean square/) { + $type = "Root Mean Square"; + } elsif ($query =~ m/avg|average|mean/) { + $type = "Mean"; + } else { + $type = "Median"; + } #Remove leading/trailing text from list of numbers s/^[a-zA-Z\s]+//; @@ -46,42 +60,33 @@ handle remainder => sub { # get the length of the array my $len = @nums; - # calculate the mean - my $mean = $sum/$len; - - # sort the list numerically, least to greatest - @nums = sort { $a <=> $b } @nums; - my $med; - if ($len % 2 eq 0) { - # get the two middle numbers, since the - # length is even, and calculate their mean - $med = ($nums[$len/2] + $nums[$len/2-1])/2; - } else { - # get the middle number - $med = $nums[int($len/2)] - } - - my $rms; - $rms += ($_ ** 2) for @nums; - $rms /= $len; - $rms = sqrt $rms; + my $result; - return "Mean: $mean; Median: $med; Root Mean Square: $rms", - structured_answer => { - id => 'average', - name => 'Math', - data => { - mean => $mean, - median => $med, - rms => $rms - }, - templates => { - group => 'text', - item => 0, - options => { - content => 'DDH.average.content' - } + if ($type eq "Mean") { + # calculate the mean + $result = $sum/$len; + } elsif ($type eq "Median") { + # sort the list numerically, least to greatest + @nums = sort { $a <=> $b } @nums; + if ($len % 2 eq 0) { + # get the two middle numbers, since the + # length is even, and calculate their mean + $result = ($nums[$len/2] + $nums[$len/2-1])/2; + } else { + # get the middle number + $result = $nums[int($len/2)] } + } else { + $result += ($_ ** 2) for @nums; + $result /= $len; + $result = sqrt $result; + } + + return "$type: $result", + structured_answer => { + input => [html_enc($_)], + operation => $type . ' of', + result => html_enc($result), }; }; diff --git a/share/goodie/average/average.css b/share/goodie/average/average.css deleted file mode 100644 index 28e2a274c..000000000 --- a/share/goodie/average/average.css +++ /dev/null @@ -1,11 +0,0 @@ -.zci--average .c-base__content { - font-size: 1.2em; -} - -.zci--average .average--key { - font-weight: 300; -} - -.zci--average .average--value { - font-weight: 500; -} \ No newline at end of file diff --git a/share/goodie/average/content.handlebars b/share/goodie/average/content.handlebars deleted file mode 100644 index cd504c549..000000000 --- a/share/goodie/average/content.handlebars +++ /dev/null @@ -1,12 +0,0 @@ -
- Mean: - {{mean}} -
-
- Median: - {{median}} -
-
- Root Mean Square: - {{rms}} -
\ No newline at end of file diff --git a/t/Average.t b/t/Average.t index 2ef796fcc..d6ffef29d 100644 --- a/t/Average.t +++ b/t/Average.t @@ -13,155 +13,67 @@ ddg_goodie_test( DDG::Goodie::Average )], '1 2 3 avg' => test_zci( - "Mean: 2; Median: 2; Root Mean Square: 2.16024689946929", + "Mean: 2", structured_answer => { - id => 'average', - name => 'Math', - data => { - mean => 2, - median => 2, - rms => 2.16024689946929 - }, - templates => { - group => 'text', - item => 0, - options => { - content => 'DDH.average.content' - } - } + input => ['1 2 3'], + operation => "Mean of", + result => '2', } ), 'mean 1, 2, 3' => test_zci( - "Mean: 2; Median: 2; Root Mean Square: 2.16024689946929", + "Mean: 2", structured_answer => { - id => 'average', - name => 'Math', - data => { - mean => 2, - median => 2, - rms => 2.16024689946929 - }, - templates => { - group => 'text', - item => 0, - options => { - content => 'DDH.average.content' - } - } + input => ['1 2 3'], + operation => "Mean of", + result => '2', } ), 'root mean square 1,2,3' => test_zci( - "Mean: 2; Median: 2; Root Mean Square: 2.16024689946929", + "Root Mean Square: 2.16024689946929", structured_answer => { - id => 'average', - name => 'Math', - data => { - mean => 2, - median => 2, - rms => 2.16024689946929 - }, - templates => { - group => 'text', - item => 0, - options => { - content => 'DDH.average.content' - } - } + input => ['1 2 3'], + operation => "Root Mean Square of", + result => '2.16024689946929', } ), "average 12 45 78 1234.12" => test_zci( - "Mean: 342.28; Median: 61.5; Root Mean Square: 618.72958034993", + "Mean: 342.28", structured_answer => { - id => 'average', - name => 'Math', - data => { - mean => 342.28, - median => 61.5, - rms => 618.72958034993 - }, - templates => { - group => 'text', - item => 0, - options => { - content => 'DDH.average.content' - } - } + input => ['12 45 78 1234.12'], + operation => "Mean of", + result => '342.28', } ), "average 12, 45, 78, 1234.12" => test_zci( - "Mean: 342.28; Median: 61.5; Root Mean Square: 618.72958034993", + "Mean: 342.28", structured_answer => { - id => 'average', - name => 'Math', - data => { - mean => 342.28, - median => 61.5, - rms => 618.72958034993 - }, - templates => { - group => 'text', - item => 0, - options => { - content => 'DDH.average.content' - } - } + input => ['12 45 78 1234.12'], + operation => "Mean of", + result => '342.28', } ), "average 12;45;78;1234.12" => test_zci( - "Mean: 342.28; Median: 61.5; Root Mean Square: 618.72958034993", + "Mean: 342.28", structured_answer => { - id => 'average', - name => 'Math', - data => { - mean => 342.28, - median => 61.5, - rms => 618.72958034993 - }, - templates => { - group => 'text', - item => 0, - options => { - content => 'DDH.average.content' - } - } + input => ['12 45 78 1234.12'], + operation => "Mean of", + result => '342.28', } ), 'average 12, 45, 78, 1234' => test_zci( - 'Mean: 342.25; Median: 61.5; Root Mean Square: 618.669742269654', + 'Mean: 342.25', structured_answer => { - id => 'average', - name => 'Math', - data => { - mean => 342.25, - median => 61.5, - rms => 618.669742269654 - }, - templates => { - group => 'text', - item => 0, - options => { - content => 'DDH.average.content' - } - } + input => ['12 45 78 1234'], + operation => "Mean of", + result => '342.25', } ), - 'avg 1,2,3' => test_zci( - 'Mean: 2; Median: 2; Root Mean Square: 2.16024689946929', + 'median 1,2,3' => test_zci( + 'Median: 2', structured_answer => { - id => 'average', - name => 'Math', - data => { - mean => 2, - median => 2, - rms => 2.16024689946929 - }, - templates => { - group => 'text', - item => 0, - options => { - content => 'DDH.average.content' - } - } + input => ['1 2 3'], + operation => "Median of", + result => '2', } ), From 460198266ae323993eb9e908596fed67c54a2256 Mon Sep 17 00:00:00 2001 From: Mailkov Date: Tue, 1 Dec 2015 18:27:04 +0000 Subject: [PATCH 192/379] Issue #1163 - fix name on ColorCodes --- lib/DDG/Goodie/ColorCodes.pm | 2 +- t/ColorCodes.t | 26 +++++++++++++------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/DDG/Goodie/ColorCodes.pm b/lib/DDG/Goodie/ColorCodes.pm index 899d1e1f0..6204bd4f5 100755 --- a/lib/DDG/Goodie/ColorCodes.pm +++ b/lib/DDG/Goodie/ColorCodes.pm @@ -152,7 +152,7 @@ handle matches => sub { return "$hexc ~ $rgb ~ $rgb_pct ~ $hslc ~ $cmyb$column_2", structured_answer => { id => 'color_codes', - name => 'Programming', + name => 'Answer', data => { hex_code => $hex_code, hexc => $hexc, diff --git a/t/ColorCodes.t b/t/ColorCodes.t index 1abbb272b..16fd63d52 100755 --- a/t/ColorCodes.t +++ b/t/ColorCodes.t @@ -12,7 +12,7 @@ my @green_args = ( 'Hex: #00FF00 ~ RGBA(0, 255, 0, 1) ~ RGB(0%, 100%, 0%) ~ HSL(120, 100%, 50%) ~ CMYB(100%, 0%, 100%, 0%)'."\n".'Complementary: #FF00FF'."\n".'Analogous: #00FF80, #80FF00', structured_answer => { id => 'color_codes', - name => 'Programming', + name => 'Answer', data => '-ANY-', templates => { group => 'text', @@ -31,7 +31,7 @@ ddg_goodie_test( 'Hex: #00FFFF ~ RGBA(0, 255, 255, 1) ~ RGB(0%, 100%, 100%) ~ HSL(180, 100%, 50%) ~ CMYB(100%, 0%, 0%, 0%)'."\n".'Complementary: #FF0000'."\n".'Analogous: #0080FF, #00FF80', structured_answer => { id => 'color_codes', - name => 'Programming', + name => 'Answer', data => '-ANY-', templates => { group => 'text', @@ -46,7 +46,7 @@ ddg_goodie_test( 'Hex: #ADD8E6 ~ RGBA(173, 216, 230, 1) ~ RGB(68%, 85%, 90%) ~ HSL(195, 53%, 79%) ~ CMYB(25%, 6%, 0%, 10%)'."\n".'Complementary: #E6BAAC'."\n".'Analogous: #ACBAE6, #ACE6D7', structured_answer => { id => 'color_codes', - name => 'Programming', + name => 'Answer', data => '-ANY-', templates => { group => 'text', @@ -61,7 +61,7 @@ ddg_goodie_test( 'Hex: #ADD8E5 ~ RGBA(173, 216, 229, 1) ~ RGB(68%, 85%, 90%) ~ HSL(194, 53%, 79%) ~ CMYB(25%, 6%, 0%, 10%)'."\n".'Complementary: #E6BBAE'."\n".'Analogous: #AEBDE6, #AEE6D7', structured_answer => { id => 'color_codes', - name => 'Programming', + name => 'Answer', data => '-ANY-', templates => { group => 'text', @@ -76,7 +76,7 @@ ddg_goodie_test( 'Hex: #E0FFFF ~ RGBA(224, 255, 255, 1) ~ RGB(88%, 100%, 100%) ~ HSL(180, 100%, 94%) ~ CMYB(12%, 0%, 0%, 0%)'."\n".'Complementary: #FFE0E0'."\n".'Analogous: #E0F0FF, #E0FFF0', structured_answer => { id => 'color_codes', - name => 'Programming', + name => 'Answer', data => '-ANY-', templates => { group => 'text', @@ -95,7 +95,7 @@ ddg_goodie_test( 'Hex: #00FFFF ~ RGBA(0, 255, 255, 1) ~ RGB(0%, 100%, 100%) ~ HSL(180, 100%, 50%) ~ CMYB(100%, 0%, 0%, 0%)'."\n".'Complementary: #FF0000'."\n".'Analogous: #0080FF, #00FF80', structured_answer => { id => 'color_codes', - name => 'Programming', + name => 'Answer', data => '-ANY-', templates => { group => 'text', @@ -110,7 +110,7 @@ ddg_goodie_test( 'Hex: #FF00FF ~ RGBA(255, 0, 255, 1) ~ RGB(100%, 0%, 100%) ~ HSL(300, 100%, 50%) ~ CMYB(0%, 100%, 0%, 0%)'."\n".'Complementary: #00FF00'."\n".'Analogous: #FF0080, #8000FF', structured_answer => { id => 'color_codes', - name => 'Programming', + name => 'Answer', data => '-ANY-', templates => { group => 'text', @@ -125,7 +125,7 @@ ddg_goodie_test( 'Hex: #202428 ~ RGBA(32, 36, 40, 1) ~ RGB(13%, 14%, 16%) ~ HSL(210, 11%, 14%) ~ CMYB(20%, 10%, 0%, 84%)'."\n".'Complementary: #292521'."\n".'Analogous: #212129, #212929', structured_answer => { id => 'color_codes', - name => 'Programming', + name => 'Answer', data => '-ANY-', templates => { group => 'text', @@ -141,7 +141,7 @@ ddg_goodie_test( 'Hex: #FF0000 ~ RGBA(255, 0, 0, 1) ~ RGB(100%, 0%, 0%) ~ HSL(0, 100%, 50%) ~ CMYB(0%, 100%, 100%, 0%)'."\n".'Complementary: #00FFFF'."\n".'Analogous: #FF8000, #FF0080', structured_answer => { id => 'color_codes', - name => 'Programming', + name => 'Answer', data => '-ANY-', templates => { group => 'text', @@ -156,7 +156,7 @@ ddg_goodie_test( 'Hex: #633CB0 ~ RGBA(99, 60, 176, 0.5) ~ RGB(39%, 24%, 69%) ~ HSL(260, 49%, 46%) ~ CMYB(44%, 66%, 0%, 31%)'."\n".'Complementary: #89B03C'."\n".'Analogous: #9D3CB0, #3C4FB0', structured_answer => { id => 'color_codes', - name => 'Programming', + name => 'Answer', data => '-ANY-', templates => { group => 'text', @@ -171,7 +171,7 @@ ddg_goodie_test( 'Hex: #DC5F3C ~ RGBA(220, 95, 60, 1) ~ RGB(86%, 37%, 24%) ~ HSL(13, 70%, 55%) ~ CMYB(0%, 57%, 73%, 14%)'."\n".'Complementary: #3BB9DB'."\n".'Analogous: #DBAE3B, #DB3B69', structured_answer => { id => 'color_codes', - name => 'Programming', + name => 'Answer', data => '-ANY-', templates => { group => 'text', @@ -187,7 +187,7 @@ ddg_goodie_test( 'Hex: #000000 ~ RGBA(0, 0, 0, 1) ~ RGB(0%, 0%, 0%) ~ HSL(0, 0%, 0%) ~ CMYB(0%, 0%, 0%, 100%)', structured_answer => { id => 'color_codes', - name => 'Programming', + name => 'Answer', data => '-ANY-', templates => { group => 'text', @@ -202,7 +202,7 @@ ddg_goodie_test( 'Hex: #FFFFFF ~ RGBA(255, 255, 255, 1) ~ RGB(100%, 100%, 100%) ~ HSL(0, 0%, 100%) ~ CMYB(0%, 0%, 0%, 0%)', structured_answer => { id => 'color_codes', - name => 'Programming', + name => 'Answer', data => '-ANY-', templates => { group => 'text', From 32f070f8f7db344405e9cae0b84c302ccabfc2dd Mon Sep 17 00:00:00 2001 From: JOBIN PHILIP ABRAHAM Date: Wed, 2 Dec 2015 20:51:12 +0530 Subject: [PATCH 193/379] Update intellij.json updated desc --- share/goodie/cheat_sheets/json/intellij.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/goodie/cheat_sheets/json/intellij.json b/share/goodie/cheat_sheets/json/intellij.json index b63dc987b..cdd8a3817 100644 --- a/share/goodie/cheat_sheets/json/intellij.json +++ b/share/goodie/cheat_sheets/json/intellij.json @@ -1,7 +1,7 @@ { "id": "intellij_cheat_sheet", "name": "JetBrains IntelliJ IDEA", - "descriptions": "Java IDE, developed by JetBrains (formerly known as IntelliJ), and is available as an Apache 2 Licensed community edition,[1] and in a proprietary commercial edition", + "descriptions": "Keyboard shortcuts for IntelliJ IDEA, a Java IDE developed by JetBrains", "metadata": { "sourceName": "Shortcut World", "sourceUrl": "http://www.shortcutworld.com/en/win/IntelliJ.html" From 5ad0c530057364cb11bca0f1c1d9eb58836fef2b Mon Sep 17 00:00:00 2001 From: JOBIN PHILIP ABRAHAM Date: Wed, 2 Dec 2015 21:01:28 +0530 Subject: [PATCH 194/379] Update jive-talk.json --- share/goodie/cheat_sheets/json/jive-talk.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/goodie/cheat_sheets/json/jive-talk.json b/share/goodie/cheat_sheets/json/jive-talk.json index 510260db4..e8a348f52 100644 --- a/share/goodie/cheat_sheets/json/jive-talk.json +++ b/share/goodie/cheat_sheets/json/jive-talk.json @@ -3,7 +3,7 @@ "name": "Jive Talk", "description": "Language of Jive", "metadata": { - "sourceName": "Hepcats Jive Dictionary", + "sourceName": "Scribd", "sourceUrl": "http://www.scribd.com/doc/57707658/Hepcats-Jive-Dictionary" }, "template_type": "reference", From 014fb5b1e4998fafd525f00e8086734ff292c91b Mon Sep 17 00:00:00 2001 From: JOBIN PHILIP ABRAHAM Date: Wed, 2 Dec 2015 21:06:44 +0530 Subject: [PATCH 195/379] Update kerbal-space-program.json --- share/goodie/cheat_sheets/json/kerbal-space-program.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/share/goodie/cheat_sheets/json/kerbal-space-program.json b/share/goodie/cheat_sheets/json/kerbal-space-program.json index 6f2c766b7..c1ebfe59e 100644 --- a/share/goodie/cheat_sheets/json/kerbal-space-program.json +++ b/share/goodie/cheat_sheets/json/kerbal-space-program.json @@ -1,7 +1,7 @@ { "id": "kerbal_space_program_cheat_sheet", "name": "Kerbal Space Program", - "description": "Space simulation game", + "description": "Keyboard shortcuts for Kerbal Space Program, a Space flight simulator game", "metadata": { "sourceName": "Kerbal Space Program Wiki", "sourceUrl": "http://wiki.kerbalspaceprogram.com/wiki/Key_bindings" @@ -9,7 +9,7 @@ "section_order": [ "System/UI Commands", "Flight Controls", - "Docking mode", + "Docking Mode", "EVA Commands", "VAB/SPH Commands" ], @@ -211,7 +211,7 @@ "key":"End", "val":"Scroll stage icons down" }], - "Docking mode": [{ + "Docking Mode": [{ "key":"W", "val":"Pitch adjustment (up/back) / Translate forward" }, { From 1dc362d65b8151f31000c5787b038c6958b97c0e Mon Sep 17 00:00:00 2001 From: JOBIN PHILIP ABRAHAM Date: Wed, 2 Dec 2015 21:10:01 +0530 Subject: [PATCH 196/379] Update cpp.json --- share/goodie/cheat_sheets/json/cpp.json | 1 - 1 file changed, 1 deletion(-) diff --git a/share/goodie/cheat_sheets/json/cpp.json b/share/goodie/cheat_sheets/json/cpp.json index afcb68e5c..6a885a03a 100644 --- a/share/goodie/cheat_sheets/json/cpp.json +++ b/share/goodie/cheat_sheets/json/cpp.json @@ -1,7 +1,6 @@ { "id": "cpp_cheat_sheet", "name": "C++", - "description": "A quick reference of c++ language", "metadata": { "sourceName": "CCU", "sourceUrl": "http://www.cs.ccu.edu.tw/~damon/oop/,c++refcard.pdf" From ad9a9e35b06a2d13e1645cb6fa1052728f9ed4ea Mon Sep 17 00:00:00 2001 From: JOBIN PHILIP ABRAHAM Date: Wed, 2 Dec 2015 21:14:53 +0530 Subject: [PATCH 197/379] Update 8085.json --- share/goodie/cheat_sheets/json/8085.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/share/goodie/cheat_sheets/json/8085.json b/share/goodie/cheat_sheets/json/8085.json index 599ef0df4..bbc6fe645 100644 --- a/share/goodie/cheat_sheets/json/8085.json +++ b/share/goodie/cheat_sheets/json/8085.json @@ -207,19 +207,19 @@ }, { "key": "DI", - "val": "Disable interrupts" + "val": "Disable Interrupts" }, { "key": "EI", - "val": "Enable interrupts" + "val": "Enable Interrupts" }, { "key": "RIM", - "val": "Read interrupt mask" + "val": "Read Interrupt Mask" }, { "key": "SIM", - "val": "Set interrupt mask" + "val": "Set Interrupt Mask" }, { "key": "CLI", From 3fd7c6b78091fc78f046baacc7554856747c21f9 Mon Sep 17 00:00:00 2001 From: harisphnx Date: Wed, 2 Dec 2015 15:55:46 +0000 Subject: [PATCH 198/379] suggestions edited --- share/goodie/cheat_sheets/json/c.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/share/goodie/cheat_sheets/json/c.json b/share/goodie/cheat_sheets/json/c.json index 7c3deb270..c178ab885 100644 --- a/share/goodie/cheat_sheets/json/c.json +++ b/share/goodie/cheat_sheets/json/c.json @@ -159,10 +159,6 @@ "val": "Ternary conditional", "key": "a ? b : c" }, - { - "val": "Comma", - "key": "a, b" - } ], "Conversion Characters": [ { From e0ba51760e4524fe9cd76bebb434ad1edc7e4657 Mon Sep 17 00:00:00 2001 From: harisphnx Date: Wed, 2 Dec 2015 16:12:14 +0000 Subject: [PATCH 199/379] suggestion edited --- share/goodie/cheat_sheets/json/c.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/goodie/cheat_sheets/json/c.json b/share/goodie/cheat_sheets/json/c.json index c178ab885..235d1dd4a 100644 --- a/share/goodie/cheat_sheets/json/c.json +++ b/share/goodie/cheat_sheets/json/c.json @@ -158,7 +158,7 @@ { "val": "Ternary conditional", "key": "a ? b : c" - }, + } ], "Conversion Characters": [ { From 7d29b0af1903b6733bb2a7131b36676428a8e85a Mon Sep 17 00:00:00 2001 From: Zaahir Moolla Date: Wed, 2 Dec 2015 12:33:33 -0500 Subject: [PATCH 200/379] remove aliases from ubuntu.json that should trigger ubuntu-unity.json --- share/goodie/cheat_sheets/json/ubuntu.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/share/goodie/cheat_sheets/json/ubuntu.json b/share/goodie/cheat_sheets/json/ubuntu.json index c19b57d0e..882d6ca77 100644 --- a/share/goodie/cheat_sheets/json/ubuntu.json +++ b/share/goodie/cheat_sheets/json/ubuntu.json @@ -6,9 +6,6 @@ "sourceName": "Ubuntu Unity", "sourceUrl": "http://www.cheat-sheets.org/saved-copy/ubunturef.pdf" }, - "aliases": [ - "ubuntu unity", "unity ubuntu" - ], "template_type": "terminal", "section_order": [ "Privileges", From c2a72a392cf8629537cbd58ead80ce347a417b08 Mon Sep 17 00:00:00 2001 From: Zaahir Moolla Date: Wed, 2 Dec 2015 12:38:45 -0500 Subject: [PATCH 201/379] Update sourceName to match domain --- share/goodie/cheat_sheets/json/ubuntu.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/goodie/cheat_sheets/json/ubuntu.json b/share/goodie/cheat_sheets/json/ubuntu.json index 882d6ca77..b184910db 100644 --- a/share/goodie/cheat_sheets/json/ubuntu.json +++ b/share/goodie/cheat_sheets/json/ubuntu.json @@ -3,7 +3,7 @@ "name": "Linux Ubuntu", "description": "Ubuntu Reference", "metadata": { - "sourceName": "Ubuntu Unity", + "sourceName": "Cheat-Sheets.org", "sourceUrl": "http://www.cheat-sheets.org/saved-copy/ubunturef.pdf" }, "template_type": "terminal", From 4de6572b4d0b43b7ac4e330f3d989332c6a2b061 Mon Sep 17 00:00:00 2001 From: Zach Thompson Date: Wed, 2 Dec 2015 10:49:50 -0700 Subject: [PATCH 202/379] Remove test for Shortcut --- t/Shortcut.t | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 t/Shortcut.t diff --git a/t/Shortcut.t b/t/Shortcut.t deleted file mode 100644 index 0b37de2b2..000000000 --- a/t/Shortcut.t +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env perl - -use utf8; -use strict; -use warnings; -use Test::More; -use DDG::Test::Goodie; - -zci answer_type => 'shortcut'; -zci is_cached => 1; - -my $start = 'The shortcut for '; -my $first = 'Show desktop in Windows is ⊞Win+D or ⊞Win+M (then use ⊞Win+⇧Shift+M to bring back all windows)'; -my $second = 'New folder in KDE/GNOME is Ctrl+⇧Shift+N'; -my $third = 'Redo in Mac OS is ⇧Shift+⌘Cmd+Z'; -my $fourth = 'Paste special in KDE/GNOME is Ctrl+⇧Shift+V'; -my $br = '
'; -my $link = 'More at Wikipedia'; - -ddg_goodie_test( - [qw( DDG::Goodie::Shortcut - )], - 'windows show desktop shortcut' => test_zci($start . $first, html => $start . $first . $br . $link), - 'ubuntu shortcut new folder' => test_zci($start . $second, html => $start . $second . $br . $link), - 'redo shortcut mac' => test_zci($start . $third, html => $start . $third . $br . $link), - 'paste special shortcut' => undef #test_zci($start . $fourth, html => $start . $fourth . $br . $link) -); - -done_testing; From aeabcb335ef8f0a7932a08ad3dc9962b1012146f Mon Sep 17 00:00:00 2001 From: Mailkov Date: Wed, 2 Dec 2015 18:04:00 +0000 Subject: [PATCH 203/379] Issue #1163 - Convert ResistorColors to use template --- lib/DDG/Goodie/ResistorColors.pm | 46 ++++-- .../goodie/resistor_colors/content.handlebars | 5 + .../resistor_colors/resistor_colors.css | 30 ++-- t/ResistorColors.t | 150 +++++++++++------- 4 files changed, 149 insertions(+), 82 deletions(-) create mode 100644 share/goodie/resistor_colors/content.handlebars diff --git a/lib/DDG/Goodie/ResistorColors.pm b/lib/DDG/Goodie/ResistorColors.pm index f1b6e839e..78fd279ce 100644 --- a/lib/DDG/Goodie/ResistorColors.pm +++ b/lib/DDG/Goodie/ResistorColors.pm @@ -32,7 +32,8 @@ topics 'science'; attribution twitter => 'joewalnes', web => ['http://joewalnes.com', 'Joe Walnes'], email => ['joe@walnes.com', 'Joe Walnes'], - github => ["https://github.com/HackOrQuack", "HackOrQuack"]; + github => ["https://github.com/HackOrQuack", "HackOrQuack"], + github => ["https://github.com/Mailkov", "Melchiorre Alastra"]; # These hex codes came from # http://en.wikipedia.org/wiki/Electronic_color_code @@ -133,13 +134,12 @@ sub render { my $ohms = $formatted_value eq '1' ? 'ohm' : 'ohms'; my $text = "$formatted_value\x{2126}"; my $bands = ucfirst to_string(scalar @$digits); - my $html = "
" . - "

$text

" . - "

$bands Bands

" . - "
"; + + my $title = $text; $text .= " ($ohms) resistor colors:"; #while (my ($index, $digit) = each @$digits) { + my @resistor_bands; my $index = 0; foreach my $digit (@$digits) { if (exists $digits_to_colors{$digit}) { @@ -151,12 +151,12 @@ sub render { if ($index == scalar(@$digits) - 2) { # multiplier digit $text_prefix = "\x{00D7}"; - $html_prefix = '×'; + $html_prefix = '×'; $display_digit = $digits_to_colors{$digit}{multiplier}; } elsif ($index == scalar(@$digits) - 1) { # tolerance digit $text_prefix = "\x{00B1}"; - $html_prefix = '±'; + $html_prefix = '±'; $display_digit = $digits_to_colors{$digit}{tolerance}; } else { # numeric digits @@ -168,18 +168,38 @@ sub render { if ($index != scalar(@$digits - 1)) { $text .= ','; # Comma delimit all but last } - $html .= "$name $html_prefix$display_digit"; + + push (@resistor_bands, { + class => $class, + name => $name, + html_prefix => $html_prefix, + display_digit => $display_digit + }); + } else { return; } $index++; } - $html .= "
" - . "
" - . "" - . "More at resisto.rs"; - return $text, html => $html; + return $text, + structured_answer => { + id => 'resistor_colors', + name => 'Answer', + data => { + title => $title, + subtitle => $bands . ' Bands', + resistor_bands => \@resistor_bands, + formatted_value => $formatted_value + }, + templates => { + group => 'text', + item => 0, + options => { + content => 'DDH.resistor_colors.content' + } + } + }; }; 1; diff --git a/share/goodie/resistor_colors/content.handlebars b/share/goodie/resistor_colors/content.handlebars new file mode 100644 index 000000000..801f049f4 --- /dev/null +++ b/share/goodie/resistor_colors/content.handlebars @@ -0,0 +1,5 @@ +{{#each resistor_bands}} + {{name}} {{html_prefix}}{{display_digit}} +{{/each}} +
+More at resisto.rs \ No newline at end of file diff --git a/share/goodie/resistor_colors/resistor_colors.css b/share/goodie/resistor_colors/resistor_colors.css index 212711568..3342ba23c 100644 --- a/share/goodie/resistor_colors/resistor_colors.css +++ b/share/goodie/resistor_colors/resistor_colors.css @@ -1,4 +1,4 @@ -.zci--answer .zci--resistor-colors .resistor-band { +.zci--resistor_colors .resistor-band { padding: 5px 15px; display: inline-block; margin-right: 5px; @@ -6,56 +6,60 @@ color: #333; } -.zci--answer .zci--resistor-colors .resistor-band.silver { +.zci--resistor_colors .resistor-band.silver { background-color: #d0d0d0; } -.zci--answer .zci--resistor-colors .resistor-band.gold { +.zci--resistor_colors .resistor-band.gold { background-color: #f2d374; } -.zci--answer .zci--resistor-colors .resistor-band.black { +.zci--resistor_colors .resistor-band.black { background-color: #333333; color: #ffffff; } -.zci--answer .zci--resistor-colors .resistor-band.brown { +.zci--resistor_colors .resistor-band.brown { background-color: #726258; color: #ffffff; } -.zci--answer .zci--resistor-colors .resistor-band.red { +.zci--resistor_colors .resistor-band.red { background-color: #de4f33; color: #ffffff; } -.zci--answer .zci--resistor-colors .resistor-band.orange { +.zci--resistor_colors .resistor-band.orange { background-color: #f4912d; } -.zci--answer .zci--resistor-colors .resistor-band.yellow { +.zci--resistor_colors .resistor-band.yellow { background-color: #ffc240; } -.zci--answer .zci--resistor-colors .resistor-band.green { +.zci--resistor_colors .resistor-band.green { background-color: #8fc547; } -.zci--answer .zci--resistor-colors .resistor-band.blue { +.zci--resistor_colors .resistor-band.blue { background-color: #4a96d1; color: #ffffff; } -.zci--answer .zci--resistor-colors .resistor-band.purple { +.zci--resistor_colors .resistor-band.purple { background-color: #8461a7; color: #ffffff; } -.zci--answer .zci--resistor-colors .resistor-band.gray { +.zci--resistor_colors .resistor-band.gray { background-color: #a0a0a0; color: #ffffff; } -.zci--answer .zci--resistor-colors .resistor-band.white { +.zci--resistor_colors .resistor-band.white { background-color: #ffffff; } + +.zci--resistor_colors .zci__more-at { + margin-top: 20px; +} diff --git a/t/ResistorColors.t b/t/ResistorColors.t index cc1c24fc6..589b61b2a 100644 --- a/t/ResistorColors.t +++ b/t/ResistorColors.t @@ -8,81 +8,116 @@ use DDG::Test::Goodie; zci answer_type => "resistor_colors"; zci is_cached => 1; +my %basic_answer = ( + structured_answer => { + id => 'resistor_colors', + name => 'Answer', + data => '-ANY-', + templates => { + group => 'text', + item => 0, + options => { + content => 'DDH.resistor_colors.content' + } + } + } +); + +my %data = ( + data => { + title => '4.7K\x{2126}', + subtitle => 'Four Bands', + resistor_bands => ( + {class => 'yellow', name => 'Yellow', html_prefix => '' ,display_digit => '4'}, + {class => 'purple', name => 'Purple', html_prefix => '' ,display_digit => '7'}, + {class => 'red', name => 'Red', html_prefix => '\x{00D7}' ,display_digit => '100'}, + {class => 'gold', name => 'Gold', html_prefix => '\x{00B1}' ,display_digit => '5%'} + ), + formatted_value => '4.7K' + } + ); + +sub test_structured_answer { + delete($basic_answer{data}); + $basic_answer{data} = %data; + return %basic_answer; +} + ddg_goodie_test( [qw( DDG::Goodie::ResistorColors )], # Check trigger kicks in. - "330 ohms" => test_zci("330\x{2126} (ohms) resistor colors: orange (3), orange (3), brown (\x{00D7}10), gold (\x{00B1}5%)", html => qr/./), - "330 ohm" => test_zci("330\x{2126} (ohms) resistor colors: orange (3), orange (3), brown (\x{00D7}10), gold (\x{00B1}5%)", html => qr/./), - "330 \x{2126}" => test_zci("330\x{2126} (ohms) resistor colors: orange (3), orange (3), brown (\x{00D7}10), gold (\x{00B1}5%)", html => qr/./), - "330ohms" => test_zci("330\x{2126} (ohms) resistor colors: orange (3), orange (3), brown (\x{00D7}10), gold (\x{00B1}5%)", html => qr/./), - "330ohm" => test_zci("330\x{2126} (ohms) resistor colors: orange (3), orange (3), brown (\x{00D7}10), gold (\x{00B1}5%)", html => qr/./), - "330\x{2126}" => test_zci("330\x{2126} (ohms) resistor colors: orange (3), orange (3), brown (\x{00D7}10), gold (\x{00B1}5%)", html => qr/./), - "330 ohms resistor" => test_zci("330\x{2126} (ohms) resistor colors: orange (3), orange (3), brown (\x{00D7}10), gold (\x{00B1}5%)", html => qr/./), - "330 ohm resistor" => test_zci("330\x{2126} (ohms) resistor colors: orange (3), orange (3), brown (\x{00D7}10), gold (\x{00B1}5%)", html => qr/./), - "330 \x{2126} resistor" => test_zci("330\x{2126} (ohms) resistor colors: orange (3), orange (3), brown (\x{00D7}10), gold (\x{00B1}5%)", html => qr/./), - "330ohms resistor" => test_zci("330\x{2126} (ohms) resistor colors: orange (3), orange (3), brown (\x{00D7}10), gold (\x{00B1}5%)", html => qr/./), - "330ohm resistor" => test_zci("330\x{2126} (ohms) resistor colors: orange (3), orange (3), brown (\x{00D7}10), gold (\x{00B1}5%)", html => qr/./), - "330\x{2126} resistor" => test_zci("330\x{2126} (ohms) resistor colors: orange (3), orange (3), brown (\x{00D7}10), gold (\x{00B1}5%)", html => qr/./), - "330 resistor" => test_zci("330\x{2126} (ohms) resistor colors: orange (3), orange (3), brown (\x{00D7}10), gold (\x{00B1}5%)", html => qr/./), + "330 ohms" => test_zci("330\x{2126} (ohms) resistor colors: orange (3), orange (3), brown (\x{00D7}10), gold (\x{00B1}5%)", %basic_answer), + "330 ohm" => test_zci("330\x{2126} (ohms) resistor colors: orange (3), orange (3), brown (\x{00D7}10), gold (\x{00B1}5%)", %basic_answer), + "330 \x{2126}" => test_zci("330\x{2126} (ohms) resistor colors: orange (3), orange (3), brown (\x{00D7}10), gold (\x{00B1}5%)", %basic_answer), + "330ohms" => test_zci("330\x{2126} (ohms) resistor colors: orange (3), orange (3), brown (\x{00D7}10), gold (\x{00B1}5%)", %basic_answer), + "330ohm" => test_zci("330\x{2126} (ohms) resistor colors: orange (3), orange (3), brown (\x{00D7}10), gold (\x{00B1}5%)", %basic_answer), + "330\x{2126}" => test_zci("330\x{2126} (ohms) resistor colors: orange (3), orange (3), brown (\x{00D7}10), gold (\x{00B1}5%)", %basic_answer), + "330 ohms resistor" => test_zci("330\x{2126} (ohms) resistor colors: orange (3), orange (3), brown (\x{00D7}10), gold (\x{00B1}5%)", %basic_answer), + "330 ohm resistor" => test_zci("330\x{2126} (ohms) resistor colors: orange (3), orange (3), brown (\x{00D7}10), gold (\x{00B1}5%)", %basic_answer), + "330 \x{2126} resistor" => test_zci("330\x{2126} (ohms) resistor colors: orange (3), orange (3), brown (\x{00D7}10), gold (\x{00B1}5%)", %basic_answer), + "330ohms resistor" => test_zci("330\x{2126} (ohms) resistor colors: orange (3), orange (3), brown (\x{00D7}10), gold (\x{00B1}5%)", %basic_answer), + "330ohm resistor" => test_zci("330\x{2126} (ohms) resistor colors: orange (3), orange (3), brown (\x{00D7}10), gold (\x{00B1}5%)", %basic_answer), + "330\x{2126} resistor" => test_zci("330\x{2126} (ohms) resistor colors: orange (3), orange (3), brown (\x{00D7}10), gold (\x{00B1}5%)", %basic_answer), + "330 resistor" => test_zci("330\x{2126} (ohms) resistor colors: orange (3), orange (3), brown (\x{00D7}10), gold (\x{00B1}5%)", %basic_answer), # Various multipliers - "472000 ohms" => test_zci("470K\x{2126} (ohms) resistor colors: yellow (4), purple (7), yellow (\x{00D7}10K), gold (\x{00B1}5%)", html => qr/./), - "400000 ohms" => test_zci("400K\x{2126} (ohms) resistor colors: yellow (4), black (0), yellow (\x{00D7}10K), gold (\x{00B1}5%)", html => qr/./), - "12300 ohms" => test_zci("12K\x{2126} (ohms) resistor colors: brown (1), red (2), orange (\x{00D7}1K), gold (\x{00B1}5%)", html => qr/./), + "472000 ohms" => test_zci("470K\x{2126} (ohms) resistor colors: yellow (4), purple (7), yellow (\x{00D7}10K), gold (\x{00B1}5%)", %basic_answer), + "400000 ohms" => test_zci("400K\x{2126} (ohms) resistor colors: yellow (4), black (0), yellow (\x{00D7}10K), gold (\x{00B1}5%)", %basic_answer), + "12300 ohms" => test_zci("12K\x{2126} (ohms) resistor colors: brown (1), red (2), orange (\x{00D7}1K), gold (\x{00B1}5%)", %basic_answer), # Rounding - "1.2345 ohms" => test_zci("1.2\x{2126} (ohms) resistor colors: brown (1), red (2), gold (\x{00D7}0.1), gold (\x{00B1}5%)", html => qr/./), - "1.2555 ohms" => test_zci("1.3\x{2126} (ohms) resistor colors: brown (1), orange (3), gold (\x{00D7}0.1), gold (\x{00B1}5%)", html => qr/./), - "12.345 ohms" => test_zci("12\x{2126} (ohms) resistor colors: brown (1), red (2), black (\x{00D7}1), gold (\x{00B1}5%)", html => qr/./), - "12.555 ohms" => test_zci("13\x{2126} (ohms) resistor colors: brown (1), orange (3), black (\x{00D7}1), gold (\x{00B1}5%)", html => qr/./), - "123.45 ohms" => test_zci("120\x{2126} (ohms) resistor colors: brown (1), red (2), brown (\x{00D7}10), gold (\x{00B1}5%)", html => qr/./), - "125.55 ohms" => test_zci("130\x{2126} (ohms) resistor colors: brown (1), orange (3), brown (\x{00D7}10), gold (\x{00B1}5%)", html => qr/./), - "1234.5 ohms" => test_zci("1.2K\x{2126} (ohms) resistor colors: brown (1), red (2), red (\x{00D7}100), gold (\x{00B1}5%)", html => qr/./), - "1255.5 ohms" => test_zci("1.3K\x{2126} (ohms) resistor colors: brown (1), orange (3), red (\x{00D7}100), gold (\x{00B1}5%)", html => qr/./), - "12345 ohms" => test_zci("12K\x{2126} (ohms) resistor colors: brown (1), red (2), orange (\x{00D7}1K), gold (\x{00B1}5%)", html => qr/./), - "12555 ohms" => test_zci("13K\x{2126} (ohms) resistor colors: brown (1), orange (3), orange (\x{00D7}1K), gold (\x{00B1}5%)", html => qr/./), - "123450 ohms" => test_zci("120K\x{2126} (ohms) resistor colors: brown (1), red (2), yellow (\x{00D7}10K), gold (\x{00B1}5%)", html => qr/./), - "125550 ohms" => test_zci("130K\x{2126} (ohms) resistor colors: brown (1), orange (3), yellow (\x{00D7}10K), gold (\x{00B1}5%)", html => qr/./), - "1234500 ohms" => test_zci("1.2M\x{2126} (ohms) resistor colors: brown (1), red (2), green (\x{00D7}100K), gold (\x{00B1}5%)", html => qr/./), - "1255500 ohms" => test_zci("1.3M\x{2126} (ohms) resistor colors: brown (1), orange (3), green (\x{00D7}100K), gold (\x{00B1}5%)", html => qr/./), - "12345000 ohms" => test_zci("12M\x{2126} (ohms) resistor colors: brown (1), red (2), blue (\x{00D7}1M), gold (\x{00B1}5%)", html => qr/./), - "12555000 ohms" => test_zci("13M\x{2126} (ohms) resistor colors: brown (1), orange (3), blue (\x{00D7}1M), gold (\x{00B1}5%)", html => qr/./), - "123450000 ohms" => test_zci("120M\x{2126} (ohms) resistor colors: brown (1), red (2), purple (\x{00D7}10M), gold (\x{00B1}5%)", html => qr/./), - "125550000 ohms" => test_zci("130M\x{2126} (ohms) resistor colors: brown (1), orange (3), purple (\x{00D7}10M), gold (\x{00B1}5%)", html => qr/./), - "1234500000 ohms" => test_zci("1200M\x{2126} (ohms) resistor colors: brown (1), red (2), gray (\x{00D7}100M), gold (\x{00B1}5%)", html => qr/./), - "1255500000 ohms" => test_zci("1300M\x{2126} (ohms) resistor colors: brown (1), orange (3), gray (\x{00D7}100M), gold (\x{00B1}5%)", html => qr/./), + "1.2345 ohms" => test_zci("1.2\x{2126} (ohms) resistor colors: brown (1), red (2), gold (\x{00D7}0.1), gold (\x{00B1}5%)", %basic_answer), + "1.2555 ohms" => test_zci("1.3\x{2126} (ohms) resistor colors: brown (1), orange (3), gold (\x{00D7}0.1), gold (\x{00B1}5%)", %basic_answer), + "12.345 ohms" => test_zci("12\x{2126} (ohms) resistor colors: brown (1), red (2), black (\x{00D7}1), gold (\x{00B1}5%)", %basic_answer), + "12.555 ohms" => test_zci("13\x{2126} (ohms) resistor colors: brown (1), orange (3), black (\x{00D7}1), gold (\x{00B1}5%)", %basic_answer), + "123.45 ohms" => test_zci("120\x{2126} (ohms) resistor colors: brown (1), red (2), brown (\x{00D7}10), gold (\x{00B1}5%)", %basic_answer), + "125.55 ohms" => test_zci("130\x{2126} (ohms) resistor colors: brown (1), orange (3), brown (\x{00D7}10), gold (\x{00B1}5%)", %basic_answer), + "1234.5 ohms" => test_zci("1.2K\x{2126} (ohms) resistor colors: brown (1), red (2), red (\x{00D7}100), gold (\x{00B1}5%)", %basic_answer), + "1255.5 ohms" => test_zci("1.3K\x{2126} (ohms) resistor colors: brown (1), orange (3), red (\x{00D7}100), gold (\x{00B1}5%)", %basic_answer), + "12345 ohms" => test_zci("12K\x{2126} (ohms) resistor colors: brown (1), red (2), orange (\x{00D7}1K), gold (\x{00B1}5%)", %basic_answer), + "12555 ohms" => test_zci("13K\x{2126} (ohms) resistor colors: brown (1), orange (3), orange (\x{00D7}1K), gold (\x{00B1}5%)", %basic_answer), + "123450 ohms" => test_zci("120K\x{2126} (ohms) resistor colors: brown (1), red (2), yellow (\x{00D7}10K), gold (\x{00B1}5%)", %basic_answer), + "125550 ohms" => test_zci("130K\x{2126} (ohms) resistor colors: brown (1), orange (3), yellow (\x{00D7}10K), gold (\x{00B1}5%)", %basic_answer), + "1234500 ohms" => test_zci("1.2M\x{2126} (ohms) resistor colors: brown (1), red (2), green (\x{00D7}100K), gold (\x{00B1}5%)", %basic_answer), + "1255500 ohms" => test_zci("1.3M\x{2126} (ohms) resistor colors: brown (1), orange (3), green (\x{00D7}100K), gold (\x{00B1}5%)", %basic_answer), + "12345000 ohms" => test_zci("12M\x{2126} (ohms) resistor colors: brown (1), red (2), blue (\x{00D7}1M), gold (\x{00B1}5%)", %basic_answer), + "12555000 ohms" => test_zci("13M\x{2126} (ohms) resistor colors: brown (1), orange (3), blue (\x{00D7}1M), gold (\x{00B1}5%)", %basic_answer), + "123450000 ohms" => test_zci("120M\x{2126} (ohms) resistor colors: brown (1), red (2), purple (\x{00D7}10M), gold (\x{00B1}5%)", %basic_answer), + "125550000 ohms" => test_zci("130M\x{2126} (ohms) resistor colors: brown (1), orange (3), purple (\x{00D7}10M), gold (\x{00B1}5%)", %basic_answer), + "1234500000 ohms" => test_zci("1200M\x{2126} (ohms) resistor colors: brown (1), red (2), gray (\x{00D7}100M), gold (\x{00B1}5%)", %basic_answer), + "1255500000 ohms" => test_zci("1300M\x{2126} (ohms) resistor colors: brown (1), orange (3), gray (\x{00D7}100M), gold (\x{00B1}5%)", %basic_answer), # kilo and mega multipliers - "27kohm" => test_zci("27K\x{2126} (ohms) resistor colors: red (2), purple (7), orange (\x{00D7}1K), gold (\x{00B1}5%)", html => qr/./), - "27Kohm" => test_zci("27K\x{2126} (ohms) resistor colors: red (2), purple (7), orange (\x{00D7}1K), gold (\x{00B1}5%)", html => qr/./), - "27 K ohm" => test_zci("27K\x{2126} (ohms) resistor colors: red (2), purple (7), orange (\x{00D7}1K), gold (\x{00B1}5%)", html => qr/./), - "4K2 ohm" => test_zci("4.2K\x{2126} (ohms) resistor colors: yellow (4), red (2), red (\x{00D7}100), gold (\x{00B1}5%)", html => qr/./), - "4.2K ohm" => test_zci("4.2K\x{2126} (ohms) resistor colors: yellow (4), red (2), red (\x{00D7}100), gold (\x{00B1}5%)", html => qr/./), - "27k resistor" => test_zci("27K\x{2126} (ohms) resistor colors: red (2), purple (7), orange (\x{00D7}1K), gold (\x{00B1}5%)", html => qr/./), - "27K resistor" => test_zci("27K\x{2126} (ohms) resistor colors: red (2), purple (7), orange (\x{00D7}1K), gold (\x{00B1}5%)", html => qr/./), - "27 K resistor" => test_zci("27K\x{2126} (ohms) resistor colors: red (2), purple (7), orange (\x{00D7}1K), gold (\x{00B1}5%)", html => qr/./), - "4K2 resistor" => test_zci("4.2K\x{2126} (ohms) resistor colors: yellow (4), red (2), red (\x{00D7}100), gold (\x{00B1}5%)", html => qr/./), - "4.2K resistor" => test_zci("4.2K\x{2126} (ohms) resistor colors: yellow (4), red (2), red (\x{00D7}100), gold (\x{00B1}5%)", html => qr/./), + "27kohm" => test_zci("27K\x{2126} (ohms) resistor colors: red (2), purple (7), orange (\x{00D7}1K), gold (\x{00B1}5%)", %basic_answer), + "27Kohm" => test_zci("27K\x{2126} (ohms) resistor colors: red (2), purple (7), orange (\x{00D7}1K), gold (\x{00B1}5%)", %basic_answer), + "27 K ohm" => test_zci("27K\x{2126} (ohms) resistor colors: red (2), purple (7), orange (\x{00D7}1K), gold (\x{00B1}5%)", %basic_answer), + "4K2 ohm" => test_zci("4.2K\x{2126} (ohms) resistor colors: yellow (4), red (2), red (\x{00D7}100), gold (\x{00B1}5%)", %basic_answer), + "4.2K ohm" => test_zci("4.2K\x{2126} (ohms) resistor colors: yellow (4), red (2), red (\x{00D7}100), gold (\x{00B1}5%)", %basic_answer), + "27k resistor" => test_zci("27K\x{2126} (ohms) resistor colors: red (2), purple (7), orange (\x{00D7}1K), gold (\x{00B1}5%)", %basic_answer), + "27K resistor" => test_zci("27K\x{2126} (ohms) resistor colors: red (2), purple (7), orange (\x{00D7}1K), gold (\x{00B1}5%)", %basic_answer), + "27 K resistor" => test_zci("27K\x{2126} (ohms) resistor colors: red (2), purple (7), orange (\x{00D7}1K), gold (\x{00B1}5%)", %basic_answer), + "4K2 resistor" => test_zci("4.2K\x{2126} (ohms) resistor colors: yellow (4), red (2), red (\x{00D7}100), gold (\x{00B1}5%)", %basic_answer), + "4.2K resistor" => test_zci("4.2K\x{2126} (ohms) resistor colors: yellow (4), red (2), red (\x{00D7}100), gold (\x{00B1}5%)", %basic_answer), # Decimal points - "2.9ohm" => test_zci("2.9\x{2126} (ohms) resistor colors: red (2), white (9), gold (\x{00D7}0.1), gold (\x{00B1}5%)", html => qr/./), - "2.9ohms resistor" => test_zci("2.9\x{2126} (ohms) resistor colors: red (2), white (9), gold (\x{00D7}0.1), gold (\x{00B1}5%)", html => qr/./), + "2.9ohm" => test_zci("2.9\x{2126} (ohms) resistor colors: red (2), white (9), gold (\x{00D7}0.1), gold (\x{00B1}5%)", %basic_answer), + "2.9ohms resistor" => test_zci("2.9\x{2126} (ohms) resistor colors: red (2), white (9), gold (\x{00D7}0.1), gold (\x{00B1}5%)", %basic_answer), # Negative multipliers - "1 ohm" => test_zci("1\x{2126} (ohm) resistor colors: brown (1), black (0), gold (\x{00D7}0.1), gold (\x{00B1}5%)", html => qr/./), - "29 ohms" => test_zci("29\x{2126} (ohms) resistor colors: red (2), white (9), black (\x{00D7}1), gold (\x{00B1}5%)", html => qr/./), + "1 ohm" => test_zci("1\x{2126} (ohm) resistor colors: brown (1), black (0), gold (\x{00D7}0.1), gold (\x{00B1}5%)", %basic_answer), + "29 ohms" => test_zci("29\x{2126} (ohms) resistor colors: red (2), white (9), black (\x{00D7}1), gold (\x{00B1}5%)", %basic_answer), # Zero special case - "0 ohms" => test_zci("0\x{2126} (ohms) resistor colors: black (0), black (0), black (\x{00D7}1), gold (\x{00B1}5%)", html => qr/./), + "0 ohms" => test_zci("0\x{2126} (ohms) resistor colors: black (0), black (0), black (\x{00D7}1), gold (\x{00B1}5%)", %basic_answer), # Range - "99000M ohms" => test_zci("99000M\x{2126} (ohms) resistor colors: white (9), white (9), white (\x{00D7}1000M), gold (\x{00B1}5%)", html => qr/./), + "99000M ohms" => test_zci("99000M\x{2126} (ohms) resistor colors: white (9), white (9), white (\x{00D7}1000M), gold (\x{00B1}5%)", %basic_answer), "99500M ohms" => undef, - "1.1 ohms" => test_zci("1.1\x{2126} (ohms) resistor colors: brown (1), brown (1), gold (\x{00D7}0.1), gold (\x{00B1}5%)", html => qr/./), - "1 ohms" => test_zci("1\x{2126} (ohm) resistor colors: brown (1), black (0), gold (\x{00D7}0.1), gold (\x{00B1}5%)", html => qr/./), + "1.1 ohms" => test_zci("1.1\x{2126} (ohms) resistor colors: brown (1), brown (1), gold (\x{00D7}0.1), gold (\x{00B1}5%)", %basic_answer), + "1 ohms" => test_zci("1\x{2126} (ohm) resistor colors: brown (1), black (0), gold (\x{00D7}0.1), gold (\x{00B1}5%)", %basic_answer), "0.9 ohms" => undef, "-10 ohms" => undef, @@ -92,11 +127,14 @@ ddg_goodie_test( "what is ohms law" => undef, "ohm ma darling" => undef, - # Check the HTML. Just once. + + # Check the content of the structured answer. Just once. "4.7k ohm" => test_zci( "4.7K\x{2126} (ohms) resistor colors: yellow (4), purple (7), red (\x{00D7}100), gold (\x{00B1}5%)", - html => "

4.7K\x{2126}

Four Bands

Yellow 4Purple 7Red ×100Gold ±5%

More at resisto.rs" + test_structured_answer + #html => "

4.7K\x{2126}

Four Bands

Yellow 4Purple 7Red ×100Gold ±5%

More at resisto.rs" ), ); done_testing; + From 51103050898cfd0290164466a3ca8a2393d3f62f Mon Sep 17 00:00:00 2001 From: Mailkov Date: Thu, 3 Dec 2015 15:14:21 +0000 Subject: [PATCH 204/379] Issue #1163 - Check the content of the structured answer --- lib/DDG/Goodie/ColorCodes.pm | 2 +- t/ColorCodes.t | 201 ++++++++--------------------------- 2 files changed, 48 insertions(+), 155 deletions(-) diff --git a/lib/DDG/Goodie/ColorCodes.pm b/lib/DDG/Goodie/ColorCodes.pm index 6204bd4f5..dfbc1a016 100755 --- a/lib/DDG/Goodie/ColorCodes.pm +++ b/lib/DDG/Goodie/ColorCodes.pm @@ -58,7 +58,7 @@ name 'ColorCodes'; code_url 'https://github.com/duckduckgo/zeroclickinfo-goodies/blob/master/lib/DDG/Goodie/ColorCodes.pm'; category 'conversions'; topics 'programming'; -attribution cpan => 'CRZEDPSYC', +attribution cpan => ['CRZEDPSYC', 'CRZEDPSYC'], github => ['http://github.com/mintsoft', 'Rob Emery'], github => ['http://github.com/Mailkov', 'Melchiorre Alastra']; diff --git a/t/ColorCodes.t b/t/ColorCodes.t index 16fd63d52..b5f254ae2 100755 --- a/t/ColorCodes.t +++ b/t/ColorCodes.t @@ -8,8 +8,10 @@ use DDG::Test::Goodie; zci answer_type => 'color_code'; zci is_cached => 1; -my @green_args = ( - 'Hex: #00FF00 ~ RGBA(0, 255, 0, 1) ~ RGB(0%, 100%, 0%) ~ HSL(120, 100%, 50%) ~ CMYB(100%, 0%, 100%, 0%)'."\n".'Complementary: #FF00FF'."\n".'Analogous: #00FF80, #80FF00', + +my $green_answer = 'Hex: #00FF00 ~ RGBA(0, 255, 0, 1) ~ RGB(0%, 100%, 0%) ~ HSL(120, 100%, 50%) ~ CMYB(100%, 0%, 100%, 0%)'."\n".'Complementary: #FF00FF'."\n".'Analogous: #00FF80, #80FF00'; + +my %basic_answer = ( structured_answer => { id => 'color_codes', name => 'Answer', @@ -21,198 +23,89 @@ my @green_args = ( content => 'DDH.color_codes.content' } } - } + } ); +my $data = { + analogous => {'AEBDE6', 'AEE6D7'}, + cmyb => 'CMYB(25%, 6%, 0%, 10%)', + complementary => 'E6BBAE', + hex_code => 'add8e5', + hexc => 'Hex: #ADD8E5', + hslc => 'HSL(194, 53%, 79%)', + rgb => 'RGBA(173, 216, 229, 1)', + show_column_2 => '1' +}; + +sub test_structured_answer { + delete($basic_answer{data}); + $basic_answer{data} = \$data; + return %basic_answer; +} + +sub green_args { + return ($green_answer, %basic_answer); +} + ddg_goodie_test( [qw(DDG::Goodie::ColorCodes)], 'hex color code for cyan' => test_zci( 'Hex: #00FFFF ~ RGBA(0, 255, 255, 1) ~ RGB(0%, 100%, 100%) ~ HSL(180, 100%, 50%) ~ CMYB(100%, 0%, 0%, 0%)'."\n".'Complementary: #FF0000'."\n".'Analogous: #0080FF, #00FF80', - structured_answer => { - id => 'color_codes', - name => 'Answer', - data => '-ANY-', - templates => { - group => 'text', - item => 0, - options => { - content => 'DDH.color_codes.content' - } - } - } + %basic_answer ), 'RGB(173,216,230)' => test_zci( 'Hex: #ADD8E6 ~ RGBA(173, 216, 230, 1) ~ RGB(68%, 85%, 90%) ~ HSL(195, 53%, 79%) ~ CMYB(25%, 6%, 0%, 10%)'."\n".'Complementary: #E6BAAC'."\n".'Analogous: #ACBAE6, #ACE6D7', - structured_answer => { - id => 'color_codes', - name => 'Answer', - data => '-ANY-', - templates => { - group => 'text', - item => 0, - options => { - content => 'DDH.color_codes.content' - } - } - } - ), - 'hsl 194 0.53 0.79' => test_zci( - 'Hex: #ADD8E5 ~ RGBA(173, 216, 229, 1) ~ RGB(68%, 85%, 90%) ~ HSL(194, 53%, 79%) ~ CMYB(25%, 6%, 0%, 10%)'."\n".'Complementary: #E6BBAE'."\n".'Analogous: #AEBDE6, #AEE6D7', - structured_answer => { - id => 'color_codes', - name => 'Answer', - data => '-ANY-', - templates => { - group => 'text', - item => 0, - options => { - content => 'DDH.color_codes.content' - } - } - } + %basic_answer ), 'cmyk(0.12, 0, 0, 0)' => test_zci( 'Hex: #E0FFFF ~ RGBA(224, 255, 255, 1) ~ RGB(88%, 100%, 100%) ~ HSL(180, 100%, 94%) ~ CMYB(12%, 0%, 0%, 0%)'."\n".'Complementary: #FFE0E0'."\n".'Analogous: #E0F0FF, #E0FFF0', - structured_answer => { - id => 'color_codes', - name => 'Answer', - data => '-ANY-', - templates => { - group => 'text', - item => 0, - options => { - content => 'DDH.color_codes.content' - } - } - } + %basic_answer ), - '#00ff00' => test_zci(@green_args), - '#0f0' => test_zci(@green_args), - '#0f0 to rgb' => test_zci(@green_args), - '#0f0 to cmyk' => test_zci(@green_args), + '#00ff00' => test_zci(green_args), + '#0f0' => test_zci(green_args), + '#0f0 to rgb' => test_zci(green_args), + '#0f0 to cmyk' => test_zci(green_args), 'inverse of the color red' => test_zci( 'Hex: #00FFFF ~ RGBA(0, 255, 255, 1) ~ RGB(0%, 100%, 100%) ~ HSL(180, 100%, 50%) ~ CMYB(100%, 0%, 0%, 0%)'."\n".'Complementary: #FF0000'."\n".'Analogous: #0080FF, #00FF80', - structured_answer => { - id => 'color_codes', - name => 'Answer', - data => '-ANY-', - templates => { - group => 'text', - item => 0, - options => { - content => 'DDH.color_codes.content' - } - } - } + %basic_answer ), 'RGB(0 255 0)\'s inverse' => test_zci( 'Hex: #FF00FF ~ RGBA(255, 0, 255, 1) ~ RGB(100%, 0%, 100%) ~ HSL(300, 100%, 50%) ~ CMYB(0%, 100%, 0%, 0%)'."\n".'Complementary: #00FF00'."\n".'Analogous: #FF0080, #8000FF', - structured_answer => { - id => 'color_codes', - name => 'Answer', - data => '-ANY-', - templates => { - group => 'text', - item => 0, - options => { - content => 'DDH.color_codes.content' - } - } - } + %basic_answer ), 'html bluishblack' => test_zci( 'Hex: #202428 ~ RGBA(32, 36, 40, 1) ~ RGB(13%, 14%, 16%) ~ HSL(210, 11%, 14%) ~ CMYB(20%, 10%, 0%, 84%)'."\n".'Complementary: #292521'."\n".'Analogous: #212129, #212929', - structured_answer => { - id => 'color_codes', - name => 'Answer', - data => '-ANY-', - templates => { - group => 'text', - item => 0, - options => { - content => 'DDH.color_codes.content' - } - } - } + %basic_answer ), # Single full HTML check. 'red html code' => test_zci( 'Hex: #FF0000 ~ RGBA(255, 0, 0, 1) ~ RGB(100%, 0%, 0%) ~ HSL(0, 100%, 50%) ~ CMYB(0%, 100%, 100%, 0%)'."\n".'Complementary: #00FFFF'."\n".'Analogous: #FF8000, #FF0080', - structured_answer => { - id => 'color_codes', - name => 'Answer', - data => '-ANY-', - templates => { - group => 'text', - item => 0, - options => { - content => 'DDH.color_codes.content' - } - } - } + %basic_answer ), 'RGBA(99,60,176,0.5)' => test_zci( 'Hex: #633CB0 ~ RGBA(99, 60, 176, 0.5) ~ RGB(39%, 24%, 69%) ~ HSL(260, 49%, 46%) ~ CMYB(44%, 66%, 0%, 31%)'."\n".'Complementary: #89B03C'."\n".'Analogous: #9D3CB0, #3C4FB0', - structured_answer => { - id => 'color_codes', - name => 'Answer', - data => '-ANY-', - templates => { - group => 'text', - item => 0, - options => { - content => 'DDH.color_codes.content' - } - } - } + %basic_answer ), '#dc5f3c' => test_zci( 'Hex: #DC5F3C ~ RGBA(220, 95, 60, 1) ~ RGB(86%, 37%, 24%) ~ HSL(13, 70%, 55%) ~ CMYB(0%, 57%, 73%, 14%)'."\n".'Complementary: #3BB9DB'."\n".'Analogous: #DBAE3B, #DB3B69', - structured_answer => { - id => 'color_codes', - name => 'Answer', - data => '-ANY-', - templates => { - group => 'text', - item => 0, - options => { - content => 'DDH.color_codes.content' - } - } - } + %basic_answer ), #Colours with no hue shouldn't have complements or analogs '#000000' => test_zci( 'Hex: #000000 ~ RGBA(0, 0, 0, 1) ~ RGB(0%, 0%, 0%) ~ HSL(0, 0%, 0%) ~ CMYB(0%, 0%, 0%, 100%)', - structured_answer => { - id => 'color_codes', - name => 'Answer', - data => '-ANY-', - templates => { - group => 'text', - item => 0, - options => { - content => 'DDH.color_codes.content' - } - } - } + %basic_answer ), '#FFFFFF' => test_zci( 'Hex: #FFFFFF ~ RGBA(255, 255, 255, 1) ~ RGB(100%, 100%, 100%) ~ HSL(0, 0%, 100%) ~ CMYB(0%, 0%, 0%, 0%)', - structured_answer => { - id => 'color_codes', - name => 'Answer', - data => '-ANY-', - templates => { - group => 'text', - item => 0, - options => { - content => 'DDH.color_codes.content' - } - } - } + %basic_answer ), + # Check the content of the structured answer. Just once. + 'hsl 194 0.53 0.79' => test_zci( + 'Hex: #ADD8E5 ~ RGBA(173, 216, 229, 1) ~ RGB(68%, 85%, 90%) ~ HSL(194, 53%, 79%) ~ CMYB(25%, 6%, 0%, 10%)'."\n".'Complementary: #E6BBAE'."\n".'Analogous: #AEBDE6, #AEE6D7', + test_structured_answer + ), + # Queries to ignore. 'bluishblack html' => undef, 'HTML email' => undef, From 4e5383ef351568f05391e3b3fb3baa7347dbd175 Mon Sep 17 00:00:00 2001 From: Mailkov Date: Thu, 3 Dec 2015 19:08:58 +0000 Subject: [PATCH 205/379] Issue #1163 - changes for review --- lib/DDG/Goodie/ResistorColors.pm | 10 +- .../goodie/resistor_colors/content.handlebars | 4 +- .../resistor_colors/resistor_colors.css | 10 +- t/ResistorColors.t | 163 +++++++++--------- 4 files changed, 94 insertions(+), 93 deletions(-) diff --git a/lib/DDG/Goodie/ResistorColors.pm b/lib/DDG/Goodie/ResistorColors.pm index 78fd279ce..5c6894358 100644 --- a/lib/DDG/Goodie/ResistorColors.pm +++ b/lib/DDG/Goodie/ResistorColors.pm @@ -186,17 +186,21 @@ sub render { structured_answer => { id => 'resistor_colors', name => 'Answer', + meta => { + sourceName => "resisto.rs", + sourceUrl => "http://resisto.rs/$formatted_value" + }, data => { title => $title, subtitle => $bands . ' Bands', - resistor_bands => \@resistor_bands, - formatted_value => $formatted_value + resistor_bands => \@resistor_bands }, templates => { group => 'text', item => 0, options => { - content => 'DDH.resistor_colors.content' + content => 'DDH.resistor_colors.content', + moreAt => 1 } } }; diff --git a/share/goodie/resistor_colors/content.handlebars b/share/goodie/resistor_colors/content.handlebars index 801f049f4..c8a70217d 100644 --- a/share/goodie/resistor_colors/content.handlebars +++ b/share/goodie/resistor_colors/content.handlebars @@ -1,5 +1,3 @@ {{#each resistor_bands}} {{name}} {{html_prefix}}{{display_digit}} -{{/each}} -
-More at resisto.rs \ No newline at end of file +{{/each}} \ No newline at end of file diff --git a/share/goodie/resistor_colors/resistor_colors.css b/share/goodie/resistor_colors/resistor_colors.css index 3342ba23c..e17d90b90 100644 --- a/share/goodie/resistor_colors/resistor_colors.css +++ b/share/goodie/resistor_colors/resistor_colors.css @@ -6,10 +6,6 @@ color: #333; } -.zci--resistor_colors .resistor-band.silver { - background-color: #d0d0d0; -} - .zci--resistor_colors .resistor-band.gold { background-color: #f2d374; } @@ -58,8 +54,4 @@ .zci--resistor_colors .resistor-band.white { background-color: #ffffff; -} - -.zci--resistor_colors .zci__more-at { - margin-top: 20px; -} +} \ No newline at end of file diff --git a/t/ResistorColors.t b/t/ResistorColors.t index 589b61b2a..d9cff0e26 100644 --- a/t/ResistorColors.t +++ b/t/ResistorColors.t @@ -8,116 +8,123 @@ use DDG::Test::Goodie; zci answer_type => "resistor_colors"; zci is_cached => 1; -my %basic_answer = ( - structured_answer => { - id => 'resistor_colors', - name => 'Answer', - data => '-ANY-', - templates => { - group => 'text', - item => 0, - options => { - content => 'DDH.resistor_colors.content' - } - } - } -); - -my %data = ( - data => { +my $data = { title => '4.7K\x{2126}', subtitle => 'Four Bands', - resistor_bands => ( + resistor_bands => { {class => 'yellow', name => 'Yellow', html_prefix => '' ,display_digit => '4'}, {class => 'purple', name => 'Purple', html_prefix => '' ,display_digit => '7'}, {class => 'red', name => 'Red', html_prefix => '\x{00D7}' ,display_digit => '100'}, {class => 'gold', name => 'Gold', html_prefix => '\x{00B1}' ,display_digit => '5%'} - ), + }, formatted_value => '4.7K' - } - ); + }; + sub test_structured_answer { + my %basic_answer = get_structured_answer($_[0]); delete($basic_answer{data}); - $basic_answer{data} = %data; + $basic_answer{data} = \$data; return %basic_answer; } +sub get_structured_answer { + my %basic_answer = ( + structured_answer => { + id => 'resistor_colors', + name => 'Answer', + meta => { + sourceName => "resisto.rs", + sourceUrl => "http://resisto.rs/" . $_[0] + }, + data => '-ANY-', + templates => { + group => 'text', + item => 0, + options => { + content => 'DDH.resistor_colors.content', + moreAt => 1 + } + } + } + ); + return %basic_answer; +} + ddg_goodie_test( [qw( DDG::Goodie::ResistorColors )], - # Check trigger kicks in. - "330 ohms" => test_zci("330\x{2126} (ohms) resistor colors: orange (3), orange (3), brown (\x{00D7}10), gold (\x{00B1}5%)", %basic_answer), - "330 ohm" => test_zci("330\x{2126} (ohms) resistor colors: orange (3), orange (3), brown (\x{00D7}10), gold (\x{00B1}5%)", %basic_answer), - "330 \x{2126}" => test_zci("330\x{2126} (ohms) resistor colors: orange (3), orange (3), brown (\x{00D7}10), gold (\x{00B1}5%)", %basic_answer), - "330ohms" => test_zci("330\x{2126} (ohms) resistor colors: orange (3), orange (3), brown (\x{00D7}10), gold (\x{00B1}5%)", %basic_answer), - "330ohm" => test_zci("330\x{2126} (ohms) resistor colors: orange (3), orange (3), brown (\x{00D7}10), gold (\x{00B1}5%)", %basic_answer), - "330\x{2126}" => test_zci("330\x{2126} (ohms) resistor colors: orange (3), orange (3), brown (\x{00D7}10), gold (\x{00B1}5%)", %basic_answer), - "330 ohms resistor" => test_zci("330\x{2126} (ohms) resistor colors: orange (3), orange (3), brown (\x{00D7}10), gold (\x{00B1}5%)", %basic_answer), - "330 ohm resistor" => test_zci("330\x{2126} (ohms) resistor colors: orange (3), orange (3), brown (\x{00D7}10), gold (\x{00B1}5%)", %basic_answer), - "330 \x{2126} resistor" => test_zci("330\x{2126} (ohms) resistor colors: orange (3), orange (3), brown (\x{00D7}10), gold (\x{00B1}5%)", %basic_answer), - "330ohms resistor" => test_zci("330\x{2126} (ohms) resistor colors: orange (3), orange (3), brown (\x{00D7}10), gold (\x{00B1}5%)", %basic_answer), - "330ohm resistor" => test_zci("330\x{2126} (ohms) resistor colors: orange (3), orange (3), brown (\x{00D7}10), gold (\x{00B1}5%)", %basic_answer), - "330\x{2126} resistor" => test_zci("330\x{2126} (ohms) resistor colors: orange (3), orange (3), brown (\x{00D7}10), gold (\x{00B1}5%)", %basic_answer), - "330 resistor" => test_zci("330\x{2126} (ohms) resistor colors: orange (3), orange (3), brown (\x{00D7}10), gold (\x{00B1}5%)", %basic_answer), + "330 ohms" => test_zci("330\x{2126} (ohms) resistor colors: orange (3), orange (3), brown (\x{00D7}10), gold (\x{00B1}5%)", get_structured_answer('330')), + "330 ohm" => test_zci("330\x{2126} (ohms) resistor colors: orange (3), orange (3), brown (\x{00D7}10), gold (\x{00B1}5%)", get_structured_answer('330')), + "330 \x{2126}" => test_zci("330\x{2126} (ohms) resistor colors: orange (3), orange (3), brown (\x{00D7}10), gold (\x{00B1}5%)", get_structured_answer('330')), + "330ohms" => test_zci("330\x{2126} (ohms) resistor colors: orange (3), orange (3), brown (\x{00D7}10), gold (\x{00B1}5%)", get_structured_answer('330')), + "330ohm" => test_zci("330\x{2126} (ohms) resistor colors: orange (3), orange (3), brown (\x{00D7}10), gold (\x{00B1}5%)", get_structured_answer('330')), + "330\x{2126}" => test_zci("330\x{2126} (ohms) resistor colors: orange (3), orange (3), brown (\x{00D7}10), gold (\x{00B1}5%)", get_structured_answer('330')), + "330 ohms resistor" => test_zci("330\x{2126} (ohms) resistor colors: orange (3), orange (3), brown (\x{00D7}10), gold (\x{00B1}5%)", get_structured_answer('330')), + "330 ohm resistor" => test_zci("330\x{2126} (ohms) resistor colors: orange (3), orange (3), brown (\x{00D7}10), gold (\x{00B1}5%)", get_structured_answer('330')), + "330 \x{2126} resistor" => test_zci("330\x{2126} (ohms) resistor colors: orange (3), orange (3), brown (\x{00D7}10), gold (\x{00B1}5%)", get_structured_answer('330')), + "330ohms resistor" => test_zci("330\x{2126} (ohms) resistor colors: orange (3), orange (3), brown (\x{00D7}10), gold (\x{00B1}5%)", get_structured_answer('330')), + "330ohm resistor" => test_zci("330\x{2126} (ohms) resistor colors: orange (3), orange (3), brown (\x{00D7}10), gold (\x{00B1}5%)", get_structured_answer('330')), + "330\x{2126} resistor" => test_zci("330\x{2126} (ohms) resistor colors: orange (3), orange (3), brown (\x{00D7}10), gold (\x{00B1}5%)", get_structured_answer('330')), + "330 resistor" => test_zci("330\x{2126} (ohms) resistor colors: orange (3), orange (3), brown (\x{00D7}10), gold (\x{00B1}5%)", get_structured_answer('330')), # Various multipliers - "472000 ohms" => test_zci("470K\x{2126} (ohms) resistor colors: yellow (4), purple (7), yellow (\x{00D7}10K), gold (\x{00B1}5%)", %basic_answer), - "400000 ohms" => test_zci("400K\x{2126} (ohms) resistor colors: yellow (4), black (0), yellow (\x{00D7}10K), gold (\x{00B1}5%)", %basic_answer), - "12300 ohms" => test_zci("12K\x{2126} (ohms) resistor colors: brown (1), red (2), orange (\x{00D7}1K), gold (\x{00B1}5%)", %basic_answer), + "472000 ohms" => test_zci("470K\x{2126} (ohms) resistor colors: yellow (4), purple (7), yellow (\x{00D7}10K), gold (\x{00B1}5%)", get_structured_answer('470K')), + "400000 ohms" => test_zci("400K\x{2126} (ohms) resistor colors: yellow (4), black (0), yellow (\x{00D7}10K), gold (\x{00B1}5%)", get_structured_answer('400K')), + "12300 ohms" => test_zci("12K\x{2126} (ohms) resistor colors: brown (1), red (2), orange (\x{00D7}1K), gold (\x{00B1}5%)", get_structured_answer('12K')), # Rounding - "1.2345 ohms" => test_zci("1.2\x{2126} (ohms) resistor colors: brown (1), red (2), gold (\x{00D7}0.1), gold (\x{00B1}5%)", %basic_answer), - "1.2555 ohms" => test_zci("1.3\x{2126} (ohms) resistor colors: brown (1), orange (3), gold (\x{00D7}0.1), gold (\x{00B1}5%)", %basic_answer), - "12.345 ohms" => test_zci("12\x{2126} (ohms) resistor colors: brown (1), red (2), black (\x{00D7}1), gold (\x{00B1}5%)", %basic_answer), - "12.555 ohms" => test_zci("13\x{2126} (ohms) resistor colors: brown (1), orange (3), black (\x{00D7}1), gold (\x{00B1}5%)", %basic_answer), - "123.45 ohms" => test_zci("120\x{2126} (ohms) resistor colors: brown (1), red (2), brown (\x{00D7}10), gold (\x{00B1}5%)", %basic_answer), - "125.55 ohms" => test_zci("130\x{2126} (ohms) resistor colors: brown (1), orange (3), brown (\x{00D7}10), gold (\x{00B1}5%)", %basic_answer), - "1234.5 ohms" => test_zci("1.2K\x{2126} (ohms) resistor colors: brown (1), red (2), red (\x{00D7}100), gold (\x{00B1}5%)", %basic_answer), - "1255.5 ohms" => test_zci("1.3K\x{2126} (ohms) resistor colors: brown (1), orange (3), red (\x{00D7}100), gold (\x{00B1}5%)", %basic_answer), - "12345 ohms" => test_zci("12K\x{2126} (ohms) resistor colors: brown (1), red (2), orange (\x{00D7}1K), gold (\x{00B1}5%)", %basic_answer), - "12555 ohms" => test_zci("13K\x{2126} (ohms) resistor colors: brown (1), orange (3), orange (\x{00D7}1K), gold (\x{00B1}5%)", %basic_answer), - "123450 ohms" => test_zci("120K\x{2126} (ohms) resistor colors: brown (1), red (2), yellow (\x{00D7}10K), gold (\x{00B1}5%)", %basic_answer), - "125550 ohms" => test_zci("130K\x{2126} (ohms) resistor colors: brown (1), orange (3), yellow (\x{00D7}10K), gold (\x{00B1}5%)", %basic_answer), - "1234500 ohms" => test_zci("1.2M\x{2126} (ohms) resistor colors: brown (1), red (2), green (\x{00D7}100K), gold (\x{00B1}5%)", %basic_answer), - "1255500 ohms" => test_zci("1.3M\x{2126} (ohms) resistor colors: brown (1), orange (3), green (\x{00D7}100K), gold (\x{00B1}5%)", %basic_answer), - "12345000 ohms" => test_zci("12M\x{2126} (ohms) resistor colors: brown (1), red (2), blue (\x{00D7}1M), gold (\x{00B1}5%)", %basic_answer), - "12555000 ohms" => test_zci("13M\x{2126} (ohms) resistor colors: brown (1), orange (3), blue (\x{00D7}1M), gold (\x{00B1}5%)", %basic_answer), - "123450000 ohms" => test_zci("120M\x{2126} (ohms) resistor colors: brown (1), red (2), purple (\x{00D7}10M), gold (\x{00B1}5%)", %basic_answer), - "125550000 ohms" => test_zci("130M\x{2126} (ohms) resistor colors: brown (1), orange (3), purple (\x{00D7}10M), gold (\x{00B1}5%)", %basic_answer), - "1234500000 ohms" => test_zci("1200M\x{2126} (ohms) resistor colors: brown (1), red (2), gray (\x{00D7}100M), gold (\x{00B1}5%)", %basic_answer), - "1255500000 ohms" => test_zci("1300M\x{2126} (ohms) resistor colors: brown (1), orange (3), gray (\x{00D7}100M), gold (\x{00B1}5%)", %basic_answer), + "1.2345 ohms" => test_zci("1.2\x{2126} (ohms) resistor colors: brown (1), red (2), gold (\x{00D7}0.1), gold (\x{00B1}5%)", get_structured_answer('1.2')), + "1.2555 ohms" => test_zci("1.3\x{2126} (ohms) resistor colors: brown (1), orange (3), gold (\x{00D7}0.1), gold (\x{00B1}5%)", get_structured_answer('1.3')), + "12.345 ohms" => test_zci("12\x{2126} (ohms) resistor colors: brown (1), red (2), black (\x{00D7}1), gold (\x{00B1}5%)", get_structured_answer('12')), + "12.555 ohms" => test_zci("13\x{2126} (ohms) resistor colors: brown (1), orange (3), black (\x{00D7}1), gold (\x{00B1}5%)", get_structured_answer('13')), + "123.45 ohms" => test_zci("120\x{2126} (ohms) resistor colors: brown (1), red (2), brown (\x{00D7}10), gold (\x{00B1}5%)", get_structured_answer('120')), + "125.55 ohms" => test_zci("130\x{2126} (ohms) resistor colors: brown (1), orange (3), brown (\x{00D7}10), gold (\x{00B1}5%)", get_structured_answer('130')), + "1234.5 ohms" => test_zci("1.2K\x{2126} (ohms) resistor colors: brown (1), red (2), red (\x{00D7}100), gold (\x{00B1}5%)", get_structured_answer('1.2K')), + "1255.5 ohms" => test_zci("1.3K\x{2126} (ohms) resistor colors: brown (1), orange (3), red (\x{00D7}100), gold (\x{00B1}5%)", get_structured_answer('1.3K')), + "12345 ohms" => test_zci("12K\x{2126} (ohms) resistor colors: brown (1), red (2), orange (\x{00D7}1K), gold (\x{00B1}5%)", get_structured_answer('12K')), + "12555 ohms" => test_zci("13K\x{2126} (ohms) resistor colors: brown (1), orange (3), orange (\x{00D7}1K), gold (\x{00B1}5%)", get_structured_answer('13K')), + "123450 ohms" => test_zci("120K\x{2126} (ohms) resistor colors: brown (1), red (2), yellow (\x{00D7}10K), gold (\x{00B1}5%)", get_structured_answer('120K')), + "125550 ohms" => test_zci("130K\x{2126} (ohms) resistor colors: brown (1), orange (3), yellow (\x{00D7}10K), gold (\x{00B1}5%)", get_structured_answer('130K')), + "1234500 ohms" => test_zci("1.2M\x{2126} (ohms) resistor colors: brown (1), red (2), green (\x{00D7}100K), gold (\x{00B1}5%)", get_structured_answer('1.2M')), + "1255500 ohms" => test_zci("1.3M\x{2126} (ohms) resistor colors: brown (1), orange (3), green (\x{00D7}100K), gold (\x{00B1}5%)", get_structured_answer('1.3M')), + "12345000 ohms" => test_zci("12M\x{2126} (ohms) resistor colors: brown (1), red (2), blue (\x{00D7}1M), gold (\x{00B1}5%)", get_structured_answer('12M')), + "12555000 ohms" => test_zci("13M\x{2126} (ohms) resistor colors: brown (1), orange (3), blue (\x{00D7}1M), gold (\x{00B1}5%)", get_structured_answer('13M')), + "123450000 ohms" => test_zci("120M\x{2126} (ohms) resistor colors: brown (1), red (2), purple (\x{00D7}10M), gold (\x{00B1}5%)", get_structured_answer('120M')), + "125550000 ohms" => test_zci("130M\x{2126} (ohms) resistor colors: brown (1), orange (3), purple (\x{00D7}10M), gold (\x{00B1}5%)", get_structured_answer('130M')), + "1234500000 ohms" => test_zci("1200M\x{2126} (ohms) resistor colors: brown (1), red (2), gray (\x{00D7}100M), gold (\x{00B1}5%)", get_structured_answer('1200M')), + "1255500000 ohms" => test_zci("1300M\x{2126} (ohms) resistor colors: brown (1), orange (3), gray (\x{00D7}100M), gold (\x{00B1}5%)", get_structured_answer('1300M')), # kilo and mega multipliers - "27kohm" => test_zci("27K\x{2126} (ohms) resistor colors: red (2), purple (7), orange (\x{00D7}1K), gold (\x{00B1}5%)", %basic_answer), - "27Kohm" => test_zci("27K\x{2126} (ohms) resistor colors: red (2), purple (7), orange (\x{00D7}1K), gold (\x{00B1}5%)", %basic_answer), - "27 K ohm" => test_zci("27K\x{2126} (ohms) resistor colors: red (2), purple (7), orange (\x{00D7}1K), gold (\x{00B1}5%)", %basic_answer), - "4K2 ohm" => test_zci("4.2K\x{2126} (ohms) resistor colors: yellow (4), red (2), red (\x{00D7}100), gold (\x{00B1}5%)", %basic_answer), - "4.2K ohm" => test_zci("4.2K\x{2126} (ohms) resistor colors: yellow (4), red (2), red (\x{00D7}100), gold (\x{00B1}5%)", %basic_answer), - "27k resistor" => test_zci("27K\x{2126} (ohms) resistor colors: red (2), purple (7), orange (\x{00D7}1K), gold (\x{00B1}5%)", %basic_answer), - "27K resistor" => test_zci("27K\x{2126} (ohms) resistor colors: red (2), purple (7), orange (\x{00D7}1K), gold (\x{00B1}5%)", %basic_answer), - "27 K resistor" => test_zci("27K\x{2126} (ohms) resistor colors: red (2), purple (7), orange (\x{00D7}1K), gold (\x{00B1}5%)", %basic_answer), - "4K2 resistor" => test_zci("4.2K\x{2126} (ohms) resistor colors: yellow (4), red (2), red (\x{00D7}100), gold (\x{00B1}5%)", %basic_answer), - "4.2K resistor" => test_zci("4.2K\x{2126} (ohms) resistor colors: yellow (4), red (2), red (\x{00D7}100), gold (\x{00B1}5%)", %basic_answer), + "27kohm" => test_zci("27K\x{2126} (ohms) resistor colors: red (2), purple (7), orange (\x{00D7}1K), gold (\x{00B1}5%)", get_structured_answer('27K')), + "27Kohm" => test_zci("27K\x{2126} (ohms) resistor colors: red (2), purple (7), orange (\x{00D7}1K), gold (\x{00B1}5%)", get_structured_answer('27K')), + "27 K ohm" => test_zci("27K\x{2126} (ohms) resistor colors: red (2), purple (7), orange (\x{00D7}1K), gold (\x{00B1}5%)", get_structured_answer('27K')), + "4K2 ohm" => test_zci("4.2K\x{2126} (ohms) resistor colors: yellow (4), red (2), red (\x{00D7}100), gold (\x{00B1}5%)", get_structured_answer('4.2K')), + "4.2K ohm" => test_zci("4.2K\x{2126} (ohms) resistor colors: yellow (4), red (2), red (\x{00D7}100), gold (\x{00B1}5%)", get_structured_answer('4.2K')), + "27k resistor" => test_zci("27K\x{2126} (ohms) resistor colors: red (2), purple (7), orange (\x{00D7}1K), gold (\x{00B1}5%)", get_structured_answer('27K')), + "27K resistor" => test_zci("27K\x{2126} (ohms) resistor colors: red (2), purple (7), orange (\x{00D7}1K), gold (\x{00B1}5%)", get_structured_answer('27K')), + "27 K resistor" => test_zci("27K\x{2126} (ohms) resistor colors: red (2), purple (7), orange (\x{00D7}1K), gold (\x{00B1}5%)", get_structured_answer('27K')), + "4K2 resistor" => test_zci("4.2K\x{2126} (ohms) resistor colors: yellow (4), red (2), red (\x{00D7}100), gold (\x{00B1}5%)", get_structured_answer('4.2K')), + "4.2K resistor" => test_zci("4.2K\x{2126} (ohms) resistor colors: yellow (4), red (2), red (\x{00D7}100), gold (\x{00B1}5%)", get_structured_answer('4.2K')), # Decimal points - "2.9ohm" => test_zci("2.9\x{2126} (ohms) resistor colors: red (2), white (9), gold (\x{00D7}0.1), gold (\x{00B1}5%)", %basic_answer), - "2.9ohms resistor" => test_zci("2.9\x{2126} (ohms) resistor colors: red (2), white (9), gold (\x{00D7}0.1), gold (\x{00B1}5%)", %basic_answer), + "2.9ohm" => test_zci("2.9\x{2126} (ohms) resistor colors: red (2), white (9), gold (\x{00D7}0.1), gold (\x{00B1}5%)", get_structured_answer('2.9')), + "2.9ohms resistor" => test_zci("2.9\x{2126} (ohms) resistor colors: red (2), white (9), gold (\x{00D7}0.1), gold (\x{00B1}5%)", get_structured_answer('2.9')), # Negative multipliers - "1 ohm" => test_zci("1\x{2126} (ohm) resistor colors: brown (1), black (0), gold (\x{00D7}0.1), gold (\x{00B1}5%)", %basic_answer), - "29 ohms" => test_zci("29\x{2126} (ohms) resistor colors: red (2), white (9), black (\x{00D7}1), gold (\x{00B1}5%)", %basic_answer), + "1 ohm" => test_zci("1\x{2126} (ohm) resistor colors: brown (1), black (0), gold (\x{00D7}0.1), gold (\x{00B1}5%)", get_structured_answer('1')), + "29 ohms" => test_zci("29\x{2126} (ohms) resistor colors: red (2), white (9), black (\x{00D7}1), gold (\x{00B1}5%)", get_structured_answer('29')), # Zero special case - "0 ohms" => test_zci("0\x{2126} (ohms) resistor colors: black (0), black (0), black (\x{00D7}1), gold (\x{00B1}5%)", %basic_answer), + "0 ohms" => test_zci("0\x{2126} (ohms) resistor colors: black (0), black (0), black (\x{00D7}1), gold (\x{00B1}5%)", get_structured_answer('0')), # Range - "99000M ohms" => test_zci("99000M\x{2126} (ohms) resistor colors: white (9), white (9), white (\x{00D7}1000M), gold (\x{00B1}5%)", %basic_answer), + "99000M ohms" => test_zci("99000M\x{2126} (ohms) resistor colors: white (9), white (9), white (\x{00D7}1000M), gold (\x{00B1}5%)", get_structured_answer('99000M')), "99500M ohms" => undef, - "1.1 ohms" => test_zci("1.1\x{2126} (ohms) resistor colors: brown (1), brown (1), gold (\x{00D7}0.1), gold (\x{00B1}5%)", %basic_answer), - "1 ohms" => test_zci("1\x{2126} (ohm) resistor colors: brown (1), black (0), gold (\x{00D7}0.1), gold (\x{00B1}5%)", %basic_answer), + "1.1 ohms" => test_zci("1.1\x{2126} (ohms) resistor colors: brown (1), brown (1), gold (\x{00D7}0.1), gold (\x{00B1}5%)", get_structured_answer('1.1')), + "1 ohms" => test_zci("1\x{2126} (ohm) resistor colors: brown (1), black (0), gold (\x{00D7}0.1), gold (\x{00B1}5%)", get_structured_answer('1')), "0.9 ohms" => undef, "-10 ohms" => undef, @@ -131,7 +138,7 @@ ddg_goodie_test( # Check the content of the structured answer. Just once. "4.7k ohm" => test_zci( "4.7K\x{2126} (ohms) resistor colors: yellow (4), purple (7), red (\x{00D7}100), gold (\x{00B1}5%)", - test_structured_answer + test_structured_answer('4.7K') #html => "

4.7K\x{2126}

Four Bands

Yellow 4Purple 7Red ×100Gold ±5%

More at resisto.rs" ), ); From 94937930acf42bf8017b220998f420e5bd93fb00 Mon Sep 17 00:00:00 2001 From: Mailkov Date: Fri, 4 Dec 2015 13:06:16 +0000 Subject: [PATCH 206/379] fix attribution --- lib/DDG/Goodie/Chess960.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/DDG/Goodie/Chess960.pm b/lib/DDG/Goodie/Chess960.pm index d1306a9ea..613095d01 100644 --- a/lib/DDG/Goodie/Chess960.pm +++ b/lib/DDG/Goodie/Chess960.pm @@ -13,8 +13,9 @@ description 'Generates a random starting position for Chess960'; topics 'gaming', 'entertainment'; code_url "https://github.com/duckduckgo/zeroclickinfo-goodies/blob/master/lib/DDG/Goodie/Chess960.pm"; category 'random'; -attribution github => 'https://github.com/koosha--', - twitter => 'https://twitter.com/_koosha_'; +attribution github => ['https://github.com/koosha--', 'koosha--'] + twitter => 'https://twitter.com/_koosha_', + github => ["https://github.com/Mailkov", "Melchiorre Alastra"]; my @all_positions = qw( From fd415b6173eb88d271257c538f72a960ea035aef Mon Sep 17 00:00:00 2001 From: Mailkov Date: Fri, 4 Dec 2015 13:08:30 +0000 Subject: [PATCH 207/379] fix attribution --- lib/DDG/Goodie/Zodiac.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/DDG/Goodie/Zodiac.pm b/lib/DDG/Goodie/Zodiac.pm index 8c5f6f7d8..b2bc4c39d 100644 --- a/lib/DDG/Goodie/Zodiac.pm +++ b/lib/DDG/Goodie/Zodiac.pm @@ -21,7 +21,8 @@ name "zodiac"; category "dates"; topics "special_interest"; attribution email => 'nomady@zoho.com', - github => ['https://github.com/n0mady','NOMADY']; + github => ['https://github.com/n0mady','NOMADY'], + github => ["https://github.com/Mailkov", "Melchiorre Alastra"]; my $goodieVersion = $DDG::GoodieBundle::OpenSourceDuckDuckGo::VERSION // 999; From 2115e374783769b527b191f8960c36fe2c95e2d7 Mon Sep 17 00:00:00 2001 From: Mailkov Date: Fri, 4 Dec 2015 13:11:42 +0000 Subject: [PATCH 208/379] fix attribution --- lib/DDG/Goodie/Anagram.pm | 3 ++- lib/DDG/Goodie/Scramble.pm | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/DDG/Goodie/Anagram.pm b/lib/DDG/Goodie/Anagram.pm index a1043a35a..5b87a3127 100644 --- a/lib/DDG/Goodie/Anagram.pm +++ b/lib/DDG/Goodie/Anagram.pm @@ -36,7 +36,8 @@ topics "words_and_games"; attribution github => ["https://github.com/loganom", 'loganom'], github => ["https://github.com/beardlybread", "beardlybread"], github => ['https://github.com/gdrooid', 'gdrooid'], - email => ['gdrooid@openmailbox.org', 'gdrooid']; + email => ['gdrooid@openmailbox.org', 'gdrooid'], + github => ["https://github.com/Mailkov", "Melchiorre Alastra"]; # Calculate the frequency of the characters in a string sub calc_freq { diff --git a/lib/DDG/Goodie/Scramble.pm b/lib/DDG/Goodie/Scramble.pm index faeec1eae..4df551e83 100644 --- a/lib/DDG/Goodie/Scramble.pm +++ b/lib/DDG/Goodie/Scramble.pm @@ -36,8 +36,8 @@ topics "words_and_games"; attribution github => ["https://github.com/loganom", 'loganom'], github => ["https://github.com/beardlybread", "beardlybread"], github => ['https://github.com/gdrooid', 'gdrooid'], - github => ['https://github.com/Mailkov', 'Mailkov'], - email => ['gdrooid@openmailbox.org', 'gdrooid']; + email => ['gdrooid@openmailbox.org', 'gdrooid'], + github => ["https://github.com/Mailkov", "Melchiorre Alastra"]; my $operation = 'Scramble of'; From 3cfa22f6be2d450510ad54d1eb64d3c66e0e546c Mon Sep 17 00:00:00 2001 From: Mailkov Date: Fri, 4 Dec 2015 13:16:38 +0000 Subject: [PATCH 209/379] Issue #1163 - fix review Average --- lib/DDG/Goodie/Average.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/DDG/Goodie/Average.pm b/lib/DDG/Goodie/Average.pm index 7f10a9a5e..5215d838f 100644 --- a/lib/DDG/Goodie/Average.pm +++ b/lib/DDG/Goodie/Average.pm @@ -22,9 +22,9 @@ attribution twitter => ['crazedpsyc','crazedpsyc'], -handle query => sub { +handle remainder => sub { - my $query = $_; + my $query = $req->query_lc; my $type; if ($query =~ m/root mean square/) { From 7985cd6e0e606903e690ab58c2c141a3abad8eb9 Mon Sep 17 00:00:00 2001 From: Mailkov Date: Fri, 4 Dec 2015 13:20:51 +0000 Subject: [PATCH 210/379] fix attribution 2 --- lib/DDG/Goodie/Chess960.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/DDG/Goodie/Chess960.pm b/lib/DDG/Goodie/Chess960.pm index 613095d01..4a0265b18 100644 --- a/lib/DDG/Goodie/Chess960.pm +++ b/lib/DDG/Goodie/Chess960.pm @@ -13,7 +13,7 @@ description 'Generates a random starting position for Chess960'; topics 'gaming', 'entertainment'; code_url "https://github.com/duckduckgo/zeroclickinfo-goodies/blob/master/lib/DDG/Goodie/Chess960.pm"; category 'random'; -attribution github => ['https://github.com/koosha--', 'koosha--'] +attribution github => ['https://github.com/koosha--', 'koosha--'], twitter => 'https://twitter.com/_koosha_', github => ["https://github.com/Mailkov", "Melchiorre Alastra"]; From 019d7282c670daf627a9f5c3a4735868bc12b022 Mon Sep 17 00:00:00 2001 From: mohan08p Date: Fri, 4 Dec 2015 14:02:55 +0000 Subject: [PATCH 211/379] Malayalam Cheat Sheet --- .../cheat_sheets/json/language/malayalam.json | 238 ++++++++++++++++++ share/goodie/cheat_sheets/json/malayalam.json | 238 ++++++++++++++++++ 2 files changed, 476 insertions(+) create mode 100644 share/goodie/cheat_sheets/json/language/malayalam.json create mode 100644 share/goodie/cheat_sheets/json/malayalam.json diff --git a/share/goodie/cheat_sheets/json/language/malayalam.json b/share/goodie/cheat_sheets/json/language/malayalam.json new file mode 100644 index 000000000..d0e5a81d9 --- /dev/null +++ b/share/goodie/cheat_sheets/json/language/malayalam.json @@ -0,0 +1,238 @@ +{ + "id" : "malayalam_cheat_sheet", + "name" : "Malayalam Cheat Sheet", + "metadata" : { + "sourceName" : "Pravasi Malayalam.com", + "sourceUrl" : "http://www.pravasimalayalam.com/index.shtml" + }, + "aliases": [ + "malayalam", "malayalam phrases", "malayalam phrases", "english to malayalam", + "basic malayalam phrases", "basic malayalam" + ], + "template_type": "language", + "section_order" : [ + "Etiquette", + "Basics", + "Getting Help", + "Travelling", + "Going out for dinner" + ], + "description" : "Basic Malayalam words and phrases", + "sections" : { + "Etiquette" : [ + { + "key" : "I'm sorry", + "val" : "എന്നോട് ക്ഷമിക്കൂ", + "trn" : "ennod kshamiku" + }, + { + "key" : "Thank you", + "val" : "നന്ദി ", + "trn" : "nandi" + }, + { + "key" : "Please...", + "val" : "ദയവായി...", + "trn" : "dayavaayi..." + }, + { + "key" : "Thank you very much!", + "val" : "വളരെ നന്ദി !", + "trn" : "valare nandi!" + }, + { + "key" : "You're welcome", + "val" : "നിനക്ക് സ്വാഗതം ", + "trn" : "ninak swagatham" + } + ], + "Getting Help" : [ + { + "key" : "Call the police!", + "val" : "പൊലീസിനെ വിളിക്കുക !", + "trn" : "Polisine viliku!" + }, + { + "key" : "Can you speak more slowly, please?", + "val" : "നിങ്ങള്ക്ക് ദയവായി വളരെ പതുകെ സംസാരിക്കാൻ കഴിയുമോ ?", + "trn" : "ningalk dayavaayi valare pathuke samsarikan kazhiyumo?" + }, + { + "key" : "Can you repeat, please?", + "val" : "നിങ്ങൾ ദയവായി ആവര്തികുമോ ?", + "trn" : "ningal dayavaayi aavarthikumo?" + }, + { + "key" : "How do you say \"X\" in Bengali?", + "val" : "നിങ്ങൾ \"X\" ഇത് മലയാളത്തിൽ എങ്ങനെ പറയും ?", + "trn" : "ningal \"X\" eth malayalathil engane parayum?" + }, + { + "key" : "Stop!", + "val" : "നിർത്തുക !", + "trn" : "nirthuka!" + }, + { + "key" : "Do you speak English?", + "val" : "നീ ഇംഗ്ലീഷ് സംസാരിക്കുമോ ?", + "trn" : "nee English samsarikumo?" + }, + { + "key" : "Excuse me!", + "val" : "എക്സ്ക്യൂസ് മീ !", + "trn" : "excuse me!" + }, + { + "key" : "I need a doctor!", + "val" : "എനിക്ക് ഒരു ഡോക്ടറെ ആവശ്യമുണ്ട് !", + "trn" : "enik oru doctore aavashyamund!" + }, + { + "key" : "Can you write that down, please?", + "val" : "നിങ്ങള്ക്ക് അത് ദയവായി എഴുതാൻ കഴിയുമോ ?", + "trn" : "Thangalk Ath ezhuthan pattumo?" + }, + { + "key" : "Call an ambulance!", + "val" : "ഒരു ആംബുലൻസ് വിളിക്കു !", + "trn" : "oru ambulance viliku!" + }, + { + "key" : "I am in danger!", + "val" : "ഞാൻ അപകടതിലാണ്ണ്‍ !", + "trn" : "njan apakadathil aan!" + }, + { + "key" : "Can you help me?", + "val" : "എന്നെ സഹായിക്കാമോ ?", + "trn" : "enne sahayikamo?" + }, + { + "key" : "Fire!", + "val" : "തീ !", + "trn" : "thee!" + } + ], + "Basics" : [ + { + "key" : "My name is...", + "val" : "എന്റെ പേര്...", + "trn" : "ente per..." + }, + { + "key" : "I'm fine, thanks!", + "val" : "എനിക്ക് സുഖമാണ്, നന്ദി !", + "trn" : "enik sugamaan, nandi!" + }, + { + "key" : "How are you?", + "val" : "സുഖമാണോ ?", + "trn" : "sugamaano?" + }, + { + "key" : "Welcome", + "val" : "സ്വാഗതം", + "trn" : "swagatham" + }, + { + "key" : "What's your name?", + "val" : "എന്താണ് നിങ്ങളുടെ പേര് ?", + "trn" : "enthaan ningalude per?" + } + ], + "Travelling" : [ + { + "key" : "Turn left.", + "val" : "ഇടത്തോട്ട് തിരിയുക .", + "trn" : "edathott thiriyuka." + }, + { + "key" : "Where is the exit?", + "val" : "എക്സിറ്റ് എവിടെയാണ് ?", + "trn" : "exut evideyaan?" + }, + { + "key" : "Where?", + "val" : "എവിടെ ?", + "trn" : "evide?" + }, + { + "key" : "Is it far?", + "val" : "അത് ബഹുദൂരം തന്നെയല്ലേ ?", + "trn" : "ath bahudooram thannayalle?" + }, + { + "key" : "Go straight ahead.", + "val" : "നേരെ മുന്നോട്ടു പോകുക .", + "trn" : "nere munnott pokuka." + }, + { + "key" : "Do you have a city map?", + "val" : "നിങ്ങളുടെ കയ്യില പട്ടണത്തിന്റെ മാപ് ഉണ്ടോ ?", + "trn" : "ningalude kayyil pattanathinte map undo?" + }, + { + "key" : "Please stop here.", + "val" : "ഇവിടെ നിർത്തുക .", + "trn" : "evide nirthuka." + }, + { + "key" : "Turn right.", + "val" : "വലത്തോട്ട് തിരിയുക .", + "trn" : "valathottu thiriyuka." + }, + { + "key" : "Where can I find the taxis?", + "val" : "എനിക്ക് എവിടെ ടാക്സി കണ്ടെത്താൻ കഴിയും ?", + "trn" : "enik evide taxi kandethan kazhiyum?" + }, + { + "key" : "How can I get a taxi?", + "val" : "എനിക്ക് എങ്ങനെ ടാക്സി ലഭിക്കും ?", + "trn" : "enik engane tazi labikum?" + } + ], + "Going out for dinner" : [ + { + "key" : "Do you have vegetarian dishes?", + "val" : "എവിടെ വെഗിടരിയൻ വിഭവങ്ങൾ ഉണ്ടോ ?", + "trn" : "Evide vegetarian vibavangal undo?" + }, + { + "key" : "I am allergic", + "val" : "എനിക്ക് അലെർഗി ഉണ്ട് ", + "trn" : "Enik alergy und" + }, + { + "key" : "The check please!", + "val" : "ചെക്ക്‌ നല്കു !", + "trn" : "check nalku!" + }, + { + "key" : "A cup of coffee please.", + "val" : "ദയവായി ഒരു കപ്പ്‌ കാപ്പി തരു .", + "trn" : "dhayavaayi oru cup kaappi tharu." + }, + { + "key" : "Where is a good restaurant?", + "val" : "എവിടെ ആണ്‍ നല്ല ഭക്ഷണശാല ?", + "trn" : "Evide aan nalla bhakshanashaala?" + }, + { + "key" : "A glass of water please.", + "val" : "ഒരു ഗ്ലാസ്‌ വെള്ളം തരുമോ .", + "trn" : "oru glass vellam tharumo." + }, + { + "key" : "A table for two please!", + "val" : "ദയവായി രണ്ട് ആള്കുള്ള ടേബിൾ വേണം !", + "trn" : "dayavaayi rand aalkulla table venam" + }, + { + "key" : "Can I get a menu, please?", + "val" : "എനിക്ക് ഇവിടത്തെ മെനു തരുമോ ?", + "trn" : "enik evidathe menu tharumo?" + } + ] + } +} \ No newline at end of file diff --git a/share/goodie/cheat_sheets/json/malayalam.json b/share/goodie/cheat_sheets/json/malayalam.json new file mode 100644 index 000000000..d0e5a81d9 --- /dev/null +++ b/share/goodie/cheat_sheets/json/malayalam.json @@ -0,0 +1,238 @@ +{ + "id" : "malayalam_cheat_sheet", + "name" : "Malayalam Cheat Sheet", + "metadata" : { + "sourceName" : "Pravasi Malayalam.com", + "sourceUrl" : "http://www.pravasimalayalam.com/index.shtml" + }, + "aliases": [ + "malayalam", "malayalam phrases", "malayalam phrases", "english to malayalam", + "basic malayalam phrases", "basic malayalam" + ], + "template_type": "language", + "section_order" : [ + "Etiquette", + "Basics", + "Getting Help", + "Travelling", + "Going out for dinner" + ], + "description" : "Basic Malayalam words and phrases", + "sections" : { + "Etiquette" : [ + { + "key" : "I'm sorry", + "val" : "എന്നോട് ക്ഷമിക്കൂ", + "trn" : "ennod kshamiku" + }, + { + "key" : "Thank you", + "val" : "നന്ദി ", + "trn" : "nandi" + }, + { + "key" : "Please...", + "val" : "ദയവായി...", + "trn" : "dayavaayi..." + }, + { + "key" : "Thank you very much!", + "val" : "വളരെ നന്ദി !", + "trn" : "valare nandi!" + }, + { + "key" : "You're welcome", + "val" : "നിനക്ക് സ്വാഗതം ", + "trn" : "ninak swagatham" + } + ], + "Getting Help" : [ + { + "key" : "Call the police!", + "val" : "പൊലീസിനെ വിളിക്കുക !", + "trn" : "Polisine viliku!" + }, + { + "key" : "Can you speak more slowly, please?", + "val" : "നിങ്ങള്ക്ക് ദയവായി വളരെ പതുകെ സംസാരിക്കാൻ കഴിയുമോ ?", + "trn" : "ningalk dayavaayi valare pathuke samsarikan kazhiyumo?" + }, + { + "key" : "Can you repeat, please?", + "val" : "നിങ്ങൾ ദയവായി ആവര്തികുമോ ?", + "trn" : "ningal dayavaayi aavarthikumo?" + }, + { + "key" : "How do you say \"X\" in Bengali?", + "val" : "നിങ്ങൾ \"X\" ഇത് മലയാളത്തിൽ എങ്ങനെ പറയും ?", + "trn" : "ningal \"X\" eth malayalathil engane parayum?" + }, + { + "key" : "Stop!", + "val" : "നിർത്തുക !", + "trn" : "nirthuka!" + }, + { + "key" : "Do you speak English?", + "val" : "നീ ഇംഗ്ലീഷ് സംസാരിക്കുമോ ?", + "trn" : "nee English samsarikumo?" + }, + { + "key" : "Excuse me!", + "val" : "എക്സ്ക്യൂസ് മീ !", + "trn" : "excuse me!" + }, + { + "key" : "I need a doctor!", + "val" : "എനിക്ക് ഒരു ഡോക്ടറെ ആവശ്യമുണ്ട് !", + "trn" : "enik oru doctore aavashyamund!" + }, + { + "key" : "Can you write that down, please?", + "val" : "നിങ്ങള്ക്ക് അത് ദയവായി എഴുതാൻ കഴിയുമോ ?", + "trn" : "Thangalk Ath ezhuthan pattumo?" + }, + { + "key" : "Call an ambulance!", + "val" : "ഒരു ആംബുലൻസ് വിളിക്കു !", + "trn" : "oru ambulance viliku!" + }, + { + "key" : "I am in danger!", + "val" : "ഞാൻ അപകടതിലാണ്ണ്‍ !", + "trn" : "njan apakadathil aan!" + }, + { + "key" : "Can you help me?", + "val" : "എന്നെ സഹായിക്കാമോ ?", + "trn" : "enne sahayikamo?" + }, + { + "key" : "Fire!", + "val" : "തീ !", + "trn" : "thee!" + } + ], + "Basics" : [ + { + "key" : "My name is...", + "val" : "എന്റെ പേര്...", + "trn" : "ente per..." + }, + { + "key" : "I'm fine, thanks!", + "val" : "എനിക്ക് സുഖമാണ്, നന്ദി !", + "trn" : "enik sugamaan, nandi!" + }, + { + "key" : "How are you?", + "val" : "സുഖമാണോ ?", + "trn" : "sugamaano?" + }, + { + "key" : "Welcome", + "val" : "സ്വാഗതം", + "trn" : "swagatham" + }, + { + "key" : "What's your name?", + "val" : "എന്താണ് നിങ്ങളുടെ പേര് ?", + "trn" : "enthaan ningalude per?" + } + ], + "Travelling" : [ + { + "key" : "Turn left.", + "val" : "ഇടത്തോട്ട് തിരിയുക .", + "trn" : "edathott thiriyuka." + }, + { + "key" : "Where is the exit?", + "val" : "എക്സിറ്റ് എവിടെയാണ് ?", + "trn" : "exut evideyaan?" + }, + { + "key" : "Where?", + "val" : "എവിടെ ?", + "trn" : "evide?" + }, + { + "key" : "Is it far?", + "val" : "അത് ബഹുദൂരം തന്നെയല്ലേ ?", + "trn" : "ath bahudooram thannayalle?" + }, + { + "key" : "Go straight ahead.", + "val" : "നേരെ മുന്നോട്ടു പോകുക .", + "trn" : "nere munnott pokuka." + }, + { + "key" : "Do you have a city map?", + "val" : "നിങ്ങളുടെ കയ്യില പട്ടണത്തിന്റെ മാപ് ഉണ്ടോ ?", + "trn" : "ningalude kayyil pattanathinte map undo?" + }, + { + "key" : "Please stop here.", + "val" : "ഇവിടെ നിർത്തുക .", + "trn" : "evide nirthuka." + }, + { + "key" : "Turn right.", + "val" : "വലത്തോട്ട് തിരിയുക .", + "trn" : "valathottu thiriyuka." + }, + { + "key" : "Where can I find the taxis?", + "val" : "എനിക്ക് എവിടെ ടാക്സി കണ്ടെത്താൻ കഴിയും ?", + "trn" : "enik evide taxi kandethan kazhiyum?" + }, + { + "key" : "How can I get a taxi?", + "val" : "എനിക്ക് എങ്ങനെ ടാക്സി ലഭിക്കും ?", + "trn" : "enik engane tazi labikum?" + } + ], + "Going out for dinner" : [ + { + "key" : "Do you have vegetarian dishes?", + "val" : "എവിടെ വെഗിടരിയൻ വിഭവങ്ങൾ ഉണ്ടോ ?", + "trn" : "Evide vegetarian vibavangal undo?" + }, + { + "key" : "I am allergic", + "val" : "എനിക്ക് അലെർഗി ഉണ്ട് ", + "trn" : "Enik alergy und" + }, + { + "key" : "The check please!", + "val" : "ചെക്ക്‌ നല്കു !", + "trn" : "check nalku!" + }, + { + "key" : "A cup of coffee please.", + "val" : "ദയവായി ഒരു കപ്പ്‌ കാപ്പി തരു .", + "trn" : "dhayavaayi oru cup kaappi tharu." + }, + { + "key" : "Where is a good restaurant?", + "val" : "എവിടെ ആണ്‍ നല്ല ഭക്ഷണശാല ?", + "trn" : "Evide aan nalla bhakshanashaala?" + }, + { + "key" : "A glass of water please.", + "val" : "ഒരു ഗ്ലാസ്‌ വെള്ളം തരുമോ .", + "trn" : "oru glass vellam tharumo." + }, + { + "key" : "A table for two please!", + "val" : "ദയവായി രണ്ട് ആള്കുള്ള ടേബിൾ വേണം !", + "trn" : "dayavaayi rand aalkulla table venam" + }, + { + "key" : "Can I get a menu, please?", + "val" : "എനിക്ക് ഇവിടത്തെ മെനു തരുമോ ?", + "trn" : "enik evidathe menu tharumo?" + } + ] + } +} \ No newline at end of file From 0f622ea610ccd417fecfe4f38a751ca83f532814 Mon Sep 17 00:00:00 2001 From: Mailkov Date: Fri, 4 Dec 2015 15:44:43 +0000 Subject: [PATCH 212/379] Issue #1163 - Convert RubiksCubePatterns to use templates --- lib/DDG/Goodie/RubiksCubePatterns.pm | 54 +++++++----- t/RubiksCubePatterns.t | 124 ++++++++++++++++++++++++--- 2 files changed, 142 insertions(+), 36 deletions(-) diff --git a/lib/DDG/Goodie/RubiksCubePatterns.pm b/lib/DDG/Goodie/RubiksCubePatterns.pm index 528b54822..e6faa8887 100644 --- a/lib/DDG/Goodie/RubiksCubePatterns.pm +++ b/lib/DDG/Goodie/RubiksCubePatterns.pm @@ -15,7 +15,8 @@ topics 'special_interest'; source 'http://math.cos.ucf.edu/~reid/Rubik/patterns.html'; attribution web => ['robert.io', 'Robert Picard'], twitter => ['__rlp', 'Robert Picard'], - github => ['rpicard', 'Robert Picard']; + github => ['rpicard', 'Robert Picard'], + github => ["https://github.com/Mailkov", "Melchiorre Alastra"]; triggers start => "rcube", "rubik", "rubiks", "rubix", "rubicks", "rubik's", "rubic's", "rubick's", @@ -25,7 +26,7 @@ triggers start => "rcube", "rubik", "rubiks", "rubix", zci answer_type => "rubiks_cube"; zci is_cached => 1; -our %patterns = ( +my %patterns = ( "stripes" => "F U F R L2 B D' R D2 L D' B R2 L F U F", "crosses" => "U F B' L2 U2 L2 F' B U2 L2 U", "swap centers" => "U D' R L' F B' U D'", @@ -53,34 +54,41 @@ sub render_text($) { return to_titlecase($name) . ": $patterns{$name} \n"; } -sub render_html($) { - my $name = pop; - my $output = "
" . to_titlecase($name) . ""; - $output .= ": $patterns{$name}
\n"; - return $output; -} - -handle remainder => sub { - - $_ = lc($_); +handle remainder_lc => sub { #support British English! s/centre/center/; #hack for the trigger "rubiks cube in a cube" s/^in a cube/cube in a cube/; + + my %patterns_answer; + my $output; + + if ($patterns{$_}) { + $output = render_text($_); + $patterns_answer{$_ . ":"} .= $patterns{$_}; + } else { + foreach my $pattern (keys %patterns) { + $output .= render_text($pattern); + } + %patterns_answer = %patterns; + } - #show answer - return render_text($_), html => render_html($_) if ($patterns{$_}); - - #display the cheatsheet - my $output = my $html_output = ""; - foreach my $pattern (keys %patterns) { - $output .= render_text($pattern); - $html_output .= render_html($pattern); - } - - return $output, html => $html_output, heading => "Rubik's Cube Patterns"; + return $output, + structured_answer => { + id => 'rubiks_cube_patterns', + name => 'Answer', + data => { + record_data => \%patterns_answer, + }, + templates => { + group => 'list', + options => { + content => 'record', + } + } + }; }; 1; diff --git a/t/RubiksCubePatterns.t b/t/RubiksCubePatterns.t index 180ae5a2c..75d67ad7b 100644 --- a/t/RubiksCubePatterns.t +++ b/t/RubiksCubePatterns.t @@ -14,40 +14,138 @@ ddg_goodie_test( )], 'rubics cube stripes' => test_zci( "Stripes: F U F R L2 B D' R D2 L D' B R2 L F U F \n", - "html" => "
Stripes: F U F R L2 B D' R D2 L D' B R2 L F U F
\n" + structured_answer => { + id => 'rubiks_cube_patterns', + name => 'Answer', + data => { + record_data => {'stripes:', "F U F R L2 B D' R D2 L D' B R2 L F U F"}, + }, + templates => { + group => 'list', + options => { + content => 'record', + } + } + } ), 'rubiks cube cube in a cube' => test_zci( "Cube in a Cube: F L F U' R U F2 L2 U' L' B D' B' L2 U \n", - "html" => "
Cube in a Cube: F L F U' R U F2 L2 U' L' B D' B' L2 U
\n" + structured_answer => { + id => 'rubiks_cube_patterns', + name => 'Answer', + data => { + record_data => {'cube in a cube:', "F L F U' R U F2 L2 U' L' B D' B' L2 U"}, + }, + templates => { + group => 'list', + options => { + content => 'record', + } + } + } + #"html" => "
Cube in a Cube: F L F U' R U F2 L2 U' L' B D' B' L2 U
\n" ), 'rubic cube swap centers' => test_zci( "Swap Centers: U D' R L' F B' U D' \n", - "html" => "
Swap Centers: U D' R L' F B' U D'
\n" + structured_answer => { + id => 'rubiks_cube_patterns', + name => 'Answer', + data => { + record_data => {'swap centers:', "U D' R L' F B' U D'"}, + }, + templates => { + group => 'list', + options => { + content => 'record', + } + } + } + #"html" => "
Swap Centers: U D' R L' F B' U D'
\n" ), 'rubiks cube in a cube' => test_zci( "Cube in a Cube: F L F U' R U F2 L2 U' L' B D' B' L2 U \n", - "html" => "
Cube in a Cube: F L F U' R U F2 L2 U' L' B D' B' L2 U
\n" + structured_answer => { + id => 'rubiks_cube_patterns', + name => 'Answer', + data => { + record_data => {'cube in a cube:', "F L F U' R U F2 L2 U' L' B D' B' L2 U"}, + }, + templates => { + group => 'list', + options => { + content => 'record', + } + } + } + #"html" => "
Cube in a Cube: F L F U' R U F2 L2 U' L' B D' B' L2 U
\n" ), 'rubiks cube in a cube in a cube' => test_zci( "Cube in a Cube in a Cube: U' L' U' F' R2 B' R F U B2 U B' L U' F U R F' \n", - "html" => "
Cube in a Cube in a Cube: U' L' U' F' R2 B' R F U B2 U B' L U' F U R F'
\n" - ), - "rubik's cube patterns" => test_zci( - qr/.+: .+/s, - "html" => qr{
.+: .+
}s, - "heading" => "Rubik's Cube Patterns" + structured_answer => { + id => 'rubiks_cube_patterns', + name => 'Answer', + data => { + record_data => {'cube in a cube in a cube:', "U' L' U' F' R2 B' R F U B2 U B' L U' F U R F'"}, + }, + templates => { + group => 'list', + options => { + content => 'record', + } + } + } + #"html" => "
Cube in a Cube in a Cube: U' L' U' F' R2 B' R F U B2 U B' L U' F U R F'
\n" ), 'rcube stripes' => test_zci( "Stripes: F U F R L2 B D' R D2 L D' B R2 L F U F \n", - html => "
Stripes: F U F R L2 B D' R D2 L D' B R2 L F U F
\n", + structured_answer => { + id => 'rubiks_cube_patterns', + name => 'Answer', + data => { + record_data => {'stripes:', "F U F R L2 B D' R D2 L D' B R2 L F U F"}, + }, + templates => { + group => 'list', + options => { + content => 'record', + } + } + } + #html => "
Stripes: F U F R L2 B D' R D2 L D' B R2 L F U F
\n", ), 'rcube cube in a cube' => test_zci( "Cube in a Cube: F L F U' R U F2 L2 U' L' B D' B' L2 U \n", - html => "
Cube in a Cube: F L F U' R U F2 L2 U' L' B D' B' L2 U
\n", + structured_answer => { + id => 'rubiks_cube_patterns', + name => 'Answer', + data => { + record_data => {'cube in a cube:', "F L F U' R U F2 L2 U' L' B D' B' L2 U"}, + }, + templates => { + group => 'list', + options => { + content => 'record', + } + } + } + #html => "
Cube in a Cube: F L F U' R U F2 L2 U' L' B D' B' L2 U
\n", ), 'rcube swap centers' => test_zci( "Swap Centers: U D' R L' F B' U D' \n", - html => "
Swap Centers: U D' R L' F B' U D'
\n", + structured_answer => { + id => 'rubiks_cube_patterns', + name => 'Answer', + data => { + record_data => {'swap centers:', "U D' R L' F B' U D'"}, + }, + templates => { + group => 'list', + options => { + content => 'record', + } + } + } + #html => "
Swap Centers: U D' R L' F B' U D'
\n", ), ); From ec8e6f2f4dd79f84d451dde342a01056f86cea23 Mon Sep 17 00:00:00 2001 From: Mailkov Date: Sat, 5 Dec 2015 11:10:08 +0000 Subject: [PATCH 213/379] fix review --- lib/DDG/Goodie/RubiksCubePatterns.pm | 9 +++++- t/RubiksCubePatterns.t | 42 ++++++++++++++++++---------- 2 files changed, 35 insertions(+), 16 deletions(-) diff --git a/lib/DDG/Goodie/RubiksCubePatterns.pm b/lib/DDG/Goodie/RubiksCubePatterns.pm index e6faa8887..9500f99e7 100644 --- a/lib/DDG/Goodie/RubiksCubePatterns.pm +++ b/lib/DDG/Goodie/RubiksCubePatterns.pm @@ -64,14 +64,19 @@ handle remainder_lc => sub { my %patterns_answer; my $output; + my $title; + my $subtitle; if ($patterns{$_}) { $output = render_text($_); - $patterns_answer{$_ . ":"} .= $patterns{$_}; + $title = $patterns{$_}; + $subtitle = "Rubiks cube '" . to_titlecase($_) . "' pattern"; } else { + return if ($_ ne ''); foreach my $pattern (keys %patterns) { $output .= render_text($pattern); } + $title = 'Rubiks cube patterns'; %patterns_answer = %patterns; } @@ -80,6 +85,8 @@ handle remainder_lc => sub { id => 'rubiks_cube_patterns', name => 'Answer', data => { + title => $title, + subtitle => $subtitle, record_data => \%patterns_answer, }, templates => { diff --git a/t/RubiksCubePatterns.t b/t/RubiksCubePatterns.t index 75d67ad7b..04e136997 100644 --- a/t/RubiksCubePatterns.t +++ b/t/RubiksCubePatterns.t @@ -18,7 +18,9 @@ ddg_goodie_test( id => 'rubiks_cube_patterns', name => 'Answer', data => { - record_data => {'stripes:', "F U F R L2 B D' R D2 L D' B R2 L F U F"}, + title => "F U F R L2 B D' R D2 L D' B R2 L F U F", + subtitle => "Rubiks cube 'Stripes' pattern", + record_data => {}, }, templates => { group => 'list', @@ -34,7 +36,9 @@ ddg_goodie_test( id => 'rubiks_cube_patterns', name => 'Answer', data => { - record_data => {'cube in a cube:', "F L F U' R U F2 L2 U' L' B D' B' L2 U"}, + title => "F L F U' R U F2 L2 U' L' B D' B' L2 U", + subtitle => "Rubiks cube 'Cube in a Cube' pattern", + record_data => {}, }, templates => { group => 'list', @@ -43,7 +47,6 @@ ddg_goodie_test( } } } - #"html" => "
Cube in a Cube: F L F U' R U F2 L2 U' L' B D' B' L2 U
\n" ), 'rubic cube swap centers' => test_zci( "Swap Centers: U D' R L' F B' U D' \n", @@ -51,7 +54,9 @@ ddg_goodie_test( id => 'rubiks_cube_patterns', name => 'Answer', data => { - record_data => {'swap centers:', "U D' R L' F B' U D'"}, + title => "U D' R L' F B' U D'", + subtitle => "Rubiks cube 'Swap Centers' pattern", + record_data => {}, }, templates => { group => 'list', @@ -60,7 +65,6 @@ ddg_goodie_test( } } } - #"html" => "
Swap Centers: U D' R L' F B' U D'
\n" ), 'rubiks cube in a cube' => test_zci( "Cube in a Cube: F L F U' R U F2 L2 U' L' B D' B' L2 U \n", @@ -68,7 +72,9 @@ ddg_goodie_test( id => 'rubiks_cube_patterns', name => 'Answer', data => { - record_data => {'cube in a cube:', "F L F U' R U F2 L2 U' L' B D' B' L2 U"}, + title => "F L F U' R U F2 L2 U' L' B D' B' L2 U", + subtitle => "Rubiks cube 'Cube in a Cube' pattern", + record_data => {}, }, templates => { group => 'list', @@ -77,7 +83,6 @@ ddg_goodie_test( } } } - #"html" => "
Cube in a Cube: F L F U' R U F2 L2 U' L' B D' B' L2 U
\n" ), 'rubiks cube in a cube in a cube' => test_zci( "Cube in a Cube in a Cube: U' L' U' F' R2 B' R F U B2 U B' L U' F U R F' \n", @@ -85,7 +90,9 @@ ddg_goodie_test( id => 'rubiks_cube_patterns', name => 'Answer', data => { - record_data => {'cube in a cube in a cube:', "U' L' U' F' R2 B' R F U B2 U B' L U' F U R F'"}, + title => "U' L' U' F' R2 B' R F U B2 U B' L U' F U R F'", + subtitle => "Rubiks cube 'Cube in a Cube in a Cube' pattern", + record_data => {}, }, templates => { group => 'list', @@ -94,7 +101,6 @@ ddg_goodie_test( } } } - #"html" => "
Cube in a Cube in a Cube: U' L' U' F' R2 B' R F U B2 U B' L U' F U R F'
\n" ), 'rcube stripes' => test_zci( "Stripes: F U F R L2 B D' R D2 L D' B R2 L F U F \n", @@ -102,7 +108,9 @@ ddg_goodie_test( id => 'rubiks_cube_patterns', name => 'Answer', data => { - record_data => {'stripes:', "F U F R L2 B D' R D2 L D' B R2 L F U F"}, + title => "F U F R L2 B D' R D2 L D' B R2 L F U F", + subtitle => "Rubiks cube 'Stripes' pattern", + record_data => {}, }, templates => { group => 'list', @@ -111,7 +119,6 @@ ddg_goodie_test( } } } - #html => "
Stripes: F U F R L2 B D' R D2 L D' B R2 L F U F
\n", ), 'rcube cube in a cube' => test_zci( "Cube in a Cube: F L F U' R U F2 L2 U' L' B D' B' L2 U \n", @@ -119,7 +126,9 @@ ddg_goodie_test( id => 'rubiks_cube_patterns', name => 'Answer', data => { - record_data => {'cube in a cube:', "F L F U' R U F2 L2 U' L' B D' B' L2 U"}, + title => "F L F U' R U F2 L2 U' L' B D' B' L2 U", + subtitle => "Rubiks cube 'Cube in a Cube' pattern", + record_data => {}, }, templates => { group => 'list', @@ -128,7 +137,6 @@ ddg_goodie_test( } } } - #html => "
Cube in a Cube: F L F U' R U F2 L2 U' L' B D' B' L2 U
\n", ), 'rcube swap centers' => test_zci( "Swap Centers: U D' R L' F B' U D' \n", @@ -136,7 +144,9 @@ ddg_goodie_test( id => 'rubiks_cube_patterns', name => 'Answer', data => { - record_data => {'swap centers:', "U D' R L' F B' U D'"}, + title => "U D' R L' F B' U D'", + subtitle => "Rubiks cube 'Swap Centers' pattern", + record_data => {}, }, templates => { group => 'list', @@ -145,8 +155,10 @@ ddg_goodie_test( } } } - #html => "
Swap Centers: U D' R L' F B' U D'
\n", ), + 'rcube swap cented' => undef, + 'rcube cube in a cuve' => undef, + 'rubiks cube other words' => undef, ); done_testing; From df2486f772d66037fc735881ba80644feffbb8c7 Mon Sep 17 00:00:00 2001 From: mohan08p Date: Sat, 5 Dec 2015 14:24:25 +0000 Subject: [PATCH 214/379] Deleted extra file --- share/goodie/cheat_sheets/json/malayalam.json | 238 ------------------ 1 file changed, 238 deletions(-) delete mode 100644 share/goodie/cheat_sheets/json/malayalam.json diff --git a/share/goodie/cheat_sheets/json/malayalam.json b/share/goodie/cheat_sheets/json/malayalam.json deleted file mode 100644 index d0e5a81d9..000000000 --- a/share/goodie/cheat_sheets/json/malayalam.json +++ /dev/null @@ -1,238 +0,0 @@ -{ - "id" : "malayalam_cheat_sheet", - "name" : "Malayalam Cheat Sheet", - "metadata" : { - "sourceName" : "Pravasi Malayalam.com", - "sourceUrl" : "http://www.pravasimalayalam.com/index.shtml" - }, - "aliases": [ - "malayalam", "malayalam phrases", "malayalam phrases", "english to malayalam", - "basic malayalam phrases", "basic malayalam" - ], - "template_type": "language", - "section_order" : [ - "Etiquette", - "Basics", - "Getting Help", - "Travelling", - "Going out for dinner" - ], - "description" : "Basic Malayalam words and phrases", - "sections" : { - "Etiquette" : [ - { - "key" : "I'm sorry", - "val" : "എന്നോട് ക്ഷമിക്കൂ", - "trn" : "ennod kshamiku" - }, - { - "key" : "Thank you", - "val" : "നന്ദി ", - "trn" : "nandi" - }, - { - "key" : "Please...", - "val" : "ദയവായി...", - "trn" : "dayavaayi..." - }, - { - "key" : "Thank you very much!", - "val" : "വളരെ നന്ദി !", - "trn" : "valare nandi!" - }, - { - "key" : "You're welcome", - "val" : "നിനക്ക് സ്വാഗതം ", - "trn" : "ninak swagatham" - } - ], - "Getting Help" : [ - { - "key" : "Call the police!", - "val" : "പൊലീസിനെ വിളിക്കുക !", - "trn" : "Polisine viliku!" - }, - { - "key" : "Can you speak more slowly, please?", - "val" : "നിങ്ങള്ക്ക് ദയവായി വളരെ പതുകെ സംസാരിക്കാൻ കഴിയുമോ ?", - "trn" : "ningalk dayavaayi valare pathuke samsarikan kazhiyumo?" - }, - { - "key" : "Can you repeat, please?", - "val" : "നിങ്ങൾ ദയവായി ആവര്തികുമോ ?", - "trn" : "ningal dayavaayi aavarthikumo?" - }, - { - "key" : "How do you say \"X\" in Bengali?", - "val" : "നിങ്ങൾ \"X\" ഇത് മലയാളത്തിൽ എങ്ങനെ പറയും ?", - "trn" : "ningal \"X\" eth malayalathil engane parayum?" - }, - { - "key" : "Stop!", - "val" : "നിർത്തുക !", - "trn" : "nirthuka!" - }, - { - "key" : "Do you speak English?", - "val" : "നീ ഇംഗ്ലീഷ് സംസാരിക്കുമോ ?", - "trn" : "nee English samsarikumo?" - }, - { - "key" : "Excuse me!", - "val" : "എക്സ്ക്യൂസ് മീ !", - "trn" : "excuse me!" - }, - { - "key" : "I need a doctor!", - "val" : "എനിക്ക് ഒരു ഡോക്ടറെ ആവശ്യമുണ്ട് !", - "trn" : "enik oru doctore aavashyamund!" - }, - { - "key" : "Can you write that down, please?", - "val" : "നിങ്ങള്ക്ക് അത് ദയവായി എഴുതാൻ കഴിയുമോ ?", - "trn" : "Thangalk Ath ezhuthan pattumo?" - }, - { - "key" : "Call an ambulance!", - "val" : "ഒരു ആംബുലൻസ് വിളിക്കു !", - "trn" : "oru ambulance viliku!" - }, - { - "key" : "I am in danger!", - "val" : "ഞാൻ അപകടതിലാണ്ണ്‍ !", - "trn" : "njan apakadathil aan!" - }, - { - "key" : "Can you help me?", - "val" : "എന്നെ സഹായിക്കാമോ ?", - "trn" : "enne sahayikamo?" - }, - { - "key" : "Fire!", - "val" : "തീ !", - "trn" : "thee!" - } - ], - "Basics" : [ - { - "key" : "My name is...", - "val" : "എന്റെ പേര്...", - "trn" : "ente per..." - }, - { - "key" : "I'm fine, thanks!", - "val" : "എനിക്ക് സുഖമാണ്, നന്ദി !", - "trn" : "enik sugamaan, nandi!" - }, - { - "key" : "How are you?", - "val" : "സുഖമാണോ ?", - "trn" : "sugamaano?" - }, - { - "key" : "Welcome", - "val" : "സ്വാഗതം", - "trn" : "swagatham" - }, - { - "key" : "What's your name?", - "val" : "എന്താണ് നിങ്ങളുടെ പേര് ?", - "trn" : "enthaan ningalude per?" - } - ], - "Travelling" : [ - { - "key" : "Turn left.", - "val" : "ഇടത്തോട്ട് തിരിയുക .", - "trn" : "edathott thiriyuka." - }, - { - "key" : "Where is the exit?", - "val" : "എക്സിറ്റ് എവിടെയാണ് ?", - "trn" : "exut evideyaan?" - }, - { - "key" : "Where?", - "val" : "എവിടെ ?", - "trn" : "evide?" - }, - { - "key" : "Is it far?", - "val" : "അത് ബഹുദൂരം തന്നെയല്ലേ ?", - "trn" : "ath bahudooram thannayalle?" - }, - { - "key" : "Go straight ahead.", - "val" : "നേരെ മുന്നോട്ടു പോകുക .", - "trn" : "nere munnott pokuka." - }, - { - "key" : "Do you have a city map?", - "val" : "നിങ്ങളുടെ കയ്യില പട്ടണത്തിന്റെ മാപ് ഉണ്ടോ ?", - "trn" : "ningalude kayyil pattanathinte map undo?" - }, - { - "key" : "Please stop here.", - "val" : "ഇവിടെ നിർത്തുക .", - "trn" : "evide nirthuka." - }, - { - "key" : "Turn right.", - "val" : "വലത്തോട്ട് തിരിയുക .", - "trn" : "valathottu thiriyuka." - }, - { - "key" : "Where can I find the taxis?", - "val" : "എനിക്ക് എവിടെ ടാക്സി കണ്ടെത്താൻ കഴിയും ?", - "trn" : "enik evide taxi kandethan kazhiyum?" - }, - { - "key" : "How can I get a taxi?", - "val" : "എനിക്ക് എങ്ങനെ ടാക്സി ലഭിക്കും ?", - "trn" : "enik engane tazi labikum?" - } - ], - "Going out for dinner" : [ - { - "key" : "Do you have vegetarian dishes?", - "val" : "എവിടെ വെഗിടരിയൻ വിഭവങ്ങൾ ഉണ്ടോ ?", - "trn" : "Evide vegetarian vibavangal undo?" - }, - { - "key" : "I am allergic", - "val" : "എനിക്ക് അലെർഗി ഉണ്ട് ", - "trn" : "Enik alergy und" - }, - { - "key" : "The check please!", - "val" : "ചെക്ക്‌ നല്കു !", - "trn" : "check nalku!" - }, - { - "key" : "A cup of coffee please.", - "val" : "ദയവായി ഒരു കപ്പ്‌ കാപ്പി തരു .", - "trn" : "dhayavaayi oru cup kaappi tharu." - }, - { - "key" : "Where is a good restaurant?", - "val" : "എവിടെ ആണ്‍ നല്ല ഭക്ഷണശാല ?", - "trn" : "Evide aan nalla bhakshanashaala?" - }, - { - "key" : "A glass of water please.", - "val" : "ഒരു ഗ്ലാസ്‌ വെള്ളം തരുമോ .", - "trn" : "oru glass vellam tharumo." - }, - { - "key" : "A table for two please!", - "val" : "ദയവായി രണ്ട് ആള്കുള്ള ടേബിൾ വേണം !", - "trn" : "dayavaayi rand aalkulla table venam" - }, - { - "key" : "Can I get a menu, please?", - "val" : "എനിക്ക് ഇവിടത്തെ മെനു തരുമോ ?", - "trn" : "enik evidathe menu tharumo?" - } - ] - } -} \ No newline at end of file From 658d86bebc73895d8d30ed590f0a361849c23941 Mon Sep 17 00:00:00 2001 From: JOBIN PHILIP ABRAHAM Date: Sat, 5 Dec 2015 20:28:41 +0530 Subject: [PATCH 215/379] Update magit.json --- share/goodie/cheat_sheets/json/magit.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/share/goodie/cheat_sheets/json/magit.json b/share/goodie/cheat_sheets/json/magit.json index eb52a3682..adbd628df 100644 --- a/share/goodie/cheat_sheets/json/magit.json +++ b/share/goodie/cheat_sheets/json/magit.json @@ -3,7 +3,7 @@ "name": "Magit", "description": "Git Version Control via Emacs", "metadata": { - "sourceName": "MagitCheatSheet", + "sourceName": "Daemian Mack", "sourceUrl": "http://daemianmack.com/magit-cheatsheet.html" }, "template_type": "keyboard", @@ -34,11 +34,11 @@ }, { "key": "$", - "val": "magit-process buffer" + "val": "Magit-process buffer" }, { "key": "g", - "val": "reload status buffer" + "val": "Reload status buffer" } ], "Section Visibility": [ From 08c9a4b8ed1886c653919f7149c9114964fd8a4a Mon Sep 17 00:00:00 2001 From: Mailkov Date: Sat, 5 Dec 2015 15:08:53 +0000 Subject: [PATCH 216/379] fix indentation RubiksCubePatterns.pm --- lib/DDG/Goodie/RubiksCubePatterns.pm | 66 ++++++++++++++-------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/lib/DDG/Goodie/RubiksCubePatterns.pm b/lib/DDG/Goodie/RubiksCubePatterns.pm index 9500f99e7..86a5484aa 100644 --- a/lib/DDG/Goodie/RubiksCubePatterns.pm +++ b/lib/DDG/Goodie/RubiksCubePatterns.pm @@ -27,43 +27,43 @@ zci answer_type => "rubiks_cube"; zci is_cached => 1; my %patterns = ( - "stripes" => "F U F R L2 B D' R D2 L D' B R2 L F U F", - "crosses" => "U F B' L2 U2 L2 F' B U2 L2 U", - "swap centers" => "U D' R L' F B' U D'", - "checkerboard" => "F2 B2 R2 L2 U2 D2", - "cube in a cube" => "F L F U' R U F2 L2 U' L' B D' B' L2 U", - "cube in a cube in a cube" => "U' L' U' F' R2 B' R F U B2 U B' L U' F U R F'", - "exchanged peaks" => "F2 R2 D R2 U D F2 D' R' D' F L2 F' D R U'", - "t's" => "F2 R2 U2 F' B D2 L2 F B", - "anaconda" => "L U B' U' R L' B R' F B' D R D' F'", - "python" => "F2 R' B' U R' L F' L F' B D' R B L2", - "black mamba" => "R D L F' R L' D R' U D' B U' R' D'", + "stripes" => "F U F R L2 B D' R D2 L D' B R2 L F U F", + "crosses" => "U F B' L2 U2 L2 F' B U2 L2 U", + "swap centers" => "U D' R L' F B' U D'", + "checkerboard" => "F2 B2 R2 L2 U2 D2", + "cube in a cube" => "F L F U' R U F2 L2 U' L' B D' B' L2 U", + "cube in a cube in a cube" => "U' L' U' F' R2 B' R F U B2 U B' L U' F U R F'", + "exchanged peaks" => "F2 R2 D R2 U D F2 D' R' D' F L2 F' D R U'", + "t's" => "F2 R2 U2 F' B D2 L2 F B", + "anaconda" => "L U B' U' R L' B R' F B' D R D' F'", + "python" => "F2 R' B' U R' L F' L F' B D' R B L2", + "black mamba" => "R D L F' R L' D R' U D' B U' R' D'", ); sub to_titlecase($) { - $a = pop; - $a =~ s/(\w\S*)/\u\L$1/g; - $a =~ s/ In / in /g; - $a =~ s/ A / a /g; - return $a; + $a = pop; + $a =~ s/(\w\S*)/\u\L$1/g; + $a =~ s/ In / in /g; + $a =~ s/ A / a /g; + return $a; } sub render_text($) { - my $name = pop; - return to_titlecase($name) . ": $patterns{$name} \n"; + my $name = pop; + return to_titlecase($name) . ": $patterns{$name} \n"; } handle remainder_lc => sub { - #support British English! - s/centre/center/; + #support British English! + s/centre/center/; - #hack for the trigger "rubiks cube in a cube" - s/^in a cube/cube in a cube/; + #hack for the trigger "rubiks cube in a cube" + s/^in a cube/cube in a cube/; - my %patterns_answer; - my $output; + my %patterns_answer; + my $output; my $title; my $subtitle; @@ -73,14 +73,14 @@ handle remainder_lc => sub { $subtitle = "Rubiks cube '" . to_titlecase($_) . "' pattern"; } else { return if ($_ ne ''); - foreach my $pattern (keys %patterns) { - $output .= render_text($pattern); - } + foreach my $pattern (keys %patterns) { + $output .= render_text($pattern); + } $title = 'Rubiks cube patterns'; %patterns_answer = %patterns; } - return $output, + return $output, structured_answer => { id => 'rubiks_cube_patterns', name => 'Answer', @@ -90,12 +90,12 @@ handle remainder_lc => sub { record_data => \%patterns_answer, }, templates => { - group => 'list', - options => { - content => 'record', - } + group => 'list', + options => { + content => 'record', } - }; + } + }; }; 1; From 793318586ee2bfe1d93d0718410c3028c5ad5be4 Mon Sep 17 00:00:00 2001 From: JOBIN PHILIP ABRAHAM Date: Sat, 5 Dec 2015 20:46:37 +0530 Subject: [PATCH 217/379] Update linux.json updated name --- share/goodie/cheat_sheets/json/linux.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/goodie/cheat_sheets/json/linux.json b/share/goodie/cheat_sheets/json/linux.json index af99ba0f9..c886dfb69 100644 --- a/share/goodie/cheat_sheets/json/linux.json +++ b/share/goodie/cheat_sheets/json/linux.json @@ -2,7 +2,7 @@ "id":"linux_cheat_sheet", "name":"Linux", "metadata":{ - "sourceName":"linuxstall", + "sourceName":"Linux Stall", "sourceUrl":"http://www.linuxstall.com/wp-content/uploads/2012/01/" }, "template_type":"terminal", @@ -376,4 +376,4 @@ } ] } -} \ No newline at end of file +} From 5599db5665fc9c8bfa25a123bab7702b93ab92cd Mon Sep 17 00:00:00 2001 From: Mailkov Date: Sat, 5 Dec 2015 15:21:59 +0000 Subject: [PATCH 218/379] fix indentation RubicksCubePatterns.t --- t/RubiksCubePatterns.t | 266 ++++++++++++++++++++--------------------- 1 file changed, 132 insertions(+), 134 deletions(-) diff --git a/t/RubiksCubePatterns.t b/t/RubiksCubePatterns.t index 04e136997..121578681 100644 --- a/t/RubiksCubePatterns.t +++ b/t/RubiksCubePatterns.t @@ -9,156 +9,154 @@ zci answer_type => 'rubiks_cube'; zci is_cached => 1; ddg_goodie_test( - [qw( - DDG::Goodie::RubiksCubePatterns - )], - 'rubics cube stripes' => test_zci( - "Stripes: F U F R L2 B D' R D2 L D' B R2 L F U F \n", - structured_answer => { - id => 'rubiks_cube_patterns', - name => 'Answer', - data => { - title => "F U F R L2 B D' R D2 L D' B R2 L F U F", - subtitle => "Rubiks cube 'Stripes' pattern", - record_data => {}, - }, - templates => { - group => 'list', - options => { - content => 'record', - } + [qw(DDG::Goodie::RubiksCubePatterns)], + 'rubics cube stripes' => test_zci( + "Stripes: F U F R L2 B D' R D2 L D' B R2 L F U F \n", + structured_answer => { + id => 'rubiks_cube_patterns', + name => 'Answer', + data => { + title => "F U F R L2 B D' R D2 L D' B R2 L F U F", + subtitle => "Rubiks cube 'Stripes' pattern", + record_data => {}, + }, + templates => { + group => 'list', + options => { + content => 'record', } } - ), - 'rubiks cube cube in a cube' => test_zci( - "Cube in a Cube: F L F U' R U F2 L2 U' L' B D' B' L2 U \n", - structured_answer => { - id => 'rubiks_cube_patterns', - name => 'Answer', - data => { - title => "F L F U' R U F2 L2 U' L' B D' B' L2 U", - subtitle => "Rubiks cube 'Cube in a Cube' pattern", - record_data => {}, - }, - templates => { - group => 'list', - options => { - content => 'record', - } + } + ), + 'rubiks cube cube in a cube' => test_zci( + "Cube in a Cube: F L F U' R U F2 L2 U' L' B D' B' L2 U \n", + structured_answer => { + id => 'rubiks_cube_patterns', + name => 'Answer', + data => { + title => "F L F U' R U F2 L2 U' L' B D' B' L2 U", + subtitle => "Rubiks cube 'Cube in a Cube' pattern", + record_data => {}, + }, + templates => { + group => 'list', + options => { + content => 'record', } } - ), - 'rubic cube swap centers' => test_zci( - "Swap Centers: U D' R L' F B' U D' \n", - structured_answer => { - id => 'rubiks_cube_patterns', - name => 'Answer', - data => { - title => "U D' R L' F B' U D'", - subtitle => "Rubiks cube 'Swap Centers' pattern", - record_data => {}, - }, - templates => { - group => 'list', - options => { - content => 'record', - } + } + ), + 'rubic cube swap centers' => test_zci( + "Swap Centers: U D' R L' F B' U D' \n", + structured_answer => { + id => 'rubiks_cube_patterns', + name => 'Answer', + data => { + title => "U D' R L' F B' U D'", + subtitle => "Rubiks cube 'Swap Centers' pattern", + record_data => {}, + }, + templates => { + group => 'list', + options => { + content => 'record', } } - ), - 'rubiks cube in a cube' => test_zci( - "Cube in a Cube: F L F U' R U F2 L2 U' L' B D' B' L2 U \n", - structured_answer => { - id => 'rubiks_cube_patterns', - name => 'Answer', - data => { - title => "F L F U' R U F2 L2 U' L' B D' B' L2 U", - subtitle => "Rubiks cube 'Cube in a Cube' pattern", - record_data => {}, - }, - templates => { - group => 'list', - options => { - content => 'record', - } + } + ), + 'rubiks cube in a cube' => test_zci( + "Cube in a Cube: F L F U' R U F2 L2 U' L' B D' B' L2 U \n", + structured_answer => { + id => 'rubiks_cube_patterns', + name => 'Answer', + data => { + title => "F L F U' R U F2 L2 U' L' B D' B' L2 U", + subtitle => "Rubiks cube 'Cube in a Cube' pattern", + record_data => {}, + }, + templates => { + group => 'list', + options => { + content => 'record', } } - ), - 'rubiks cube in a cube in a cube' => test_zci( - "Cube in a Cube in a Cube: U' L' U' F' R2 B' R F U B2 U B' L U' F U R F' \n", - structured_answer => { - id => 'rubiks_cube_patterns', - name => 'Answer', - data => { - title => "U' L' U' F' R2 B' R F U B2 U B' L U' F U R F'", - subtitle => "Rubiks cube 'Cube in a Cube in a Cube' pattern", - record_data => {}, - }, - templates => { - group => 'list', - options => { - content => 'record', - } + } + ), + 'rubiks cube in a cube in a cube' => test_zci( + "Cube in a Cube in a Cube: U' L' U' F' R2 B' R F U B2 U B' L U' F U R F' \n", + structured_answer => { + id => 'rubiks_cube_patterns', + name => 'Answer', + data => { + title => "U' L' U' F' R2 B' R F U B2 U B' L U' F U R F'", + subtitle => "Rubiks cube 'Cube in a Cube in a Cube' pattern", + record_data => {}, + }, + templates => { + group => 'list', + options => { + content => 'record', } } - ), - 'rcube stripes' => test_zci( - "Stripes: F U F R L2 B D' R D2 L D' B R2 L F U F \n", - structured_answer => { - id => 'rubiks_cube_patterns', - name => 'Answer', - data => { - title => "F U F R L2 B D' R D2 L D' B R2 L F U F", - subtitle => "Rubiks cube 'Stripes' pattern", - record_data => {}, - }, - templates => { - group => 'list', - options => { - content => 'record', - } + } + ), + 'rcube stripes' => test_zci( + "Stripes: F U F R L2 B D' R D2 L D' B R2 L F U F \n", + structured_answer => { + id => 'rubiks_cube_patterns', + name => 'Answer', + data => { + title => "F U F R L2 B D' R D2 L D' B R2 L F U F", + subtitle => "Rubiks cube 'Stripes' pattern", + record_data => {}, + }, + templates => { + group => 'list', + options => { + content => 'record', } } - ), - 'rcube cube in a cube' => test_zci( - "Cube in a Cube: F L F U' R U F2 L2 U' L' B D' B' L2 U \n", - structured_answer => { - id => 'rubiks_cube_patterns', - name => 'Answer', - data => { - title => "F L F U' R U F2 L2 U' L' B D' B' L2 U", - subtitle => "Rubiks cube 'Cube in a Cube' pattern", - record_data => {}, - }, - templates => { - group => 'list', - options => { - content => 'record', - } + } + ), + 'rcube cube in a cube' => test_zci( + "Cube in a Cube: F L F U' R U F2 L2 U' L' B D' B' L2 U \n", + structured_answer => { + id => 'rubiks_cube_patterns', + name => 'Answer', + data => { + title => "F L F U' R U F2 L2 U' L' B D' B' L2 U", + subtitle => "Rubiks cube 'Cube in a Cube' pattern", + record_data => {}, + }, + templates => { + group => 'list', + options => { + content => 'record', } } - ), - 'rcube swap centers' => test_zci( - "Swap Centers: U D' R L' F B' U D' \n", - structured_answer => { - id => 'rubiks_cube_patterns', - name => 'Answer', - data => { - title => "U D' R L' F B' U D'", - subtitle => "Rubiks cube 'Swap Centers' pattern", - record_data => {}, - }, - templates => { - group => 'list', - options => { - content => 'record', - } + } + ), + 'rcube swap centers' => test_zci( + "Swap Centers: U D' R L' F B' U D' \n", + structured_answer => { + id => 'rubiks_cube_patterns', + name => 'Answer', + data => { + title => "U D' R L' F B' U D'", + subtitle => "Rubiks cube 'Swap Centers' pattern", + record_data => {}, + }, + templates => { + group => 'list', + options => { + content => 'record', } } - ), - 'rcube swap cented' => undef, - 'rcube cube in a cuve' => undef, - 'rubiks cube other words' => undef, + } + ), + 'rcube swap cented' => undef, + 'rcube cube in a cuve' => undef, + 'rubiks cube other words' => undef, ); done_testing; From 014ba512fd83762e484f7f5db32be05e74521ef5 Mon Sep 17 00:00:00 2001 From: JOBIN PHILIP ABRAHAM Date: Sat, 5 Dec 2015 20:54:50 +0530 Subject: [PATCH 219/379] Update nmap.json updated name and source name --- share/goodie/cheat_sheets/json/nmap.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/share/goodie/cheat_sheets/json/nmap.json b/share/goodie/cheat_sheets/json/nmap.json index 3382db658..189eb9be8 100644 --- a/share/goodie/cheat_sheets/json/nmap.json +++ b/share/goodie/cheat_sheets/json/nmap.json @@ -1,9 +1,9 @@ { "id": "nmap_cheat_sheet", - "name": "nmap", - "description": "Nmap Security Scanner", + "name": "Nmap", + "description": "Quick reference for Nmap Security Scanner", "metadata": { - "sourceName": "nmap cookbook", + "sourceName": "Nmap Cookbook", "sourceUrl": "http://nmapcookbook.blogspot.com.br/2010/02/nmap-cheat-sheet.html" }, "template_type": "terminal", From bc84d0d76dd286a90c94a4c99f8cdab7243b74a4 Mon Sep 17 00:00:00 2001 From: mohan08p Date: Sat, 5 Dec 2015 17:28:00 +0000 Subject: [PATCH 220/379] Basic Changes made --- .../cheat_sheets/json/language/malayalam.json | 100 +++++++++--------- 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/share/goodie/cheat_sheets/json/language/malayalam.json b/share/goodie/cheat_sheets/json/language/malayalam.json index d0e5a81d9..48d45c983 100644 --- a/share/goodie/cheat_sheets/json/language/malayalam.json +++ b/share/goodie/cheat_sheets/json/language/malayalam.json @@ -2,11 +2,11 @@ "id" : "malayalam_cheat_sheet", "name" : "Malayalam Cheat Sheet", "metadata" : { - "sourceName" : "Pravasi Malayalam.com", + "sourceName" : "Pravasi Malayalam", "sourceUrl" : "http://www.pravasimalayalam.com/index.shtml" }, "aliases": [ - "malayalam", "malayalam phrases", "malayalam phrases", "english to malayalam", + "malayalam", "malayalam phrases", "Malayalam phrases", "english to malayalam", "basic malayalam phrases", "basic malayalam" ], "template_type": "language", @@ -23,27 +23,27 @@ { "key" : "I'm sorry", "val" : "എന്നോട് ക്ഷമിക്കൂ", - "trn" : "ennod kshamiku" + "trn" : "Ennod kshamiku" }, { "key" : "Thank you", "val" : "നന്ദി ", - "trn" : "nandi" + "trn" : "Nanni" }, { "key" : "Please...", "val" : "ദയവായി...", - "trn" : "dayavaayi..." + "trn" : "Dayavaayi..." }, { "key" : "Thank you very much!", "val" : "വളരെ നന്ദി !", - "trn" : "valare nandi!" + "trn" : "Valare nanni!" }, { "key" : "You're welcome", - "val" : "നിനക്ക് സ്വാഗതം ", - "trn" : "ninak swagatham" + "val" : "നതാങ്കൾക്ക് സ്വാഗതം ", + "trn" : "Thaangalku swagatham" } ], "Getting Help" : [ @@ -54,149 +54,149 @@ }, { "key" : "Can you speak more slowly, please?", - "val" : "നിങ്ങള്ക്ക് ദയവായി വളരെ പതുകെ സംസാരിക്കാൻ കഴിയുമോ ?", - "trn" : "ningalk dayavaayi valare pathuke samsarikan kazhiyumo?" + "val" : "നതാങ്കൾക്ക് കുറച്ചുകൂടി പതുക്കെ സംസാരിക്കാൻ കഴിയുമോ ?", + "trn" : "Thangalku kurachukoodi pathukke samsarikkan kazhiyumo?" }, { "key" : "Can you repeat, please?", - "val" : "നിങ്ങൾ ദയവായി ആവര്തികുമോ ?", - "trn" : "ningal dayavaayi aavarthikumo?" + "val" : "നിങ്ങൾ ദയവായി ആവർത്തിക്കുമോ ?", + "trn" : "Ningal dayavaayi aavarthikumo?" }, { - "key" : "How do you say \"X\" in Bengali?", + "key" : "How do you say \"X\" in Malayalam?", "val" : "നിങ്ങൾ \"X\" ഇത് മലയാളത്തിൽ എങ്ങനെ പറയും ?", - "trn" : "ningal \"X\" eth malayalathil engane parayum?" + "trn" : "Ningal \"X\" eth malayalathil engane parayum?" }, { "key" : "Stop!", "val" : "നിർത്തുക !", - "trn" : "nirthuka!" + "trn" : "Nirthuka!" }, { "key" : "Do you speak English?", - "val" : "നീ ഇംഗ്ലീഷ് സംസാരിക്കുമോ ?", - "trn" : "nee English samsarikumo?" + "val" : "താങ്കൾ ഇംഗ്ലീഷ് സംസാരിക്കുമോ ?", + "trn" : "Thaangal English samsarikumo?" }, { "key" : "Excuse me!", "val" : "എക്സ്ക്യൂസ് മീ !", - "trn" : "excuse me!" + "trn" : "Excuse me!" }, { "key" : "I need a doctor!", "val" : "എനിക്ക് ഒരു ഡോക്ടറെ ആവശ്യമുണ്ട് !", - "trn" : "enik oru doctore aavashyamund!" + "trn" : "Enik oru doctore aavashyamund!" }, { "key" : "Can you write that down, please?", - "val" : "നിങ്ങള്ക്ക് അത് ദയവായി എഴുതാൻ കഴിയുമോ ?", - "trn" : "Thangalk Ath ezhuthan pattumo?" + "val" : "താങ്കൾക്ക് അത് എഴുതാൻ കഴിയുമോ ?", + "trn" : "Thaangalkku ath ezhuthan kazhiyumo?" }, { "key" : "Call an ambulance!", "val" : "ഒരു ആംബുലൻസ് വിളിക്കു !", - "trn" : "oru ambulance viliku!" + "trn" : "Oru ambulance viliku!" }, { "key" : "I am in danger!", "val" : "ഞാൻ അപകടതിലാണ്ണ്‍ !", - "trn" : "njan apakadathil aan!" + "trn" : "Njan apakadathil aanu!" }, { "key" : "Can you help me?", "val" : "എന്നെ സഹായിക്കാമോ ?", - "trn" : "enne sahayikamo?" + "trn" : "Enne sahayikkamo?" }, { "key" : "Fire!", "val" : "തീ !", - "trn" : "thee!" + "trn" : "Thee!" } ], "Basics" : [ { "key" : "My name is...", "val" : "എന്റെ പേര്...", - "trn" : "ente per..." + "trn" : "Ente peeru..." }, { "key" : "I'm fine, thanks!", "val" : "എനിക്ക് സുഖമാണ്, നന്ദി !", - "trn" : "enik sugamaan, nandi!" + "trn" : "Enik sugamaan, nanni!" }, { "key" : "How are you?", "val" : "സുഖമാണോ ?", - "trn" : "sugamaano?" + "trn" : "Sugamaano?" }, { "key" : "Welcome", "val" : "സ്വാഗതം", - "trn" : "swagatham" + "trn" : "Swagatham" }, { "key" : "What's your name?", "val" : "എന്താണ് നിങ്ങളുടെ പേര് ?", - "trn" : "enthaan ningalude per?" + "trn" : "Enthanu ningalude peeru?" } ], "Travelling" : [ { "key" : "Turn left.", "val" : "ഇടത്തോട്ട് തിരിയുക .", - "trn" : "edathott thiriyuka." + "trn" : "Edathott thiriyuka." }, { "key" : "Where is the exit?", "val" : "എക്സിറ്റ് എവിടെയാണ് ?", - "trn" : "exut evideyaan?" + "trn" : "Exit evideyaanu?" }, { "key" : "Where?", "val" : "എവിടെ ?", - "trn" : "evide?" + "trn" : "Evide?" }, { "key" : "Is it far?", - "val" : "അത് ബഹുദൂരം തന്നെയല്ലേ ?", - "trn" : "ath bahudooram thannayalle?" + "val" : "അത് ദൂരെ ആണോ ?", + "trn" : "Athu dhoore aano?" }, { "key" : "Go straight ahead.", "val" : "നേരെ മുന്നോട്ടു പോകുക .", - "trn" : "nere munnott pokuka." + "trn" : "Nere munnott pokuka." }, { "key" : "Do you have a city map?", "val" : "നിങ്ങളുടെ കയ്യില പട്ടണത്തിന്റെ മാപ് ഉണ്ടോ ?", - "trn" : "ningalude kayyil pattanathinte map undo?" + "trn" : "Ningalude kayyil pattanathinte map undo?" }, { "key" : "Please stop here.", "val" : "ഇവിടെ നിർത്തുക .", - "trn" : "evide nirthuka." + "trn" : "Evide nirthuka." }, { "key" : "Turn right.", "val" : "വലത്തോട്ട് തിരിയുക .", - "trn" : "valathottu thiriyuka." + "trn" : "Valathottu thiriyuka." }, { "key" : "Where can I find the taxis?", "val" : "എനിക്ക് എവിടെ ടാക്സി കണ്ടെത്താൻ കഴിയും ?", - "trn" : "enik evide taxi kandethan kazhiyum?" + "trn" : "Enik evide taxi kandethan kazhiyum?" }, { "key" : "How can I get a taxi?", "val" : "എനിക്ക് എങ്ങനെ ടാക്സി ലഭിക്കും ?", - "trn" : "enik engane tazi labikum?" + "trn" : "Enik engane taxi labhikkum?" } ], "Going out for dinner" : [ { "key" : "Do you have vegetarian dishes?", "val" : "എവിടെ വെഗിടരിയൻ വിഭവങ്ങൾ ഉണ്ടോ ?", - "trn" : "Evide vegetarian vibavangal undo?" + "trn" : "Ivide vegetarian vibhavangal undo?" }, { "key" : "I am allergic", @@ -204,34 +204,34 @@ "trn" : "Enik alergy und" }, { - "key" : "The check please!", - "val" : "ചെക്ക്‌ നല്കു !", - "trn" : "check nalku!" + "key" : "The cheque please!", + "val" : "പരിശോധിക്കുക !", + "trn" : "Cheque nalku!" }, { "key" : "A cup of coffee please.", "val" : "ദയവായി ഒരു കപ്പ്‌ കാപ്പി തരു .", - "trn" : "dhayavaayi oru cup kaappi tharu." + "trn" : "Dhayavaayi oru cup kaappi tharu." }, { "key" : "Where is a good restaurant?", "val" : "എവിടെ ആണ്‍ നല്ല ഭക്ഷണശാല ?", - "trn" : "Evide aan nalla bhakshanashaala?" + "trn" : "Evide annu nalla bhakshanashaala ullathu?" }, { "key" : "A glass of water please.", "val" : "ഒരു ഗ്ലാസ്‌ വെള്ളം തരുമോ .", - "trn" : "oru glass vellam tharumo." + "trn" : "Oru glass vellam tharumo." }, { "key" : "A table for two please!", "val" : "ദയവായി രണ്ട് ആള്കുള്ള ടേബിൾ വേണം !", - "trn" : "dayavaayi rand aalkulla table venam" + "trn" : "Dayavaayi rand aalukalkkulla table venam" }, { "key" : "Can I get a menu, please?", "val" : "എനിക്ക് ഇവിടത്തെ മെനു തരുമോ ?", - "trn" : "enik evidathe menu tharumo?" + "trn" : "Enik evidathe menu tharumo?" } ] } From 1d37dd8053f084b3a425875753dcf54d28c4ae35 Mon Sep 17 00:00:00 2001 From: Mailkov Date: Sun, 6 Dec 2015 07:01:48 +0000 Subject: [PATCH 221/379] Fix #1837 - ensure it has a remainder to sort --- lib/DDG/Goodie/Sort.pm | 6 +++++- t/Sort.t | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/DDG/Goodie/Sort.pm b/lib/DDG/Goodie/Sort.pm index b1359a8f7..83da444a7 100644 --- a/lib/DDG/Goodie/Sort.pm +++ b/lib/DDG/Goodie/Sort.pm @@ -24,11 +24,15 @@ code_url 'http://github.com/koosha--'; category 'computing_tools'; topics 'programming'; attribution github => ['koosha--', 'Koosha K. M.'], - twitter => '_koosha_'; + twitter => '_koosha_', + github => ["https://github.com/Mailkov", "Melchiorre Alastra"]; my $delim = ', '; handle remainder => sub { + + return unless $_; + my $input = $_; $input =~ s/[\(\{\[] | diff --git a/t/Sort.t b/t/Sort.t index be3030974..043e6546e 100644 --- a/t/Sort.t +++ b/t/Sort.t @@ -76,6 +76,7 @@ ddg_goodie_test( ), 'sort algorithm' => undef, 'sort 1 fish, 2 fish' => undef, + 'sort' => undef, ); done_testing; From 6cb9a9e2c4188413380dcabf18082e48a10ae9a8 Mon Sep 17 00:00:00 2001 From: mohan08p Date: Sun, 6 Dec 2015 15:31:38 +0000 Subject: [PATCH 222/379] Native language fields updated. --- .../cheat_sheets/json/language/malayalam.json | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/share/goodie/cheat_sheets/json/language/malayalam.json b/share/goodie/cheat_sheets/json/language/malayalam.json index 48d45c983..0f9a194f2 100644 --- a/share/goodie/cheat_sheets/json/language/malayalam.json +++ b/share/goodie/cheat_sheets/json/language/malayalam.json @@ -42,8 +42,8 @@ }, { "key" : "You're welcome", - "val" : "നതാങ്കൾക്ക് സ്വാഗതം ", - "trn" : "Thaangalku swagatham" + "val" : " താങ്കൾക്ക് സ്വാഗതം ", + "trn" : "Thaangalku swaagatham" } ], "Getting Help" : [ @@ -54,7 +54,7 @@ }, { "key" : "Can you speak more slowly, please?", - "val" : "നതാങ്കൾക്ക് കുറച്ചുകൂടി പതുക്കെ സംസാരിക്കാൻ കഴിയുമോ ?", + "val" : "താങ്കൾക്ക് കുറച്ചുകൂടി പതുക്കെ സംസാരിക്കാൻ കഴിയുമോ ?", "trn" : "Thangalku kurachukoodi pathukke samsarikkan kazhiyumo?" }, { @@ -85,7 +85,7 @@ { "key" : "I need a doctor!", "val" : "എനിക്ക് ഒരു ഡോക്ടറെ ആവശ്യമുണ്ട് !", - "trn" : "Enik oru doctore aavashyamund!" + "trn" : "Enikku oru doctore aavashyamund!" }, { "key" : "Can you write that down, please?", @@ -95,11 +95,11 @@ { "key" : "Call an ambulance!", "val" : "ഒരു ആംബുലൻസ് വിളിക്കു !", - "trn" : "Oru ambulance viliku!" + "trn" : "Oru ambulance vilikku!" }, { "key" : "I am in danger!", - "val" : "ഞാൻ അപകടതിലാണ്ണ്‍ !", + "val" : "ഞാൻ അപകടത്തിലാണ് !", "trn" : "Njan apakadathil aanu!" }, { @@ -132,7 +132,7 @@ { "key" : "Welcome", "val" : "സ്വാഗതം", - "trn" : "Swagatham" + "trn" : "Swaagatham" }, { "key" : "What's your name?", @@ -168,7 +168,7 @@ }, { "key" : "Do you have a city map?", - "val" : "നിങ്ങളുടെ കയ്യില പട്ടണത്തിന്റെ മാപ് ഉണ്ടോ ?", + "val" : "നിങ്ങളുടെ കൈയ്യിൽ പട്ടണത്തിൻറെ മാപ്പ് ഉണ്ടോ ?", "trn" : "Ningalude kayyil pattanathinte map undo?" }, { @@ -184,7 +184,7 @@ { "key" : "Where can I find the taxis?", "val" : "എനിക്ക് എവിടെ ടാക്സി കണ്ടെത്താൻ കഴിയും ?", - "trn" : "Enik evide taxi kandethan kazhiyum?" + "trn" : "Enik evide taxis kandethan kazhiyum?" }, { "key" : "How can I get a taxi?", @@ -195,7 +195,7 @@ "Going out for dinner" : [ { "key" : "Do you have vegetarian dishes?", - "val" : "എവിടെ വെഗിടരിയൻ വിഭവങ്ങൾ ഉണ്ടോ ?", + "val" : "ഇവിടെ വെജിറ്റേറിയൻ വിഭവങ്ങൾ ഉണ്ടോ ?", "trn" : "Ivide vegetarian vibhavangal undo?" }, { @@ -205,7 +205,7 @@ }, { "key" : "The cheque please!", - "val" : "പരിശോധിക്കുക !", + "val" : "ചെക്ക്‌ നല്കു !", "trn" : "Cheque nalku!" }, { @@ -215,8 +215,8 @@ }, { "key" : "Where is a good restaurant?", - "val" : "എവിടെ ആണ്‍ നല്ല ഭക്ഷണശാല ?", - "trn" : "Evide annu nalla bhakshanashaala ullathu?" + "val" : "എവിടെ ആണ് നല്ല ഭക്ഷണശാല ഉള്ളത് ?", + "trn" : "Evide aanu nalla bhakshanashaala ullathu?" }, { "key" : "A glass of water please.", @@ -225,7 +225,7 @@ }, { "key" : "A table for two please!", - "val" : "ദയവായി രണ്ട് ആള്കുള്ള ടേബിൾ വേണം !", + "val" : "ദയവായി രണ്ട് ആളുകൾക്കുള്ള ടേബിൾ വേണം !", "trn" : "Dayavaayi rand aalukalkkulla table venam" }, { From 67148ebd0cc2b8a4c6efc7988ff6ca699a0b3663 Mon Sep 17 00:00:00 2001 From: GuiltyDolphin Date: Sun, 6 Dec 2015 16:01:56 +0000 Subject: [PATCH 223/379] Add Wunderlist cheat sheet --- .../goodie/cheat_sheets/json/wunderlist.json | 84 +++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 share/goodie/cheat_sheets/json/wunderlist.json diff --git a/share/goodie/cheat_sheets/json/wunderlist.json b/share/goodie/cheat_sheets/json/wunderlist.json new file mode 100644 index 000000000..b91fb941c --- /dev/null +++ b/share/goodie/cheat_sheets/json/wunderlist.json @@ -0,0 +1,84 @@ +{ + "id": "wunderlist_cheat_sheet", + "name": "Wunderlist", + "description": "To-do list manager", + "metadata": { + "sourceName": "Wunderlist Support Center", + "sourceURL": "https://support.wunderlist.com/customer/en/portal/articles/889536-shortcuts" + }, + "template_type": "keyboard", + "section_order": [ + "To-dos and Lists", + "Copy and pasting", + "Searching", + "Navigation", + "Syncing" + ], + "sections": { + "To-dos and Lists": [{ + "val": "Add a New To-do", + "key": "[Ctrl] [n]" + }, { + "val": "Add a New List", + "key": "[Ctrl] [Shift] [l]" + }, { + "val": "Mark Selected To-dos as 'Completed'", + "key": "[Ctrl] [d]" + }, { + "val": "Mark Selected To-dos as 'Starred'", + "key": "[Ctrl] [s]" + }, { + "val": "Select All To-dos", + "key": "[Ctrl] [a]" + }, { + "val": "Delete Selected List or To-do", + "key": "[Ctrl] [Backspace]" + }], + "Copy and pasting": [{ + "val": "Copy Selected To-do", + "key": "[Ctrl] [c]" + }, { + "val": "Paste To-do", + "key": "[Ctrl] [v]" + }], + "Searching": [{ + "val": "Search", + "key": "[Ctrl] [f]" + }], + "Navigation": [{ + "val": "Open Preferences", + "key": "[Ctrl] [p]" + }, { + "val": "Email List", + "key": "[Ctrl] [e]" + }, { + "val": "Show Activities", + "key": "[Ctrl] [Shift] [a]" + }, { + "val": "Open Inbox", + "key": "[Ctrl] [i]" + }, { + "val": "Open 'Assigned to Me' Smart List", + "key": "[Ctrl] [1]" + }, { + "val": "Open 'Starred' Smart List", + "key": "[Ctrl] [2]" + }, { + "val": "Open 'Today' Smart List", + "key": "[Ctrl] [3]" + }, { + "val": "Open 'Week' Smart List", + "key": "[Ctrl] [4]" + }, { + "val": "Open 'All' Smart List", + "key": "[Ctrl] [5]" + }, { + "val": "Open 'Completed' Smart List", + "key": "[Ctrl] [6]" + }], + "Syncing": [{ + "val": "Sync", + "key": "r" + }] + } +} From 4c949f31e410a3364a7e6ecb65a4e615e77ada24 Mon Sep 17 00:00:00 2001 From: JOBIN PHILIP ABRAHAM Date: Mon, 7 Dec 2015 07:47:02 +0530 Subject: [PATCH 224/379] Update openshot.json updated sourcename and desc --- share/goodie/cheat_sheets/json/openshot.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/goodie/cheat_sheets/json/openshot.json b/share/goodie/cheat_sheets/json/openshot.json index 7842424ef..3b1b8a8d1 100644 --- a/share/goodie/cheat_sheets/json/openshot.json +++ b/share/goodie/cheat_sheets/json/openshot.json @@ -1,9 +1,9 @@ { "id": "openshot_cheat_sheet", "name": "OpenShot", - "description": "Video Editor", + "description": "List of keyboard shorcuts for OpenShot video editor", "metadata": { - "sourceName": "OpenShot Users Website", + "sourceName": "OpenShot Users", "sourceUrl": "http://www.openshotusers.com/help/1.4/en/ar01s05.html" }, "template_type": "keyboard", From 594a822858c9d372fea58d2a8d263dd1718f11f0 Mon Sep 17 00:00:00 2001 From: JOBIN PHILIP ABRAHAM Date: Mon, 7 Dec 2015 08:14:24 +0530 Subject: [PATCH 225/379] Update processing-lang.json --- share/goodie/cheat_sheets/json/processing-lang.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/goodie/cheat_sheets/json/processing-lang.json b/share/goodie/cheat_sheets/json/processing-lang.json index 0b739f87a..94fa2ad6f 100644 --- a/share/goodie/cheat_sheets/json/processing-lang.json +++ b/share/goodie/cheat_sheets/json/processing-lang.json @@ -2,7 +2,7 @@ "id": "processing_lang_cheat_sheet", "name": "Processing", "metadata": { - "sourceName": "Processing.org", + "sourceName": "Processing", "sourceUrl": "https://www.processing.org/reference/" }, "template_type": "terminal", @@ -237,4 +237,4 @@ } ] } -} \ No newline at end of file +} From b0b0b9f466ac5e3df1057f26893846f6fb27d54e Mon Sep 17 00:00:00 2001 From: JOBIN PHILIP ABRAHAM Date: Mon, 7 Dec 2015 08:21:19 +0530 Subject: [PATCH 226/379] Update si-units.json --- share/goodie/cheat_sheets/json/si-units.json | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/share/goodie/cheat_sheets/json/si-units.json b/share/goodie/cheat_sheets/json/si-units.json index fd7c755c2..3ebcf5fb0 100644 --- a/share/goodie/cheat_sheets/json/si-units.json +++ b/share/goodie/cheat_sheets/json/si-units.json @@ -3,7 +3,7 @@ "name": "SI Units", - "description": "International System of Units (SI): Base/Derived quantity - Name - Symbol", + "description": "A quick reference for International System of Units (SI)", "metadata": { "sourceName": "NIST", @@ -17,14 +17,14 @@ "template_type": "reference", "section_order": [ - "SI base units", - "SI derived units", - "SI derived units with special names and symbols", - "Examples of SI derived units whose names and symbols include SI derived units with special names and symbols" + "SI Base Units", + "SI Derived Units", + "SI Derived Units with special names and symbols", + "Examples of SI Derived Units whose names and symbols include SI Derived Units with special names and symbols" ], "sections": { - "SI base units": [ + "SI Base Units": [ { "key": "length", "val": "meter (m)" @@ -54,7 +54,7 @@ "val": "candela (cd)" } ], - "SI derived units": [ + "SI Derived Units": [ { "key": "area", "val": "square meter (m²)" @@ -100,7 +100,7 @@ "val": "candela per square meter (cd/m²)" } ], - "SI derived units with special names and symbols": [ + "SI Derived Units with special names and symbols": [ { "key": "plane angle", "val": "radian (rad)" @@ -170,7 +170,7 @@ "val": "gray (Gy)" } ], - "Examples of SI derived units whose names and symbols include SI derived units with special names and symbols": [ + "Examples of SI Derived Units whose names and symbols include SI Derived Units with special names and symbols": [ { "key": "dynamic viscosity", "val": "pascal second (Pa·s)" @@ -257,4 +257,4 @@ } ] } -} \ No newline at end of file +} From 0cc9581e41586672a652d4ad983d6a417cbacfc9 Mon Sep 17 00:00:00 2001 From: hemanth Date: Mon, 7 Dec 2015 04:56:48 +0000 Subject: [PATCH 227/379] Support +ve and -ve. --- lib/DDG/Goodie/BloodDonor.pm | 7 +++++-- t/BloodDonor.t | 9 +++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/lib/DDG/Goodie/BloodDonor.pm b/lib/DDG/Goodie/BloodDonor.pm index 0908baf1e..202e27fc5 100755 --- a/lib/DDG/Goodie/BloodDonor.pm +++ b/lib/DDG/Goodie/BloodDonor.pm @@ -32,7 +32,7 @@ my %typeMap = ( handle remainder => sub { - return unless ($_ =~ /^(O|A|B|AB)(\-|\+)$/i); + return unless ($_ =~ /^(O|A|B|AB)((\-|\+)|(\-ve|\+ve))$/i); my $type = uc $1; my $rh = $2; @@ -48,6 +48,9 @@ handle remainder => sub { if($rh eq '+') { # only when access to same Rh is impossible push(@criticalResults, $donorType . '-'); + } + if($rh eq '+ve') { + push(@criticalResults, $donorType . '-ve'); } } @@ -60,7 +63,7 @@ handle remainder => sub { ); my @record_keys = ("Ideal donor", "Other donors"); - if($rh eq '+') { + if($rh eq '+ve' || $rh eq '+') { push @record_keys,"Only if no Rh(+) found"; $record_data{"Only if no Rh(+) found"} = $criticalStr; } diff --git a/t/BloodDonor.t b/t/BloodDonor.t index ed60437ae..8e906d9bf 100755 --- a/t/BloodDonor.t +++ b/t/BloodDonor.t @@ -80,6 +80,15 @@ ddg_goodie_test( ["Ideal donor", "Other donors", "Only if no Rh(+) found"] ) ), + 'donor o+ve' => test_zci("Ideal donor: O+VE\nOther donors: O+ve\nOnly if no Rh(+) found: O-ve", + structured_answer => build_structure("O+VE",{ + "Ideal donor" => "O+VE", + "Other donors" => "O+ve", + "Only if no Rh(+) found" => "O-ve" + }, + ["Ideal donor", "Other donors", "Only if no Rh(+) found"] + ) + ), ); done_testing; From 3878448edddf7fb5d48a4071e30436808ab63bf3 Mon Sep 17 00:00:00 2001 From: GuiltyDolphin Date: Mon, 7 Dec 2015 13:04:13 +0000 Subject: [PATCH 228/379] Update sourceName and description --- share/goodie/cheat_sheets/json/wunderlist.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/goodie/cheat_sheets/json/wunderlist.json b/share/goodie/cheat_sheets/json/wunderlist.json index b91fb941c..fe08f9080 100644 --- a/share/goodie/cheat_sheets/json/wunderlist.json +++ b/share/goodie/cheat_sheets/json/wunderlist.json @@ -1,9 +1,9 @@ { "id": "wunderlist_cheat_sheet", "name": "Wunderlist", - "description": "To-do list manager", + "description": "Keyboard shortcuts for the Wunderlist to-do list manager", "metadata": { - "sourceName": "Wunderlist Support Center", + "sourceName": "Wunderlist", "sourceURL": "https://support.wunderlist.com/customer/en/portal/articles/889536-shortcuts" }, "template_type": "keyboard", From 5d435334faf24fdfe6be282f8ba8f70af885d16a Mon Sep 17 00:00:00 2001 From: mohan08p Date: Mon, 7 Dec 2015 14:00:49 +0000 Subject: [PATCH 229/379] Corrected the field --- share/goodie/cheat_sheets/json/language/malayalam.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/goodie/cheat_sheets/json/language/malayalam.json b/share/goodie/cheat_sheets/json/language/malayalam.json index 0f9a194f2..44d028f41 100644 --- a/share/goodie/cheat_sheets/json/language/malayalam.json +++ b/share/goodie/cheat_sheets/json/language/malayalam.json @@ -49,7 +49,7 @@ "Getting Help" : [ { "key" : "Call the police!", - "val" : "പൊലീസിനെ വിളിക്കുക !", + "val" : "പൊലീസിനെ വിളിക്കൂ !", "trn" : "Polisine viliku!" }, { From 092000e1739701ed713eaf1ef1dccb54c16ae901 Mon Sep 17 00:00:00 2001 From: mohan08p Date: Mon, 7 Dec 2015 14:08:45 +0000 Subject: [PATCH 230/379] fields been updated. --- share/goodie/cheat_sheets/json/mongodb.json | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/share/goodie/cheat_sheets/json/mongodb.json b/share/goodie/cheat_sheets/json/mongodb.json index ba074a026..a589e1f88 100644 --- a/share/goodie/cheat_sheets/json/mongodb.json +++ b/share/goodie/cheat_sheets/json/mongodb.json @@ -4,13 +4,12 @@ "templete_type": "code", "description": "Mongo shell", "metadata": { - "sourceName": "MongoDB - Cheat Sheet", + "sourceName": "Codecentric", "sourceUrl": "https://blog.codecentric.de/files/2012/12/MongoDB-CheatSheet-v1_0.pdf" }, "aliases": [ "mongodb", "mongo db", - "mongodb commands", "mongo db shell" ], "template_type": "terminal", @@ -35,7 +34,7 @@ "Basic Conceptes & Shell Commands": [ { "key": "db.collection.", - "val": "db – implicit handle to the used database, collection – name of the used collection" + "val": "Db – implicit handle to the used database, collection – name of the used collection" }, { "key": "use ", @@ -145,21 +144,21 @@ }, { "key": "db.collection.update(\\{key:value\\},\\{$set : \\{operator:opt, class:c\\}\\})", - "val": "sets / changes certain attributes of a given document" + "val": "Sets / changes certain attributes of a given document" }, { "key": "db.collection.update(\\{key:value\\},\\{$unset : \\{operator : 1\\}\\})", - "val": "removes an attribute from a given document" + "val": "Removes an attribute from a given document" } ], "Removing Documents": [ { "key": "db.collection.remove(\\{key:value\\})", - "val": "removes the document" + "val": "Removes the document" }, { "key": "db.collection.remove(\\{key:\\{$regex:’^USS\\sE’\\}\\})", - "val": "removes using operator" + "val": "Removes using operator" } ], "Working with Indexes": [ From 48e6f4e5c7528515d73bf8a3e80e011ed785a4d0 Mon Sep 17 00:00:00 2001 From: Zac Pappis Date: Mon, 7 Dec 2015 09:19:18 -0500 Subject: [PATCH 231/379] Update CONTRIBUTING.md --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 885c3d858..ae5e5eae7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -51,7 +51,7 @@ We've made sure to identify these throughout our repositories for new contributo **2. Dive in** -Go ahead and comment on any issues you're interested in helping with. Let us know what you're thinking and if you'd like any help or guidance. +Go ahead and **comment on any issues you're interested in helping with.** Let us know what you're thinking and if you'd like any help or guidance. As always, feel free to [ask us anything](mailto:open@duckduckgo.com), and don't forget the handy [Instant Answer documentation](https://duck.co/duckduckhack/ddh-intro). From d46824d3025a614b4ea9f512a0abb1d66054976c Mon Sep 17 00:00:00 2001 From: GuiltyDolphin Date: Mon, 7 Dec 2015 15:30:14 +0000 Subject: [PATCH 232/379] Update section phrasing --- share/goodie/cheat_sheets/json/wunderlist.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/goodie/cheat_sheets/json/wunderlist.json b/share/goodie/cheat_sheets/json/wunderlist.json index fe08f9080..92daf021f 100644 --- a/share/goodie/cheat_sheets/json/wunderlist.json +++ b/share/goodie/cheat_sheets/json/wunderlist.json @@ -9,7 +9,7 @@ "template_type": "keyboard", "section_order": [ "To-dos and Lists", - "Copy and pasting", + "Copying and Pasting", "Searching", "Navigation", "Syncing" @@ -34,7 +34,7 @@ "val": "Delete Selected List or To-do", "key": "[Ctrl] [Backspace]" }], - "Copy and pasting": [{ + "Copying and Pasting": [{ "val": "Copy Selected To-do", "key": "[Ctrl] [c]" }, { From 5b3b5b41a8f4c73acbe0568fc3dd50b1ed4cff1d Mon Sep 17 00:00:00 2001 From: Mailkov Date: Mon, 7 Dec 2015 18:24:02 +0000 Subject: [PATCH 233/379] Issue #1163 - add rms as root mean square on Average --- lib/DDG/Goodie/Average.pm | 4 ++-- t/Average.t | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/DDG/Goodie/Average.pm b/lib/DDG/Goodie/Average.pm index 5215d838f..7aaca89a4 100644 --- a/lib/DDG/Goodie/Average.pm +++ b/lib/DDG/Goodie/Average.pm @@ -4,7 +4,7 @@ package DDG::Goodie::Average; use strict; use DDG::Goodie; -triggers startend => "avg", "average", "mean", "median", "root mean square"; +triggers startend => "avg", "average", "mean", "median", "root mean square", "rms"; zci is_cached => 1; zci answer_type => "average"; @@ -27,7 +27,7 @@ handle remainder => sub { my $query = $req->query_lc; my $type; - if ($query =~ m/root mean square/) { + if ($query =~ m/root mean square|rms/) { $type = "Root Mean Square"; } elsif ($query =~ m/avg|average|mean/) { $type = "Mean"; diff --git a/t/Average.t b/t/Average.t index d6ffef29d..15fe9e2a7 100644 --- a/t/Average.t +++ b/t/Average.t @@ -36,6 +36,14 @@ ddg_goodie_test( result => '2.16024689946929', } ), + 'rms 1,2,3' => test_zci( + "Root Mean Square: 2.16024689946929", + structured_answer => { + input => ['1 2 3'], + operation => "Root Mean Square of", + result => '2.16024689946929', + } + ), "average 12 45 78 1234.12" => test_zci( "Mean: 342.28", structured_answer => { From 7d8c3fbaba6bf7516e68ad7104492287b21a127b Mon Sep 17 00:00:00 2001 From: Salil Kapur Date: Mon, 7 Dec 2015 18:57:21 +0000 Subject: [PATCH 234/379] Default Port Numbers cheatsheet --- .../json/default-port-numbers.json | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 share/goodie/cheat_sheets/json/default-port-numbers.json diff --git a/share/goodie/cheat_sheets/json/default-port-numbers.json b/share/goodie/cheat_sheets/json/default-port-numbers.json new file mode 100644 index 000000000..9756e15f3 --- /dev/null +++ b/share/goodie/cheat_sheets/json/default-port-numbers.json @@ -0,0 +1,50 @@ +{ + "id": "default_port_numbers", + "name": "Default Port Numbers", + "description": "Default port numbers in networking", + "metadata": { + "sourceName": "Wikipedia", + "sourceUrl": "https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers" + }, + + "aliases": [ + "default port numbers", "default port", + ], + "template_type": "keyboard", + "section_order": [ + "Default Port Numbers" + ], + "sections": { + "Default Port Numbers": [{ + "val": "FTP Data Transfer", + "key": "20" + }, { + "val": "FTP control (command)", + "key": "21" + }, { + "val": "Secure Shell (SSH)" + "key": "22" + }, { + "val": "Telnet Protocol", + "key": "23" + }, { + "val": "Simple Mail Transfer Protocol", + "key": "25" + }, { + "val": "Domain Name System (DNS)", + "key": "53" + }, { + "val": "Hypertext Transfer Protocol (HTTP)", + "key": "80" + }, { + "val": "Internet Message Access Protocol", + "key": "143" + }, { + "val": "Hypertext Transfer Protocol over TLS/SSL (HTTPS)", + "key": "443" + }, { + "val": "Remote Procedure Call (RPC)", + "key": "530" + }] + } +} From 9703ce194f50d78d3974cada1f9111e7de8571c6 Mon Sep 17 00:00:00 2001 From: Salil Kapur Date: Mon, 7 Dec 2015 19:07:45 +0000 Subject: [PATCH 235/379] Minor Fix --- share/goodie/cheat_sheets/json/default-port-numbers.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/goodie/cheat_sheets/json/default-port-numbers.json b/share/goodie/cheat_sheets/json/default-port-numbers.json index 9756e15f3..f586b0a9e 100644 --- a/share/goodie/cheat_sheets/json/default-port-numbers.json +++ b/share/goodie/cheat_sheets/json/default-port-numbers.json @@ -8,7 +8,7 @@ }, "aliases": [ - "default port numbers", "default port", + "default port numbers", "default port" ], "template_type": "keyboard", "section_order": [ From 08bb72cb1681be1feb6d674dfcd339c7f86f8368 Mon Sep 17 00:00:00 2001 From: Salil Kapur Date: Mon, 7 Dec 2015 19:21:53 +0000 Subject: [PATCH 236/379] New port added --- share/goodie/cheat_sheets/json/default-port-numbers.json | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/share/goodie/cheat_sheets/json/default-port-numbers.json b/share/goodie/cheat_sheets/json/default-port-numbers.json index f586b0a9e..4245b3951 100644 --- a/share/goodie/cheat_sheets/json/default-port-numbers.json +++ b/share/goodie/cheat_sheets/json/default-port-numbers.json @@ -22,7 +22,7 @@ "val": "FTP control (command)", "key": "21" }, { - "val": "Secure Shell (SSH)" + "val": "Secure Shell (SSH)", "key": "22" }, { "val": "Telnet Protocol", @@ -45,6 +45,9 @@ }, { "val": "Remote Procedure Call (RPC)", "key": "530" - }] + }, { + "val": "Telent Protocol over TLS/SSL", + "key": "992" + }] } } From e868f70421caf1e3153b4f303fbf0ee4c239db9b Mon Sep 17 00:00:00 2001 From: Salil Kapur Date: Mon, 7 Dec 2015 19:35:55 +0000 Subject: [PATCH 237/379] DHCP port added --- share/goodie/cheat_sheets/json/default-port-numbers.json | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/share/goodie/cheat_sheets/json/default-port-numbers.json b/share/goodie/cheat_sheets/json/default-port-numbers.json index 4245b3951..0aa7e22fa 100644 --- a/share/goodie/cheat_sheets/json/default-port-numbers.json +++ b/share/goodie/cheat_sheets/json/default-port-numbers.json @@ -8,7 +8,7 @@ }, "aliases": [ - "default port numbers", "default port" + "default port numbers", "default port", "default port number", "netowrk ports" ], "template_type": "keyboard", "section_order": [ @@ -34,6 +34,12 @@ "val": "Domain Name System (DNS)", "key": "53" }, { + "val": "Dynamic Host Configuration Protocol (DHCP) Server", + "key": "67" + }, { + "val": "Dynamic Host Configuration Protocol (DHCP) Client", + "key": "68" + }, { "val": "Hypertext Transfer Protocol (HTTP)", "key": "80" }, { From 033dfbb3ad4369ea103628301610e8d9780049b9 Mon Sep 17 00:00:00 2001 From: Salil Kapur Date: Tue, 8 Dec 2015 11:39:24 +0530 Subject: [PATCH 238/379] id changed and indentation fixed --- .../json/default-port-numbers.json | 27 +++++++++---------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/share/goodie/cheat_sheets/json/default-port-numbers.json b/share/goodie/cheat_sheets/json/default-port-numbers.json index 0aa7e22fa..4da2bb371 100644 --- a/share/goodie/cheat_sheets/json/default-port-numbers.json +++ b/share/goodie/cheat_sheets/json/default-port-numbers.json @@ -1,15 +1,14 @@ { - "id": "default_port_numbers", + "id": "default_port_numbers_cheat_sheet", "name": "Default Port Numbers", "description": "Default port numbers in networking", "metadata": { "sourceName": "Wikipedia", "sourceUrl": "https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers" }, - - "aliases": [ - "default port numbers", "default port", "default port number", "netowrk ports" - ], + "aliases": [ + "default port", "default port number", "netowrk ports" + ], "template_type": "keyboard", "section_order": [ "Default Port Numbers" @@ -34,12 +33,12 @@ "val": "Domain Name System (DNS)", "key": "53" }, { - "val": "Dynamic Host Configuration Protocol (DHCP) Server", - "key": "67" - }, { - "val": "Dynamic Host Configuration Protocol (DHCP) Client", - "key": "68" - }, { + "val": "Dynamic Host Configuration Protocol (DHCP) Server", + "key": "67" + }, { + "val": "Dynamic Host Configuration Protocol (DHCP) Client", + "key": "68" + }, { "val": "Hypertext Transfer Protocol (HTTP)", "key": "80" }, { @@ -52,8 +51,8 @@ "val": "Remote Procedure Call (RPC)", "key": "530" }, { - "val": "Telent Protocol over TLS/SSL", - "key": "992" - }] + "val": "Telent Protocol over TLS/SSL", + "key": "992" + }] } } From a1c59c7dc2ec56b028eb295b01a5c5c55b738b88 Mon Sep 17 00:00:00 2001 From: Salil Kapur Date: Tue, 8 Dec 2015 14:19:44 +0530 Subject: [PATCH 239/379] New section added. Typos corrected --- .../json/default-port-numbers.json | 42 +++++++++++++------ 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/share/goodie/cheat_sheets/json/default-port-numbers.json b/share/goodie/cheat_sheets/json/default-port-numbers.json index 4da2bb371..1c1ed7116 100644 --- a/share/goodie/cheat_sheets/json/default-port-numbers.json +++ b/share/goodie/cheat_sheets/json/default-port-numbers.json @@ -1,20 +1,20 @@ { "id": "default_port_numbers_cheat_sheet", "name": "Default Port Numbers", - "description": "Default port numbers in networking", + "description": "List of port numbers used in computer networks", "metadata": { "sourceName": "Wikipedia", "sourceUrl": "https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers" }, "aliases": [ - "default port", "default port number", "netowrk ports" + "default port", "default port number", "network ports" ], "template_type": "keyboard", "section_order": [ - "Default Port Numbers" + "Well Known Protocols", "Registered Protocols" ], "sections": { - "Default Port Numbers": [{ + "Well Known Protocols": [{ "val": "FTP Data Transfer", "key": "20" }, { @@ -33,12 +33,12 @@ "val": "Domain Name System (DNS)", "key": "53" }, { - "val": "Dynamic Host Configuration Protocol (DHCP) Server", - "key": "67" - }, { - "val": "Dynamic Host Configuration Protocol (DHCP) Client", - "key": "68" - }, { + "val": "Dynamic Host Configuration Protocol (DHCP) Server", + "key": "67" + }, { + "val": "Dynamic Host Configuration Protocol (DHCP) Client", + "key": "68" + }, { "val": "Hypertext Transfer Protocol (HTTP)", "key": "80" }, { @@ -51,8 +51,24 @@ "val": "Remote Procedure Call (RPC)", "key": "530" }, { - "val": "Telent Protocol over TLS/SSL", - "key": "992" - }] + "val": "Telnet Protocol over TLS/SSL", + "key": "992" + }], + "Registered Protocols": [{ + "val": "SOCKS Proxy", + "key": "1080" + }, { + "val": "OpenVPN", + "key": "1194" + }, { + "val": "Internet Protocol Security (IPSec)", + "key": "1293" + }, { + "val": "Real-time Transport Protocol media data (RTP)", + "key": "5004" + }, { + "val": "Real-time Transport Protocol control protocol (RTCP)", + "key": "5005" + }] } } From fa2640438d77f0430df57b1a36929daac0c26bb3 Mon Sep 17 00:00:00 2001 From: Salil Kapur Date: Tue, 8 Dec 2015 14:21:28 +0530 Subject: [PATCH 240/379] removed default port number from alias --- share/goodie/cheat_sheets/json/default-port-numbers.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/goodie/cheat_sheets/json/default-port-numbers.json b/share/goodie/cheat_sheets/json/default-port-numbers.json index 1c1ed7116..d00f365a7 100644 --- a/share/goodie/cheat_sheets/json/default-port-numbers.json +++ b/share/goodie/cheat_sheets/json/default-port-numbers.json @@ -7,7 +7,7 @@ "sourceUrl": "https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers" }, "aliases": [ - "default port", "default port number", "network ports" + "default port", "network ports" ], "template_type": "keyboard", "section_order": [ From 3bf95d0369e415e5eecfca5adb0d335ef815074b Mon Sep 17 00:00:00 2001 From: Justforahorror Date: Tue, 8 Dec 2015 14:59:13 +0530 Subject: [PATCH 241/379] Update toontown.json updated name,aliases and source name --- share/goodie/cheat_sheets/json/toontown.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/share/goodie/cheat_sheets/json/toontown.json b/share/goodie/cheat_sheets/json/toontown.json index 96e495c20..1d1ccad3e 100644 --- a/share/goodie/cheat_sheets/json/toontown.json +++ b/share/goodie/cheat_sheets/json/toontown.json @@ -1,12 +1,12 @@ { "id": "toontown_cheat_sheet", - "name": "Toontown Commands Cheet Sheet", + "name": "Toontown", "description": "Commands For the Toontown Private Servers", "aliases": [ - "toontown mod", "toontown commands", "toontown mod commands", "tto mod commands", "tto commands" + "toontown mod", "tto" ], "metadata" : { - "sourceName" : "Toontown Online Wiki", + "sourceName" : "Wikipedia", "sourceUrl" : "https://wikipedia.org/wiki/Toontown_Online" }, From 8ed68e1dd5003a6d63fb3d2998ec649b19599ce3 Mon Sep 17 00:00:00 2001 From: Justforahorror Date: Tue, 8 Dec 2015 15:01:51 +0530 Subject: [PATCH 242/379] Update toontown.json --- share/goodie/cheat_sheets/json/toontown.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/goodie/cheat_sheets/json/toontown.json b/share/goodie/cheat_sheets/json/toontown.json index 1d1ccad3e..9642f5469 100644 --- a/share/goodie/cheat_sheets/json/toontown.json +++ b/share/goodie/cheat_sheets/json/toontown.json @@ -3,7 +3,7 @@ "name": "Toontown", "description": "Commands For the Toontown Private Servers", "aliases": [ - "toontown mod", "tto" + "toontown mod", "tto", "tto mod" ], "metadata" : { "sourceName" : "Wikipedia", From af47c98f715183aca58edfb627170421006b7238 Mon Sep 17 00:00:00 2001 From: Salil Kapur Date: Tue, 8 Dec 2015 11:15:08 +0000 Subject: [PATCH 243/379] Indentation fixed --- .../json/default-port-numbers.json | 52 +++++++++---------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/share/goodie/cheat_sheets/json/default-port-numbers.json b/share/goodie/cheat_sheets/json/default-port-numbers.json index d00f365a7..fdafe38e5 100644 --- a/share/goodie/cheat_sheets/json/default-port-numbers.json +++ b/share/goodie/cheat_sheets/json/default-port-numbers.json @@ -7,7 +7,7 @@ "sourceUrl": "https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers" }, "aliases": [ - "default port", "network ports" + "default port", "network ports" ], "template_type": "keyboard", "section_order": [ @@ -33,12 +33,12 @@ "val": "Domain Name System (DNS)", "key": "53" }, { - "val": "Dynamic Host Configuration Protocol (DHCP) Server", - "key": "67" - }, { - "val": "Dynamic Host Configuration Protocol (DHCP) Client", - "key": "68" - }, { + "val": "Dynamic Host Configuration Protocol (DHCP) Server", + "key": "67" + }, { + "val": "Dynamic Host Configuration Protocol (DHCP) Client", + "key": "68" + }, { "val": "Hypertext Transfer Protocol (HTTP)", "key": "80" }, { @@ -51,24 +51,24 @@ "val": "Remote Procedure Call (RPC)", "key": "530" }, { - "val": "Telnet Protocol over TLS/SSL", - "key": "992" - }], - "Registered Protocols": [{ - "val": "SOCKS Proxy", - "key": "1080" - }, { - "val": "OpenVPN", - "key": "1194" - }, { - "val": "Internet Protocol Security (IPSec)", - "key": "1293" - }, { - "val": "Real-time Transport Protocol media data (RTP)", - "key": "5004" - }, { - "val": "Real-time Transport Protocol control protocol (RTCP)", - "key": "5005" - }] + "val": "Telnet Protocol over TLS/SSL", + "key": "992" + }], + "Registered Protocols": [{ + "val": "SOCKS Proxy", + "key": "1080" + }, { + "val": "OpenVPN", + "key": "1194" + }, { + "val": "Internet Protocol Security (IPSec)", + "key": "1293" + }, { + "val": "Real-time Transport Protocol media data (RTP)", + "key": "5004" + }, { + "val": "Real-time Transport Protocol control protocol (RTCP)", + "key": "5005" + }] } } From fe8b5d71b2f415410505d16a00b904f079bdc4e4 Mon Sep 17 00:00:00 2001 From: marianosimone Date: Tue, 8 Dec 2015 18:07:20 +0000 Subject: [PATCH 244/379] only return Unicode match result when there is a match fixes #1430 --- lib/DDG/Goodie/Unicode.pm | 3 ++- t/Unicode.t | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/DDG/Goodie/Unicode.pm b/lib/DDG/Goodie/Unicode.pm index 8077c9f31..6e21198dc 100644 --- a/lib/DDG/Goodie/Unicode.pm +++ b/lib/DDG/Goodie/Unicode.pm @@ -41,7 +41,8 @@ handle sub { # Search term starts with "unicode " if ($term =~ UNICODE_RE) { - return unicode_lookup($1); + return unless my $result = unicode_lookup($1); + return $result; } return codepoint_description($term); diff --git a/t/Unicode.t b/t/Unicode.t index 3239cbbbb..bab277f8a 100644 --- a/t/Unicode.t +++ b/t/Unicode.t @@ -30,6 +30,8 @@ ddg_goodie_test( 'unicode white smiling face' => test_zci("\x{263A} U+263A WHITE SMILING FACE, decimal: 9786, HTML: ☺, UTF-8: 0xE2 0x98 0xBA, block: Miscellaneous Symbols"), '\x{2764}' => test_zci("\x{2764} U+2764 HEAVY BLACK HEART, decimal: 10084, HTML: ❤, UTF-8: 0xE2 0x9D 0xA4, block: Dingbats"), + + 'unicode unknown' => undef ); done_testing; From a6573a7b2c8c2d7178a9414a84436533055c0764 Mon Sep 17 00:00:00 2001 From: Ben Moon Date: Tue, 8 Dec 2015 19:17:52 +0000 Subject: [PATCH 245/379] Fix issue #1694 Fixes issue with expressions such as `1 + 2e-7` treating `e` as the mathematical constant rather than `* 10 ^`. --- lib/DDG/Goodie/Calculator.pm | 6 +++--- t/Calculator.t | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/lib/DDG/Goodie/Calculator.pm b/lib/DDG/Goodie/Calculator.pm index a1a8acfef..7e6899109 100644 --- a/lib/DDG/Goodie/Calculator.pm +++ b/lib/DDG/Goodie/Calculator.pm @@ -91,7 +91,7 @@ handle query_nowhitespace => sub { # Grab expression. my $tmp_expr = spacing($query, 1); - + return if $tmp_expr eq $query; # If it didn't get spaced out, there are no operations to be done. @@ -102,7 +102,7 @@ handle query_nowhitespace => sub { } $tmp_expr =~ s#log[_]?(\d{1,3})#(1/log($1))*log#xg; # Arbitrary base logs. - $tmp_expr =~ s/ (\d+?)E(-?\d+)([^\d]|\b) /\($1 * 10**$2\)$3/xg; # E == *10^n + $tmp_expr =~ s/ (\d+?)E(-?\d+)([^\d]|\b) /\($1 * 10**$2\)$3/ixg; # E == *10^n $tmp_expr =~ s/\$//g; # Remove $s. $tmp_expr =~ s/=$//; # Drop =. $tmp_expr =~ s/([0-9])\s*([a-zA-Z])([^0-9])/$1*$2$3/g; # Support 0.5e or 0.5pi; but don't break 1e8 @@ -179,7 +179,7 @@ sub spacing { my ($text, $space_for_parse) = @_; $text =~ s/\s{2,}/ /g; - $text =~ s/(\s*(? qr/>400,001 test_zci( + '(3 * 10 ^- 2) * 9 = 0.27', + heading => 'Calculator', + structured_answer => { + input => ['(3 * 10 ^- 2) * 9'], + operation => 'Calculate', + result => qr/>0.27 test_zci( + '(7 * 10 ^- 4) * 8 = 0.0056', + heading => 'Calculator', + structured_answer => { + input => ['(7 * 10 ^- 4) * 8'], + operation => 'Calculate', + result => qr/>0.0056 test_zci( 'pi / (1 * 10 ^ 9) = 3.14159265358979 * 10^-9', heading => 'Calculator', From e4865eb3cbaf6fb9e8bfa3bd729782fbcb689b02 Mon Sep 17 00:00:00 2001 From: Ben Moon Date: Tue, 8 Dec 2015 20:16:18 +0000 Subject: [PATCH 246/379] Improve test coverage --- t/Calculator.t | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/t/Calculator.t b/t/Calculator.t index 45dd2d0bf..752c2217e 100644 --- a/t/Calculator.t +++ b/t/Calculator.t @@ -723,6 +723,24 @@ ddg_goodie_test( result => qr/>0.0056 test_zci( + '6 * (2 * 10 ^- 11) = 1.2 * 10^-10', + heading => 'Calculator', + structured_answer => { + input => ['6 * (2 * 10 ^- 11)'], + operation => 'Calculate', + result => qr/>1\.2 \* 10-10<\/sup> test_zci( + '7 + (7 * 10 ^- 7) = 7.0000007', + heading => 'Calculator', + structured_answer => { + input => ['7 + (7 * 10 ^- 7)'], + operation => 'Calculate', + result => qr/>7.0000007 test_zci( 'pi / (1 * 10 ^ 9) = 3.14159265358979 * 10^-9', heading => 'Calculator', From e7b1b393835005f5bfc4d0521e92253cc82c3444 Mon Sep 17 00:00:00 2001 From: tagawa Date: Wed, 9 Dec 2015 00:47:49 +0000 Subject: [PATCH 247/379] OSX cheatsheet: Added screenshot and screen lock shortcuts --- share/goodie/cheat_sheets/json/apple-mac-os.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/share/goodie/cheat_sheets/json/apple-mac-os.json b/share/goodie/cheat_sheets/json/apple-mac-os.json index e9d481394..31d82fe3c 100644 --- a/share/goodie/cheat_sheets/json/apple-mac-os.json +++ b/share/goodie/cheat_sheets/json/apple-mac-os.json @@ -56,6 +56,14 @@ { "key": "[⌘] [Opt] [Esc]", "val": "Open force quit dialog" + }, + { + "key": "[⌘] [Shift] [3]", + "val": "Take a screenshot (saved in Desktop)" + }, + { + "key": "[Ctrl] [Shift] [⌽ (Power)]", + "val": "Lock the screen" } ], "Finder": [ From 00581ee67a8487ae75182d882a5c88a253cc70c9 Mon Sep 17 00:00:00 2001 From: mohan08p Date: Wed, 9 Dec 2015 07:56:13 +0000 Subject: [PATCH 248/379] balanced parenthesis --- share/goodie/cheat_sheets/json/mongodb.json | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/share/goodie/cheat_sheets/json/mongodb.json b/share/goodie/cheat_sheets/json/mongodb.json index fe7c1f555..452411dbc 100644 --- a/share/goodie/cheat_sheets/json/mongodb.json +++ b/share/goodie/cheat_sheets/json/mongodb.json @@ -8,9 +8,9 @@ "sourceUrl": "https://blog.codecentric.de/files/2012/12/MongoDB-CheatSheet-v1_0.pdf" }, "aliases": [ - "mongodb", "mongo db", - "mongo db shell" + "mongo db shell", + "mongodb commands" ], "section_order": [ "Basic Conceptes & Shell Commands", @@ -340,4 +340,5 @@ "val": "Basically as same as above." } ] - } \ No newline at end of file + } +} \ No newline at end of file From 341d2cb47a0615eaba715350c13293c57497f7ff Mon Sep 17 00:00:00 2001 From: mohan08p Date: Wed, 9 Dec 2015 08:15:21 +0000 Subject: [PATCH 249/379] More native fields corrected. --- share/goodie/cheat_sheets/json/language/malayalam.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/goodie/cheat_sheets/json/language/malayalam.json b/share/goodie/cheat_sheets/json/language/malayalam.json index 44d028f41..a7a083467 100644 --- a/share/goodie/cheat_sheets/json/language/malayalam.json +++ b/share/goodie/cheat_sheets/json/language/malayalam.json @@ -200,7 +200,7 @@ }, { "key" : "I am allergic", - "val" : "എനിക്ക് അലെർഗി ഉണ്ട് ", + "val" : "എനിക്ക് അലെർജി ഉണ്ട് ", "trn" : "Enik alergy und" }, { From af8e341654a44bec5559bb54777ef745a2ba8528 Mon Sep 17 00:00:00 2001 From: mohan08p Date: Wed, 9 Dec 2015 15:33:24 +0000 Subject: [PATCH 250/379] alise fields updated. --- share/goodie/cheat_sheets/json/mongodb.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/goodie/cheat_sheets/json/mongodb.json b/share/goodie/cheat_sheets/json/mongodb.json index 452411dbc..e4babe327 100644 --- a/share/goodie/cheat_sheets/json/mongodb.json +++ b/share/goodie/cheat_sheets/json/mongodb.json @@ -10,7 +10,7 @@ "aliases": [ "mongo db", "mongo db shell", - "mongodb commands" + "MongoDB" ], "section_order": [ "Basic Conceptes & Shell Commands", From 204de9cb2e16d157e6d91d6b772fe3a6ae7b32b3 Mon Sep 17 00:00:00 2001 From: Ben Moon Date: Wed, 9 Dec 2015 15:47:10 +0000 Subject: [PATCH 251/379] Fix spacing around minus sign Previous fix introduced a small bug with spacing: things like `1 + e - 3` were being expanded to `1 + e-3`. This fixes the expansion. --- lib/DDG/Goodie/Calculator.pm | 2 +- t/Calculator.t | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/lib/DDG/Goodie/Calculator.pm b/lib/DDG/Goodie/Calculator.pm index 7e6899109..3ef26eb9e 100644 --- a/lib/DDG/Goodie/Calculator.pm +++ b/lib/DDG/Goodie/Calculator.pm @@ -179,7 +179,7 @@ sub spacing { my ($text, $space_for_parse) = @_; $text =~ s/\s{2,}/ /g; - $text =~ s/(\s*(? qr/>7.0000007 test_zci( + '1 * 7 + e - 7 = 2.71828182845905', + heading => 'Calculator', + structured_answer => { + input => ['1 * 7 + e - 7'], + operation => 'Calculate', + result => qr/>2.71828182845905 test_zci( + '7 * e - 5 = 14.0279727992134', + heading => 'Calculator', + structured_answer => { + input => ['7 * e - 5'], + operation => 'Calculate', + result => qr/>14.0279727992134 test_zci( 'pi / (1 * 10 ^ 9) = 3.14159265358979 * 10^-9', heading => 'Calculator', From c10c77acc2fa7b4d84a3a31a94b11abbfa33ea80 Mon Sep 17 00:00:00 2001 From: pratik-nagelia Date: Wed, 9 Dec 2015 19:44:34 +0000 Subject: [PATCH 252/379] new perl cheat sheet --- share/goodie/cheat_sheets/json/perl.json | 224 +++++++++++++++++++++++ 1 file changed, 224 insertions(+) create mode 100644 share/goodie/cheat_sheets/json/perl.json diff --git a/share/goodie/cheat_sheets/json/perl.json b/share/goodie/cheat_sheets/json/perl.json new file mode 100644 index 000000000..9f7e46208 --- /dev/null +++ b/share/goodie/cheat_sheets/json/perl.json @@ -0,0 +1,224 @@ +{ + "id": "perl_cheat_sheet", + "name": "Perl", + "description": "Perl Cheat Sheet", + "metadata": { + "sourceName": "Cheatography", + "sourceUrl": "http://www.cheatography.com/mishin/cheat-sheets/perl-reference-card/" + }, + "aliases": [ + "perl", "perl cheat sheet", "perl cheatsheet" + ], + "template_type": "code", + "section_order": ["Input/Output", "Scalars and Strings", "Arrays and Lists", "Hashes", "Basic Syntax", "References and Data Structures", "System Interaction"], + "sections": { + "Input/Output": [{ + "val": "Open file for input", + "key": "open(INFILE,\"in.txt\") or die;" + }, { + "val": "Open file with encoding", + "key": "open(INFILE,\"<:utf8\",\"file\");" + }, { + "val": "Open anonymous temp file", + "key": "open(TMP,\"+>\", undef);" + }, { + "val": "Open output file", + "key": "open(OUT,\">out.txt\") or die;" + }, { + "val": "Open file for append", + "key": "open(LOG,\">>my.log\") or die;" + }, { + "val": "Get next line", + "key": "$line = ;" + }, { + "val": "Slurp infile", + "key": "@lines = ;" + }, { + "val": "Print to STDERR", + "key": "print STDERR \"Warning 1.\\n\";" + }, { + "val": "Close filehandle", + "key": "close INFILE;" + }], + "Scalars and Strings": [{ + "val": "Discard trailing \\n", + "key": "chomp($str);" + }, { + "val": "$v becomes trailing char", + "key": "$v = chop($str);" + }, { + "val": "String comparison", + "key": "eq, ne, lt, gt, le, ge, cmp" + }, { + "val": "Find index of $x in $str,", + "key": "$v = index($str, $x);" + }, { + "val": "Starting from left or right", + "key": "$v = rindex($str, $x);" + }, { + "val": "Extract substring", + "key": "$v = substr($str, $strt, $len);" + }, { + "val": "Count the digits in $sky", + "key": "$cnt = $sky =~ tr\/0-9\/\/;" + }, { + "val": "Change non-alphas to space", + "key": "$str =~ tr\/a-zA-Z\/\/cs;" + }, { + "val": "Format string", + "key": "$v = sprintf(“%10s %08d”,$s,$n);" + }], + "Arrays and Lists": [{ + "val": "Array initialization", + "key": "@a = (1..5);" + }, { + "val": "Number of elements in @a", + "key": "$i = @a;" + }, { + "val": "Swap $a and $b", + "key": "($a, $b) = ($b, $a);" + }, { + "val": "Access to index 1", + "key": "$x = $a\\[1\\];" + }, { + "val": "Last index in @a", + "key": "$i = $#a;" + }, { + "val": "Appends $s to @a", + "key": "push(@a, $s);" + }, { + "val": "Removes last element", + "key": "$a = pop(@a);" + }, { + "val": "Remove last char (per el.)", + "key": "chop(@a);" + }, { + "val": "Removes first element", + "key": "$a = shift(@a);" + }, { + "val": "Reverse @a", + "key": "reverse(@a);" + }, { + "val": "Sort numerically", + "key": "@a = sort\\{$ela <=> $elb\\}(@a);" + }, { + "val": "Split string into @a", + "key": "@a = split(\/-\/,$s);" + }], + "Hashes": [{ + "val": "Hash initialization", + "key": "%h=(k1 => “val1”,k2 => 3);" + }, { + "val": "Recall value", + "key": "$val = $map\\{k1\\};" + }, { + "val": "Array of keys and values", + "key": "@a = %h;" + }, { + "val": "Create hash from array", + "key": "%h = @a;" + }, { + "val": "Iterate over list of keys", + "key": "foreach $k (keys(%h))\\{..\\}" + }, { + "val": "Iterate over list of values", + "key": "foreach $v (vals(%h))\\{..\\}" + }, { + "val": "Iterate over key-value-pairs", + "key": "while (($k,$v)=each %h)\\{..\\}" + }, { + "val": "Delete key", + "key": "delete $h\\{k1\\};" + }], + "Basic Syntax": [{ + "val": "Read command line params", + "key": "($a, $b) = shift(@ARGV);" + }, { + "val": "Define subroutine", + "key": "sub p\\{my $var = shift; ...\\}" + }, { + "val": "Execute subroutine", + "key": "p(“bla”);" + }, { + "val": "Conditional", + "key": "if(expr)\\{\\} elsif \\{\\} else \\{\\}" + }, { + "val": "Negative conditional", + "key": "unless (expr)\\{\\}" + }, { + "val": "While-loop", + "key": "while (expr)\\{\\}" + }, { + "val": "Until-loop", + "key": "until (expr)\\{\\}" + }, { + "val": "Postcheck until-loop", + "key": "do \\{\\} until (expr)" + }, { + "val": "For-loop", + "key": "for($i=1; $i<=10; $i++)\\{\\}" + }, { + "val": "Foreach-loop", + "key": "foreach $i (@list)\\{\\}" + }, { + "val": "End loop, skip to next, jump to top", + "key": "last, next, redo" + }], + "References and Data Structures": [{ + "val": "Reference to array", + "key": "$aref = \\@a;" + }, { + "val": "Anonymous array", + "key": "$aref = \\[1,\"foo\",undef,13\\];" + }, { + "val": "Access element of array", + "key": "[$el = $aref->\\[0\\];] / [$el = @\\{$aref\\}\\[0\\];]" + }, { + "val": "Copy array", + "key": "$aref2 = \\[@\\{$aref1\\}\\];" + }, { + "val": "Reference to hash", + "key": "$href = \\%h;" + }, { + "val": "Anonymous hash", + "key": "$href =\\{APR => 4,AUG => 8\\};" + }, { + "val": "Access element of hash", + "key": "[$el = $href->\\{APR\\};] / [$el = %\\{$href\\}\\{APR\\};]" + }, { + "val": "Copy hash", + "key": "$href2 = \\{%\\{$href1\\}\\};" + }, { + "val": "Checks if $r points to hash", + "key": "if (ref($r) eq \"HASH\") \\{\\}" + }, { + "val": "2-dim array", + "key": "@a = (\\[1, 2\\],\\[3, 4\\]);" + }, { + "val": "Access 2-dim array", + "key": "$i = $a\\[0\\]\\[1\\];" + }], + "System Interaction": [{ + "val": "System call", + "key": "system(“cat $f|sort -u>$f.s”);" + }, { + "val": "Catch output", + "key": "@a = readpipe(“lsmod”);" + }, { + "val": "Catch output", + "key": "$today = “Today: “.date;" + }, { + "val": "Change root", + "key": "chroot(“\/home\/user\/”);" + }, { + "val": "Operate on all c-files", + "key": "while (<*.c>) \\{\\}'" + }, { + "val": "Delete file", + "key": "unlink(“\/tmp\/file”);" + }, { + "val": "File test", + "key": "if (-f “file.txt”)\\{...\\}" + }] + } +} From 1d70c3f49f13326118e7d60b3ceb2a8bbc355eb2 Mon Sep 17 00:00:00 2001 From: Mailkov Date: Wed, 9 Dec 2015 20:07:09 +0000 Subject: [PATCH 253/379] Fix #1873 - Shouldn't trigger on when query is only 'Rubics Cube' --- lib/DDG/Goodie/RubiksCubePatterns.pm | 1 + t/RubiksCubePatterns.t | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/DDG/Goodie/RubiksCubePatterns.pm b/lib/DDG/Goodie/RubiksCubePatterns.pm index 86a5484aa..61f7dc035 100644 --- a/lib/DDG/Goodie/RubiksCubePatterns.pm +++ b/lib/DDG/Goodie/RubiksCubePatterns.pm @@ -56,6 +56,7 @@ sub render_text($) { handle remainder_lc => sub { + return if ($req->query_lc eq 'rubics cube'); #support British English! s/centre/center/; diff --git a/t/RubiksCubePatterns.t b/t/RubiksCubePatterns.t index 121578681..82de095a4 100644 --- a/t/RubiksCubePatterns.t +++ b/t/RubiksCubePatterns.t @@ -157,6 +157,7 @@ ddg_goodie_test( 'rcube swap cented' => undef, 'rcube cube in a cuve' => undef, 'rubiks cube other words' => undef, + 'rubics cube' => undef, ); done_testing; From 8307048cb5e47abd2e82202b229c3c268da3afbc Mon Sep 17 00:00:00 2001 From: Mailkov Date: Wed, 9 Dec 2015 20:33:15 +0000 Subject: [PATCH 254/379] fix other trigger --- lib/DDG/Goodie/RubiksCubePatterns.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/DDG/Goodie/RubiksCubePatterns.pm b/lib/DDG/Goodie/RubiksCubePatterns.pm index 61f7dc035..8739b26ff 100644 --- a/lib/DDG/Goodie/RubiksCubePatterns.pm +++ b/lib/DDG/Goodie/RubiksCubePatterns.pm @@ -21,7 +21,7 @@ attribution web => ['robert.io', 'Robert Picard'], triggers start => "rcube", "rubik", "rubiks", "rubix", "rubicks", "rubik's", "rubic's", "rubick's", "rubik cube", "rubiks cube", "rubic cube", "rubics cube", - "rubik's cube patterns", "rubiks cube patterns"; + "rubik's cube"; zci answer_type => "rubiks_cube"; zci is_cached => 1; @@ -56,7 +56,7 @@ sub render_text($) { handle remainder_lc => sub { - return if ($req->query_lc eq 'rubics cube'); + return if ($_ eq ''); #support British English! s/centre/center/; @@ -73,7 +73,7 @@ handle remainder_lc => sub { $title = $patterns{$_}; $subtitle = "Rubiks cube '" . to_titlecase($_) . "' pattern"; } else { - return if ($_ ne ''); + return if ($_ ne 'patterns'); foreach my $pattern (keys %patterns) { $output .= render_text($pattern); } From 11b00c1bb1b00dcef004c4e6ce35297ea12421f4 Mon Sep 17 00:00:00 2001 From: Sarvesh D Date: Thu, 10 Dec 2015 02:05:46 +0530 Subject: [PATCH 255/379] templates: use ia_id instead of lia_name --- template/lib/DDG/Goodie/Example.pm | 4 ++-- template/share/goodie/example/example.js | 10 +++++----- template/t/Example.t | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/template/lib/DDG/Goodie/Example.pm b/template/lib/DDG/Goodie/Example.pm index 0b9aa546a..2d147fbb2 100644 --- a/template/lib/DDG/Goodie/Example.pm +++ b/template/lib/DDG/Goodie/Example.pm @@ -7,7 +7,7 @@ package DDG::Goodie::<: $ia_package_name :>; use DDG::Goodie; use strict; -zci answer_type => '<: $lia_name :>'; +zci answer_type => '<: $ia_id :>'; # Caching - https://duck.co/duckduckhack/spice_advanced_backend#caching-api-responses zci is_cached => 1; @@ -36,7 +36,7 @@ handle remainder => sub { # ID - Must be unique and match Instant Answer page # E.g. https://duck.co/ia/view/calculator has `id => 'calculator'`` - id => '<: $lia_id :>', + id => '<: $ia_id :>', # Name - Used for Answer Bar Tab # Value should be chosen from existing Instant Answer topics diff --git a/template/share/goodie/example/example.js b/template/share/goodie/example/example.js index 627d2adc9..ce8483245 100644 --- a/template/share/goodie/example/example.js +++ b/template/share/goodie/example/example.js @@ -1,9 +1,9 @@ -DDH.<: $lia_id :> = DDH.<: $lia_id :> || {}; +DDH.<: $ia_id :> = DDH.<: $ia_id :> || {}; (function(DDH) { "use strict"; - console.log("DDH.<: $lia_id :>.build"); // remove this before submitting pull request + console.log("DDH.<: $ia_id :>.build"); // remove this before submitting pull request // define private variables and functions here // @@ -13,11 +13,11 @@ DDH.<: $lia_id :> = DDH.<: $lia_id :> || {}; // b = '', // c = ''; - DDH.<: $lia_id :>.build = function(ops) { + DDH.<: $ia_id :>.build = function(ops) { return { - id: '<: $lia_id :>', + id: '<: $ia_id :>', meta: { sourceName: "Source Domain", @@ -57,7 +57,7 @@ DDH.<: $lia_id :> = DDH.<: $lia_id :> || {}; // define any callbacks or event handlers here // - // var $dom = $(".zci--'<: $lia_id :>'"); + // var $dom = $(".zci--'<: $ia_id :>'"); // $dom.find(".my-special-class").click(funtcion(){ // // }); diff --git a/template/t/Example.t b/template/t/Example.t index e4f5ecc73..dda7f8196 100644 --- a/template/t/Example.t +++ b/template/t/Example.t @@ -5,7 +5,7 @@ use warnings; use Test::More; use DDG::Test::Goodie; -zci answer_type => "<: $lia_name :>"; +zci answer_type => "<: $ia_id :>"; zci is_cached => 1; ddg_goodie_test( From 07f5f75d1fb6f24cd2bccfa91c1766fb57213079 Mon Sep 17 00:00:00 2001 From: pratik-nagelia Date: Wed, 9 Dec 2015 20:38:16 +0000 Subject: [PATCH 256/379] Description and alias update --- share/goodie/cheat_sheets/json/perl.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/goodie/cheat_sheets/json/perl.json b/share/goodie/cheat_sheets/json/perl.json index 9f7e46208..31180cf05 100644 --- a/share/goodie/cheat_sheets/json/perl.json +++ b/share/goodie/cheat_sheets/json/perl.json @@ -1,13 +1,13 @@ { "id": "perl_cheat_sheet", "name": "Perl", - "description": "Perl Cheat Sheet", + "description": "Essential Perl basic syntax, methods, functions, variables, references and data structure ", "metadata": { "sourceName": "Cheatography", "sourceUrl": "http://www.cheatography.com/mishin/cheat-sheets/perl-reference-card/" }, "aliases": [ - "perl", "perl cheat sheet", "perl cheatsheet" + "perl" ], "template_type": "code", "section_order": ["Input/Output", "Scalars and Strings", "Arrays and Lists", "Hashes", "Basic Syntax", "References and Data Structures", "System Interaction"], From 6ca971a9a9340a270f30258a8b6fb5c5cb546288 Mon Sep 17 00:00:00 2001 From: Sarvesh D Date: Thu, 26 Nov 2015 21:02:17 +0530 Subject: [PATCH 257/379] Added sample CheatSheet JSON file --- .../goodie/cheat_sheets/json/example.json | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 template/share/goodie/cheat_sheets/json/example.json diff --git a/template/share/goodie/cheat_sheets/json/example.json b/template/share/goodie/cheat_sheets/json/example.json new file mode 100644 index 000000000..94eccec14 --- /dev/null +++ b/template/share/goodie/cheat_sheets/json/example.json @@ -0,0 +1,44 @@ +{ + "id": "<: $lia_id :>_cheat_sheet", + "name": "<: $ia_name_separated :>", + "description": "displayed as subtitle of the AnswerBar; optional", + + "metadata": { + "sourceName": "displayed at the bottom of the AnswerBar; optional", + "sourceUrl" : "https://url.to.the.source" + }, + + "aliases": [ + "first alias", "second alias", "etc" + ], + + "template_type": "one of: keyboard, terminal, code, reference", + + "section_order": [ + "First Section", + "Second Section" + ], + + "sections": { + "First Section": [ + { + "key": "Key 1.1", + "val": "Value 1.1" + }, + { + "key": "Key 1.2", + "val": "Value 1.2" + } + ], + "Second Section": [ + { + "key": "Key 2.1", + "val": "Value 2.2" + }, + { + "key": "Key 2.2", + "val": "Value 2.2" + } + ] + } +} From 5a7352af6c07171c634f4ebc781545f550332e65 Mon Sep 17 00:00:00 2001 From: Sarvesh D Date: Thu, 26 Nov 2015 21:02:36 +0530 Subject: [PATCH 258/379] Added sample Goodie CSS file --- template/share/goodie/example/example.css | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 template/share/goodie/example/example.css diff --git a/template/share/goodie/example/example.css b/template/share/goodie/example/example.css new file mode 100644 index 000000000..a46eebb9a --- /dev/null +++ b/template/share/goodie/example/example.css @@ -0,0 +1,4 @@ +.zci--<: $lia_id :> { + +} + From 08fde96f65c84f2206e4b1d995caf1906019749a Mon Sep 17 00:00:00 2001 From: Sarvesh D Date: Thu, 26 Nov 2015 21:02:55 +0530 Subject: [PATCH 259/379] Added templates.yml for generic template support --- .../goodie/cheat_sheets/json/example.json | 2 +- template/share/goodie/example/example.css | 2 +- template/templates.yml | 56 +++++++++++++++++++ 3 files changed, 58 insertions(+), 2 deletions(-) create mode 100644 template/templates.yml diff --git a/template/share/goodie/cheat_sheets/json/example.json b/template/share/goodie/cheat_sheets/json/example.json index 94eccec14..529df426f 100644 --- a/template/share/goodie/cheat_sheets/json/example.json +++ b/template/share/goodie/cheat_sheets/json/example.json @@ -1,5 +1,5 @@ { - "id": "<: $lia_id :>_cheat_sheet", + "id": "<: $ia_id :>_cheat_sheet", "name": "<: $ia_name_separated :>", "description": "displayed as subtitle of the AnswerBar; optional", diff --git a/template/share/goodie/example/example.css b/template/share/goodie/example/example.css index a46eebb9a..606766371 100644 --- a/template/share/goodie/example/example.css +++ b/template/share/goodie/example/example.css @@ -1,4 +1,4 @@ -.zci--<: $lia_id :> { +.zci--<: $ia_id :> { } diff --git a/template/templates.yml b/template/templates.yml new file mode 100644 index 000000000..9cb6c0983 --- /dev/null +++ b/template/templates.yml @@ -0,0 +1,56 @@ +--- +# Template definitions for goodies. + +# Each template represents one input and one output file. +# Modification of files generated by certain templates will need to restart a +# running duckpan instance in order to be recognized: +# - Perl modules +# - Cheat Sheet JSON, since they are pre-loaded +# This is indicated by the 'needs_restart' field. +templates: + pm: + label: Perl Module + input: lib/DDG/Goodie/Example.pm + output: lib/DDG/Goodie/<:$ia_path:>.pm + needs_restart: true + + test: + label: Perl Module Test + input: t/Example.t + output: t/<:$ia_path:>.t + + js: + label: Javascript + input: share/goodie/example/example.js + output: share/goodie/<:$ia_path_lc:>/<:$ia_id:>.js + + css: + label: CSS + input: share/goodie/example/example.css + output: share/goodie/<:$ia_path_lc:>/<:$ia_id:>.css + + cheatsheet_json: + label: CheatSheet JSON + input: share/goodie/cheat_sheets/json/example.json + output: share/goodie/cheat_sheets/json/<:$ia_id:>.json + needs_restart: true + +# A template set is a collection of templates used to generate all files of a +# sub-type of an Instant Answer type. Each set can have some 'required' +# templates (which are always applied) and some 'optional' templates (which are +# applied after asking the user). +template_sets: + default: + description: Standard Goodie Instant Answer + required: [ pm, test ] + optional: [ js, css ] + + cheatsheet: + description: Cheat Sheet Instant Answer + required: [ cheatsheet_json ] + + all: + description: Goodie with all backend and frontend files + required: [ pm, test, js, css ] +... + From 4c25007b8efc2c7fc273d02889dd600efa70867c Mon Sep 17 00:00:00 2001 From: tagawa Date: Thu, 10 Dec 2015 02:30:19 +0000 Subject: [PATCH 260/379] JavaScript cheatsheet: Fixed typo --- share/goodie/cheat_sheets/json/javascript.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/share/goodie/cheat_sheets/json/javascript.json b/share/goodie/cheat_sheets/json/javascript.json index de870ae16..c1a3844a6 100644 --- a/share/goodie/cheat_sheets/json/javascript.json +++ b/share/goodie/cheat_sheets/json/javascript.json @@ -7,7 +7,8 @@ "sourceUrl": "http://overapi.com/javascript/" }, "aliases": [ - "js", "java script" + "js", + "java script" ], "template_type": "code", "section_order": [ @@ -21,7 +22,7 @@ "sections": { "Array Methods": [{ "val": "Joins two or more arrays, and returns a copy of the joined arrays", - "key": "concact()" + "key": "concat()" }, { "val": "Searches array for an element, and returns element's position", "key": "indexOf()" From 7a99d06aa348f4730c0bc09d575cd6f03433349c Mon Sep 17 00:00:00 2001 From: tagawa Date: Thu, 10 Dec 2015 07:33:34 +0000 Subject: [PATCH 261/379] TwelveOclock: Fixed description. --- lib/DDG/Goodie/TwelveOclock.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/DDG/Goodie/TwelveOclock.pm b/lib/DDG/Goodie/TwelveOclock.pm index dd9f55c53..293327b68 100644 --- a/lib/DDG/Goodie/TwelveOclock.pm +++ b/lib/DDG/Goodie/TwelveOclock.pm @@ -9,7 +9,7 @@ zci is_cached => 1; primary_example_queries "is 12:00am noon?", "is 1200pm midnight?"; secondary_example_queries "when is noon?", "when is midnight?"; -description "Succinct explanation of what this instant answer does"; +description "Tells you whether 12 o'clock is noon or midnight."; name "TwelveOclock"; code_url "https://github.com/duckduckgo/zeroclickinfo-spice/blob/master/lib/DDG/Spice/TwelveOclock.pm"; category "reference"; From 7b87dc00cf9a3260f391b912c08fa8d5371d7f58 Mon Sep 17 00:00:00 2001 From: mohan08p Date: Thu, 10 Dec 2015 14:51:06 +0000 Subject: [PATCH 262/379] template type updated to terminal --- share/goodie/cheat_sheets/json/mongodb.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/goodie/cheat_sheets/json/mongodb.json b/share/goodie/cheat_sheets/json/mongodb.json index e4babe327..04441934b 100644 --- a/share/goodie/cheat_sheets/json/mongodb.json +++ b/share/goodie/cheat_sheets/json/mongodb.json @@ -1,7 +1,7 @@ { "id": "mongodb_cheat_sheet", "name": "MongoDB", - "templete_type": "code", + "template_type": "terminal", "description": "Mongo shell", "metadata": { "sourceName": "Codecentric", From 761dd5d66c740da426826e003346433361ce998a Mon Sep 17 00:00:00 2001 From: Salil Kapur Date: Thu, 10 Dec 2015 15:07:45 +0000 Subject: [PATCH 263/379] Description changed. New ports added. --- .../json/default-port-numbers.json | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/share/goodie/cheat_sheets/json/default-port-numbers.json b/share/goodie/cheat_sheets/json/default-port-numbers.json index fdafe38e5..54e66abb9 100644 --- a/share/goodie/cheat_sheets/json/default-port-numbers.json +++ b/share/goodie/cheat_sheets/json/default-port-numbers.json @@ -1,20 +1,20 @@ { "id": "default_port_numbers_cheat_sheet", - "name": "Default Port Numbers", - "description": "List of port numbers used in computer networks", + "name": "Standard Port Numbers", + "description": "List of official TCP and UDP Port Numbers", "metadata": { "sourceName": "Wikipedia", "sourceUrl": "https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers" }, "aliases": [ - "default port", "network ports" + "default port", "network ports", "tcp ports", "udp ports", "tcp port numbers", "udp port numbers" ], - "template_type": "keyboard", + "template_type": "reference", "section_order": [ - "Well Known Protocols", "Registered Protocols" + "Well Known Protocols (Standard Ports)", "Registered Ports" ], "sections": { - "Well Known Protocols": [{ + "Well Known Protocols (Standard Ports)": [{ "val": "FTP Data Transfer", "key": "20" }, { @@ -27,7 +27,7 @@ "val": "Telnet Protocol", "key": "23" }, { - "val": "Simple Mail Transfer Protocol", + "val": "Simple Mail Transfer Protocol (SMTP)", "key": "25" }, { "val": "Domain Name System (DNS)", @@ -42,8 +42,11 @@ "val": "Hypertext Transfer Protocol (HTTP)", "key": "80" }, { - "val": "Internet Message Access Protocol", + "val": "Internet Message Access Protocol (IMAP)", "key": "143" + }, { + "val": "Internet Relay Chat (IRC)", + "key": "194" }, { "val": "Hypertext Transfer Protocol over TLS/SSL (HTTPS)", "key": "443" @@ -54,7 +57,7 @@ "val": "Telnet Protocol over TLS/SSL", "key": "992" }], - "Registered Protocols": [{ + "Registered Ports": [{ "val": "SOCKS Proxy", "key": "1080" }, { From ac1c202218b5400a546bd7130302c27d24114e79 Mon Sep 17 00:00:00 2001 From: Salil Kapur Date: Thu, 10 Dec 2015 15:11:48 +0000 Subject: [PATCH 264/379] Minor fix --- share/goodie/cheat_sheets/json/default-port-numbers.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/share/goodie/cheat_sheets/json/default-port-numbers.json b/share/goodie/cheat_sheets/json/default-port-numbers.json index 54e66abb9..984e1b2de 100644 --- a/share/goodie/cheat_sheets/json/default-port-numbers.json +++ b/share/goodie/cheat_sheets/json/default-port-numbers.json @@ -11,7 +11,8 @@ ], "template_type": "reference", "section_order": [ - "Well Known Protocols (Standard Ports)", "Registered Ports" + "Well Known Protocols (Standard Ports)", + "Registered Ports" ], "sections": { "Well Known Protocols (Standard Ports)": [{ From 2c48748e12387eea436d86f67daf90867967845f Mon Sep 17 00:00:00 2001 From: Sarvesh D Date: Thu, 10 Dec 2015 21:21:40 +0530 Subject: [PATCH 265/379] templates: Added optional handlebars file --- template/share/goodie/example/example.handlebars | 4 ++++ template/templates.yml | 9 +++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 template/share/goodie/example/example.handlebars diff --git a/template/share/goodie/example/example.handlebars b/template/share/goodie/example/example.handlebars new file mode 100644 index 000000000..d0dec99b4 --- /dev/null +++ b/template/share/goodie/example/example.handlebars @@ -0,0 +1,4 @@ +{{name}} + + + diff --git a/template/templates.yml b/template/templates.yml index 9cb6c0983..04c0d0976 100644 --- a/template/templates.yml +++ b/template/templates.yml @@ -29,6 +29,11 @@ templates: input: share/goodie/example/example.css output: share/goodie/<:$ia_path_lc:>/<:$ia_id:>.css + handlebars: + label: Handlebars + input: share/goodie/example/example.handlebars + output: share/goodie/<:$ia_path_lc:>/<:$ia_id:>.handlebars + cheatsheet_json: label: CheatSheet JSON input: share/goodie/cheat_sheets/json/example.json @@ -43,7 +48,7 @@ template_sets: default: description: Standard Goodie Instant Answer required: [ pm, test ] - optional: [ js, css ] + optional: [ js, css, handlebars ] cheatsheet: description: Cheat Sheet Instant Answer @@ -51,6 +56,6 @@ template_sets: all: description: Goodie with all backend and frontend files - required: [ pm, test, js, css ] + required: [ pm, test, js, css, handlebars ] ... From dc438fd4bd32f4ea6070d208981ffa03030238fe Mon Sep 17 00:00:00 2001 From: Zaahir Moolla Date: Thu, 10 Dec 2015 14:25:14 -0500 Subject: [PATCH 266/379] cleanup formatting, change Spacebar -> Space --- .../cheat_sheets/json/microsoft-word.json | 150 ++++++++++-------- 1 file changed, 87 insertions(+), 63 deletions(-) diff --git a/share/goodie/cheat_sheets/json/microsoft-word.json b/share/goodie/cheat_sheets/json/microsoft-word.json index 7ea961955..724b6db8a 100644 --- a/share/goodie/cheat_sheets/json/microsoft-word.json +++ b/share/goodie/cheat_sheets/json/microsoft-word.json @@ -1,72 +1,96 @@ { "id": "microsoft_word_cheat_sheet", "name": "Microsoft Word 2010", - "description": "Word Processor by Microsoft", + "description": "Common tasks and formatting shortcuts", "metadata": { "sourceName": "Dummies", "sourceUrl": "http://www.dummies.com/how-to/content/word-2010-for-dummies-cheat-sheet.html" }, - "aliases": ["ms word", - "winword"], + "aliases": [ + "ms word", + "winword" + ], "template_type": "keyboard", - "section_order": ["Common Tasks", "Formatting"], + "section_order": [ + "Common Tasks", + "Formatting" + ], "sections": { - "Common Tasks": [{ - "val": "Save", - "key": "[Ctrl] [S]" - }, { - "val": "Navigate (Find/Search)", - "key": "[Ctrl] [F]" - }, { - "val": "Cut", - "key": "[Ctrl] [X]" - }, { - "val": "Copy", - "key": "[Ctrl] [C]" - }, { - "val": "Paste", - "key": "[Ctrl] [V]" - }, { - "val": "Select All", - "key": "[Ctrl] [A]" - }, { - "val": "Print", - "key": "[Ctrl] [P]" - }, { - "val": "Undo", - "key": "[Ctrl] [Z]" - }, { - "val": "Redo", - "key": "[Ctrl] [Y]" - }], - - "Formatting": [{ - "val": "Make Letters Bold", - "key": "[Ctrl] [B]" - }, { - "val": "Make Letters Italic", - "key": "[Ctrl] [I]" - }, { - "val": "Underline Letters", - "key": "[Ctrl] [U]" - }, { - "val": "Create a Nonbreaking Space", - "key": "[Ctrl] [Shift] [Spacebar]" - }, { - "val": "Create a Nonbreaking Hyphen", - "key": "[Ctrl] [Shift] [Hyphen]" - }, { - "val": "Decrease Font Size by 1 value", - "key": "[Ctrl] [Shift] [<]" - }, { - "val": "Increase Font Size by 1 value", - "key": "[Ctrl] [Shift] [>]" - }, { - "val": "Remove Paragraph or Character Formatting", - "key": "[Ctrl] [Spacebar]" - }, { - "val": "Paste Special", - "key": "[ALT] [Ctrl] [V]" - }] -} -} + "Common Tasks": [ + { + "val": "Save", + "key": "[Ctrl] [S]" + }, + { + "val": "Navigate (Find/Search)", + "key": "[Ctrl] [F]" + }, + { + "val": "Cut", + "key": "[Ctrl] [X]" + }, + { + "val": "Copy", + "key": "[Ctrl] [C]" + }, + { + "val": "Paste", + "key": "[Ctrl] [V]" + }, + { + "val": "Select All", + "key": "[Ctrl] [A]" + }, + { + "val": "Print", + "key": "[Ctrl] [P]" + }, + { + "val": "Undo", + "key": "[Ctrl] [Z]" + }, + { + "val": "Redo", + "key": "[Ctrl] [Y]" + } + ], + "Formatting": [ + { + "val": "Make Letters Bold", + "key": "[Ctrl] [B]" + }, + { + "val": "Make Letters Italic", + "key": "[Ctrl] [I]" + }, + { + "val": "Underline Letters", + "key": "[Ctrl] [U]" + }, + { + "val": "Create a Nonbreaking Space", + "key": "[Ctrl] [Shift] [Space]" + }, + { + "val": "Create a Nonbreaking Hyphen", + "key": "[Ctrl] [Shift] [Hyphen]" + }, + { + "val": "Decrease Font Size by 1 value", + "key": "[Ctrl] [Shift] [<]" + }, + { + "val": "Increase Font Size by 1 value", + "key": "[Ctrl] [Shift] [>]" + }, + { + "val": "Remove Paragraph or Character Formatting", + "key": "[Ctrl] [Space]" + }, + { + "val": "Paste Special", + "key": "[Alt] [Ctrl] [V]" + } + ] + } +} \ No newline at end of file From 9cf8c7e4e487e75f27ca8f04fca5a99657901b26 Mon Sep 17 00:00:00 2001 From: Sarvesh D Date: Fri, 11 Dec 2015 02:48:27 +0530 Subject: [PATCH 267/379] templates.yml: Disabled subdirs for cheat sheets. For example, "hello/world" will no longer be an accepted name for a cheat sheet instant answer. --- template/templates.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/template/templates.yml b/template/templates.yml index 04c0d0976..b318b08c7 100644 --- a/template/templates.yml +++ b/template/templates.yml @@ -44,6 +44,8 @@ templates: # sub-type of an Instant Answer type. Each set can have some 'required' # templates (which are always applied) and some 'optional' templates (which are # applied after asking the user). +# The 'subdir_support' field specifies if IAs created with the template set +# support being created inside a subdirectory. It defaults to 'true'. template_sets: default: description: Standard Goodie Instant Answer @@ -53,6 +55,7 @@ template_sets: cheatsheet: description: Cheat Sheet Instant Answer required: [ cheatsheet_json ] + subdir_support: false all: description: Goodie with all backend and frontend files From bbb545c4ffa1ac7024555e962d4c37c84023a1c9 Mon Sep 17 00:00:00 2001 From: tagawa Date: Fri, 11 Dec 2015 09:13:42 +0000 Subject: [PATCH 268/379] Unicode: Added UTF triggers --- lib/DDG/Goodie/Unicode.pm | 4 ++-- lib/DDG/Goodie/UnicodeFuzzySearch.pm | 2 +- t/Unicode.t | 14 ++++++++++++-- t/UnicodeFuzzySearch.t | 12 ++++++++++++ 4 files changed, 27 insertions(+), 5 deletions(-) diff --git a/lib/DDG/Goodie/Unicode.pm b/lib/DDG/Goodie/Unicode.pm index 6e21198dc..2a2e35b2e 100644 --- a/lib/DDG/Goodie/Unicode.pm +++ b/lib/DDG/Goodie/Unicode.pm @@ -10,7 +10,7 @@ use Encode qw/encode_utf8/; attribution github => ['cosimo', 'Cosimo Streppone']; primary_example_queries 'U+590c'; -secondary_example_queries 'unicode white smiling face'; +secondary_example_queries 'unicode white smiling face', 'utf-8 smile'; description 'get information about a unicode character'; code_url 'https://github.com/duckduckgo/zeroclickinfo-goodies/blob/master/lib/DDG/Goodie/Unicode.pm'; name 'Unicode'; @@ -22,7 +22,7 @@ use constant { CODEPOINT_RE => qr/^ \s* (?:U \+|\\(?:u|x{(?=.*}))) (? [a-f0-9]{4,6})}? \s* $/xi, NAME_RE => qr/^ (? [A-Z][A-Z\s]+) $/xi, CHAR_RE => qr/^ \s* (? .) \s* $/x, - UNICODE_RE => qr/^ unicode \s+ (.+) $/xi, + UNICODE_RE => qr/^ (?:unicode|utf-(?:8|16|32)) \s+ (.+) $/xi, CODEPOINT => 1, NAME => 2, CHAR => 3, diff --git a/lib/DDG/Goodie/UnicodeFuzzySearch.pm b/lib/DDG/Goodie/UnicodeFuzzySearch.pm index 273562163..260e553f4 100644 --- a/lib/DDG/Goodie/UnicodeFuzzySearch.pm +++ b/lib/DDG/Goodie/UnicodeFuzzySearch.pm @@ -5,7 +5,7 @@ use strict; use DDG::Goodie; use URI::Escape::XS; -triggers startend => "unicode", "emoji"; +triggers startend => "unicode", "emoji", "utf-8", "utf-16", "utf-32"; zci is_cached => 1; diff --git a/t/Unicode.t b/t/Unicode.t index bab277f8a..37e111d86 100644 --- a/t/Unicode.t +++ b/t/Unicode.t @@ -20,9 +20,18 @@ ddg_goodie_test( # Same should work with the "unicode" start trigger too 'unicode U+263B' => test_zci("\x{263B} U+263B BLACK SMILING FACE, decimal: 9787, HTML: ☻, UTF-8: 0xE2 0x98 0xBB, block: Miscellaneous Symbols"), - # Lookup by name, "unicode LATIN SMALL LETTER A WITH CIRCUMFLEX") + # Lookup by name, "unicode LATIN SMALL LETTER A WITH CIRCUMFLEX" "unicode White Smiling Face" => test_zci("\x{263A} U+263A WHITE SMILING FACE, decimal: 9786, HTML: ☺, UTF-8: 0xE2 0x98 0xBA, block: Miscellaneous Symbols"), + # Lookup by name, "utf-8 bullet" + "utf-8 bullet" => test_zci("\x{2022} U+2022 BULLET, decimal: 8226, HTML: •, UTF-8: 0xE2 0x80 0xA2, block: General Punctuation"), + + # Lookup by name, "utf-16 smile" + "utf-16 smile" => test_zci("\x{2323} U+2323 SMILE, decimal: 8995, HTML: ⌣, UTF-8: 0xE2 0x8C 0xA3, block: Miscellaneous Technical"), + + # Lookup by name, "utf-32 custard" + "utf-32 custard" => test_zci("\x{1F36E} U+1F36E CUSTARD, decimal: 127854, HTML: 🍮, UTF-8: 0xF0 0x9F 0x8D 0xAE, block: Miscellaneous Symbols And Pictographs"), + # Lookup by character, "unicode à" "unicode \x{263B}" => test_zci("\x{263B} U+263B BLACK SMILING FACE, decimal: 9787, HTML: ☻, UTF-8: 0xE2 0x98 0xBB, block: Miscellaneous Symbols"), @@ -31,7 +40,8 @@ ddg_goodie_test( '\x{2764}' => test_zci("\x{2764} U+2764 HEAVY BLACK HEART, decimal: 10084, HTML: ❤, UTF-8: 0xE2 0x9D 0xA4, block: Dingbats"), - 'unicode unknown' => undef + 'unicode unknown' => undef, + 'utf-15 bullet' => undef ); done_testing; diff --git a/t/UnicodeFuzzySearch.t b/t/UnicodeFuzzySearch.t index b58d8c1b8..f778ec541 100644 --- a/t/UnicodeFuzzySearch.t +++ b/t/UnicodeFuzzySearch.t @@ -39,6 +39,18 @@ ROTATED HEAVY BLACK HEART BULLET: \x{2765} (U+2765)", 'unicode 2665' => test_zci("BLACK HEART SUIT: \x{2665} (U+2665)", html => "BLACK HEART SUIT: \x{2665} (U+2665)"), + # ------ + 'utf-8 2666' => + test_zci("BLACK DIAMOND SUIT: \x{2666} (U+2666)", + html => "BLACK DIAMOND SUIT: \x{2666} (U+2666)"), + # ------ + 'utf-16 black diamond suit' => + test_zci("BLACK DIAMOND SUIT: \x{2666} (U+2666)", + html => "BLACK DIAMOND SUIT: \x{2666} (U+2666)"), + # ------ + 'utf-32 black diamond suit' => + test_zci("BLACK DIAMOND SUIT: \x{2666} (U+2666)", + html => "BLACK DIAMOND SUIT: \x{2666} (U+2666)"), # -- emoji : lower bound 'unicode cyclone' => test_zci( From 7eb5fd9120e15c9038026fec603c236563b4b0dd Mon Sep 17 00:00:00 2001 From: JOBIN PHILIP ABRAHAM Date: Sat, 12 Dec 2015 10:53:41 +0530 Subject: [PATCH 269/379] Update si-units.json Retained the old desc. --- share/goodie/cheat_sheets/json/si-units.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/goodie/cheat_sheets/json/si-units.json b/share/goodie/cheat_sheets/json/si-units.json index 3ebcf5fb0..2b843fd3e 100644 --- a/share/goodie/cheat_sheets/json/si-units.json +++ b/share/goodie/cheat_sheets/json/si-units.json @@ -3,7 +3,7 @@ "name": "SI Units", - "description": "A quick reference for International System of Units (SI)", + "description": "International System of Units (SI): Base/Derived quantity - Name - Symbol", "metadata": { "sourceName": "NIST", From 3ca7403e051db23f827d75cf714bf371f1165117 Mon Sep 17 00:00:00 2001 From: Salil Kapur Date: Sat, 12 Dec 2015 06:51:36 +0000 Subject: [PATCH 270/379] alias changed. Section name updated --- share/goodie/cheat_sheets/json/default-port-numbers.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/goodie/cheat_sheets/json/default-port-numbers.json b/share/goodie/cheat_sheets/json/default-port-numbers.json index 984e1b2de..e78e5b4a1 100644 --- a/share/goodie/cheat_sheets/json/default-port-numbers.json +++ b/share/goodie/cheat_sheets/json/default-port-numbers.json @@ -7,11 +7,11 @@ "sourceUrl": "https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers" }, "aliases": [ - "default port", "network ports", "tcp ports", "udp ports", "tcp port numbers", "udp port numbers" + "default ports", "network ports", "tcp ports", "udp ports", "tcp port numbers", "udp port numbers" ], "template_type": "reference", "section_order": [ - "Well Known Protocols (Standard Ports)", + "Well Known Ports (System Ports)", "Registered Ports" ], "sections": { From 46d60c5f5d7457a7f6b91d7d55acbce92c74258c Mon Sep 17 00:00:00 2001 From: Salil Kapur Date: Sat, 12 Dec 2015 07:00:19 +0000 Subject: [PATCH 271/379] Minor Fix --- share/goodie/cheat_sheets/json/default-port-numbers.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/goodie/cheat_sheets/json/default-port-numbers.json b/share/goodie/cheat_sheets/json/default-port-numbers.json index e78e5b4a1..9cf37eaa1 100644 --- a/share/goodie/cheat_sheets/json/default-port-numbers.json +++ b/share/goodie/cheat_sheets/json/default-port-numbers.json @@ -15,7 +15,7 @@ "Registered Ports" ], "sections": { - "Well Known Protocols (Standard Ports)": [{ + "Well Known Ports (System Ports)": [{ "val": "FTP Data Transfer", "key": "20" }, { From 0bd631482baeab9e155f08d28fd000606346fb6c Mon Sep 17 00:00:00 2001 From: pratik-nagelia Date: Sat, 12 Dec 2015 08:46:57 +0000 Subject: [PATCH 272/379] Removed alias --- share/goodie/cheat_sheets/json/perl.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/share/goodie/cheat_sheets/json/perl.json b/share/goodie/cheat_sheets/json/perl.json index 31180cf05..33d2e9420 100644 --- a/share/goodie/cheat_sheets/json/perl.json +++ b/share/goodie/cheat_sheets/json/perl.json @@ -6,9 +6,6 @@ "sourceName": "Cheatography", "sourceUrl": "http://www.cheatography.com/mishin/cheat-sheets/perl-reference-card/" }, - "aliases": [ - "perl" - ], "template_type": "code", "section_order": ["Input/Output", "Scalars and Strings", "Arrays and Lists", "Hashes", "Basic Syntax", "References and Data Structures", "System Interaction"], "sections": { From 5bc805f1336a132ac2768c8daf679586a6350774 Mon Sep 17 00:00:00 2001 From: Mailkov Date: Sat, 12 Dec 2015 15:12:02 +0000 Subject: [PATCH 273/379] some changes --- share/goodie/chess960/chess960.js | 114 +++++++++++++----------------- 1 file changed, 48 insertions(+), 66 deletions(-) diff --git a/share/goodie/chess960/chess960.js b/share/goodie/chess960/chess960.js index 9b4432f5c..4cd056fd1 100644 --- a/share/goodie/chess960/chess960.js +++ b/share/goodie/chess960/chess960.js @@ -2,76 +2,58 @@ DDH.chess960 = DDH.chess960 || {}; (function(DDH) { "use strict"; - DDH.chess960.build = function(ops) { - // Global Variables Declaration - var squares, started; - var scheme = []; - var letters = ["H", "G", "F", "E", "D", "C", "B", "A"]; - var position = ops.data.position; + // Global Variables Declaration + var squares, started; + var scheme = []; + var letters = ["H", "G", "F", "E", "D", "C", "B", "A"]; + var obj = { "R" : 14, "N" : 16, "B" : 15, "Q" : 13, "K" : 12 }; + + // This function creates and prints on page chess board + function start() { + var nsquare = 63; + var squaresid = combination(); + squares.each(function(index) { + $(this).attr("id", squaresid[nsquare--]); + }); + drawPawns(); + drawPieces(); + } + + // This function creates the names of the squares e.g "A1" "B1" ... + function combination() { + var combinations = []; + for (var i = 1; i < 9; i++) { + for (var t = 0; t < letters.length; t++) { + combinations[(i - 1) * 8 + t] = letters[t] + i; + } + } + return combinations; + } + + function drawPawns() { + for (var i = 0; i < 8; i++) { + $("#" + letters[i] + "7 span").html("♟"); + $("#" + letters[i] + "2 span").html("♙"); + } + } + + function drawPieces() { + var codepiece; + for (var i = 0; i < 8; i++) { + codepiece = obj[ scheme[i] ]; + $("#" + letters[i] + "8 span").html("b" + (codepiece + 6) + ";"); + $("#" + letters[i] + "1 span").html("b" + codepiece + ";"); + } + } + + DDH.chess960.build = function(ops) { + + var position = ops.data.position; + for (var i = 0; i < position.length; i++) { scheme[7 - i] = position.substring(i, i + 1); } - - // This function creates and prints on page chess board - function start() { - var nsquare = 63; - var squaresid = combination(); - squares.each(function(index) { - $(this).attr("id", squaresid[nsquare--]); - }); - drawPawns(); - drawPieces(); - } - - // This function creates the names of the squares e.g "A1" "B1" ... - function combination() { - var combinations = []; - for (var i = 1; i < 9; i++) { - for (var t = 0; t < letters.length; t++) { - combinations[(i - 1) * 8 + t] = letters[t] + i; - } - } - return combinations; - } - - function drawPawns() { - for (var i = 0; i < 8; i++) { - $("#" + letters[i] + "7 span").html("♟"); - $("#" + letters[i] + "2 span").html("♙"); - } - } - - function drawPieces() { - var codepiece; - for (var i = 0; i < 8; i++) { - codepiece = getCodePiece(i); - $("#" + letters[i] + "8 span").html("b" + (codepiece + 6) + ";"); - $("#" + letters[i] + "1 span").html("b" + codepiece + ";"); - } - } - - function getCodePiece(i) { - var code; - switch (scheme[i]) { - case "R": - code = 14; - break; - case "N": - code = 16; - break; - case "B": - code = 15; - break; - case "Q": - code = 13; - break; - case "K": - code = 12; - break; - } - return code; - } return { onShow: function() { From 660a96331e38c9b890eb096e16e21dcab2b7298c Mon Sep 17 00:00:00 2001 From: Kevin Kwa Date: Sun, 13 Dec 2015 11:01:03 +0800 Subject: [PATCH 274/379] Add conditional statement --- lib/DDG/Goodie/Lowercase.pm | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/lib/DDG/Goodie/Lowercase.pm b/lib/DDG/Goodie/Lowercase.pm index 62b4f1281..0d09014f0 100644 --- a/lib/DDG/Goodie/Lowercase.pm +++ b/lib/DDG/Goodie/Lowercase.pm @@ -25,12 +25,16 @@ handle remainder => sub { my $lower = lc $input; - return $lower, - structured_answer => { - input => [html_enc($input)], - operation => 'Lowercase', - result => html_enc($lower) - }; + if ($lower eq $input) { + return; + } else { + return $lower, + structured_answer => { + input => [html_enc($input)], + operation => 'Lowercase', + result => html_enc($lower) + }; + } }; 1; From b2d930615d9701d89eca32a3e3347829cc784c62 Mon Sep 17 00:00:00 2001 From: Kevin Kwa Date: Sun, 13 Dec 2015 11:01:23 +0800 Subject: [PATCH 275/379] Lowercase: Update test cases --- t/Lowercase.t | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/t/Lowercase.t b/t/Lowercase.t index 458a6744a..42ea551f6 100644 --- a/t/Lowercase.t +++ b/t/Lowercase.t @@ -11,14 +11,8 @@ zci is_cached => 1; ddg_goodie_test( ['DDG::Goodie::Lowercase'], - 'lowercase foo' => test_zci( - 'foo', - structured_answer => { - input => ['foo'], - operation => 'Lowercase', - result => 'foo' - }, - ), + 'lowercase foo' => undef, + 'lowercase 123' => undef, 'lower case foO' => test_zci( 'foo', structured_answer => { From ddea5e6737e5589dbb4a1f4969929fd57bfe6f8a Mon Sep 17 00:00:00 2001 From: Kevin Kwa Date: Sun, 13 Dec 2015 17:30:04 +0800 Subject: [PATCH 276/379] Lowercase: Add mixed lowercase/numeric test case --- t/Lowercase.t | 1 + 1 file changed, 1 insertion(+) diff --git a/t/Lowercase.t b/t/Lowercase.t index 42ea551f6..d35c277b6 100644 --- a/t/Lowercase.t +++ b/t/Lowercase.t @@ -13,6 +13,7 @@ ddg_goodie_test( ['DDG::Goodie::Lowercase'], 'lowercase foo' => undef, 'lowercase 123' => undef, + 'lower case foo123' => undef, 'lower case foO' => test_zci( 'foo', structured_answer => { From c8591ec0ba5bbed8f435aa31e34f892cd99a99e1 Mon Sep 17 00:00:00 2001 From: Kevin Kwa Date: Sun, 13 Dec 2015 18:00:27 +0800 Subject: [PATCH 277/379] Bulgarian Cheatsheet: Add aliases --- share/goodie/cheat_sheets/bulgarian.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/share/goodie/cheat_sheets/bulgarian.json b/share/goodie/cheat_sheets/bulgarian.json index 85e89af8e..cfd0515a5 100644 --- a/share/goodie/cheat_sheets/bulgarian.json +++ b/share/goodie/cheat_sheets/bulgarian.json @@ -1,10 +1,14 @@ { "id" : "bulgarian_cheat_sheet", - "name" : "Bulgarian Phrases", + "name" : "Bulgarian Cheat Sheet", "metadata" : { "sourceName" : "Linguanaut", "sourceUrl" : "http://www.linguanaut.com/english_bulgarian.htm" }, + "aliases": [ + "bulgarian phrases", "english to bulgarian", "basic bulgarian phrases", "basic bulgarian" + ], + "template_type": "reference", "section_order" : [ "Basics", "Getting Help", From 85c02342e5fff7882a750404d232c13b40348761 Mon Sep 17 00:00:00 2001 From: Kevin Kwa Date: Sun, 13 Dec 2015 18:01:48 +0800 Subject: [PATCH 278/379] Bulgarian Cheatsheet: Place in json/language folder --- share/goodie/cheat_sheets/{ => json/language}/bulgarian.json | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename share/goodie/cheat_sheets/{ => json/language}/bulgarian.json (100%) diff --git a/share/goodie/cheat_sheets/bulgarian.json b/share/goodie/cheat_sheets/json/language/bulgarian.json similarity index 100% rename from share/goodie/cheat_sheets/bulgarian.json rename to share/goodie/cheat_sheets/json/language/bulgarian.json From 71b9af5a5b52ae1401186b88b06f77dd3cdaa290 Mon Sep 17 00:00:00 2001 From: Kevin Kwa Date: Sun, 13 Dec 2015 19:04:11 +0800 Subject: [PATCH 279/379] Lowercase: Refactor conditional logic --- lib/DDG/Goodie/Lowercase.pm | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/lib/DDG/Goodie/Lowercase.pm b/lib/DDG/Goodie/Lowercase.pm index 0d09014f0..acd220d6d 100644 --- a/lib/DDG/Goodie/Lowercase.pm +++ b/lib/DDG/Goodie/Lowercase.pm @@ -25,16 +25,14 @@ handle remainder => sub { my $lower = lc $input; - if ($lower eq $input) { - return; - } else { - return $lower, - structured_answer => { - input => [html_enc($input)], - operation => 'Lowercase', - result => html_enc($lower) - }; - } + return if ($lower eq $input); + + return $lower, + structured_answer => { + input => [html_enc($input)], + operation => 'Lowercase', + result => html_enc($lower) + }; }; 1; From a027440d9818e0cc0802f06b344094dba4e3d355 Mon Sep 17 00:00:00 2001 From: Kevin Kwa Date: Sun, 13 Dec 2015 19:55:53 +0800 Subject: [PATCH 280/379] Constants: Update IA description --- lib/DDG/Goodie/Constants.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/DDG/Goodie/Constants.pm b/lib/DDG/Goodie/Constants.pm index 7a42d37cb..8825614f4 100644 --- a/lib/DDG/Goodie/Constants.pm +++ b/lib/DDG/Goodie/Constants.pm @@ -7,23 +7,23 @@ zci answer_type => "constants"; zci is_cached => 1; name "Constants"; -description "Succinct explanation of what this instant answer does"; +description "Provides the value, unit, symbol and other information for Mathematical and Scientific constants"; primary_example_queries "first example query", "second example query"; secondary_example_queries "optional -- demonstrate any additional triggers"; category "formulas"; topics "math"; code_url "https://github.com/duckduckgo/zeroclickinfo-goodies/blob/master/lib/DDG/Goodie/Constants.pm"; -attribution github => ["Roysten", "Roy van der Vegt"], +attribution github => ["Roysten", "Roy van der Vegt"], github => ["hemanth", "Hemanth.HM"], twitter => "gnumanth"; - + my $constants = LoadFile(share("constants.yml")); #loop through constants foreach my $name (keys %$constants) { #obtain to constant with name $keyword my $constant = $constants->{$name}; - + #add aliases as separate triggers foreach my $alias (@{$constant->{'aliases'}}) { $constants->{$alias} = $constant; @@ -37,7 +37,7 @@ triggers startend => @triggers; handle query_lc => sub { my $constant = $constants->{$_}; return unless my $val = $constant->{'value'}; - + #fallback to plain answer if html is not present my $result = $val->{'html'} ? $val->{'html'} : $val->{'plain'}; From 940d3cb4d84113ed7e09d9c400523a644677cefc Mon Sep 17 00:00:00 2001 From: "Gautam krishna.R" Date: Sun, 13 Dec 2015 18:19:53 +0530 Subject: [PATCH 281/379] Update apple-mac-os.json Bug fixes --- share/goodie/cheat_sheets/json/apple-mac-os.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/share/goodie/cheat_sheets/json/apple-mac-os.json b/share/goodie/cheat_sheets/json/apple-mac-os.json index 31d82fe3c..8d5ee6c20 100644 --- a/share/goodie/cheat_sheets/json/apple-mac-os.json +++ b/share/goodie/cheat_sheets/json/apple-mac-os.json @@ -21,7 +21,7 @@ "Spotlight", "Text Editing", "Screenshots (Hold Ctrl to copy screenshot to the clipboard)", - "Web Browsing" + "Web Browsing (Works on most modern browsers)" ], "sections": { "General": [ @@ -84,7 +84,7 @@ "val": "Delete selected folder or file" }, { - "key": "([Return]/[Enter])", + "key": "([Return] / [Enter])", "val": "Rename the selected file/folder" }, { @@ -188,7 +188,7 @@ "val": "Go to end of next word" } ], - "Screenshots (Hold Ctrl with any of these to copy screenshot to clipboard)": [ + "Screenshots (Hold Ctrl to copy screenshot to the clipboard)": [ { "key": "[⌘] [Shift] [3]", "val": "Take picture of the entire screen" @@ -237,4 +237,4 @@ } ] } -} \ No newline at end of file +} From 66c9a1d5d22e4feb23b8cb0de82c1bce16c91d15 Mon Sep 17 00:00:00 2001 From: Zac Pappis Date: Sun, 13 Dec 2015 19:20:32 -0500 Subject: [PATCH 282/379] update contributing.md --- CONTRIBUTING.md | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ae5e5eae7..c7bc877fa 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -8,31 +8,15 @@ You can always find the [Instant Answer Documentation here](https://duck.co/duck - [Slack](https://duckduckhack.slack.com) - For access, please send an email to quackslack@duckduckgo.com - Do not hesitate to email us directly at open@duckduckgo.com. -## New? Make Your First Contribution Today - -If this is your first time contributing to [DuckDuckHack](http://www.duckduckhack.com), you have two great ways to quickly make your first commit: - -- **Make a [Cheat Sheet](https://duck.co/duckduckhack/goodie_cheat_sheets)** - - Cheat sheets are a super-easy way to contribute to the live DuckDuckGo AnswerBar very quickly, by editing a single file. Cheat sheets can be about anything, from Emacs and Vim to Game of Thrones house names or wine pairings. - -- **Create a simple, complete "Hello World" Goodie with our [Quick Start Tutorial](https://duck.co/duckduckhack/goodie_quickstart)** - - This short tutorial will lead you through all the parts of building a full-loop Goodie. This is a perfect place to start if you have an idea for an original Instant Answer. ## Create a New Instant Answer -Once you're comfortable with the workflow and how Goodies work, we're excited to have you create your own original Instant Answer. -**1. Choose an idea** - -Bring your own idea, or check out the ideas forum - especially [top voted answer ideas](https://duck.co/ideas/status/3?table_lnKRpLENwO2NUmZUyukQpw_sort=votes). - -**2. Plan your implementation** +**1. Plan your implementation** The first step is to research and plan your Instant Answer. Consider [the best way to implement](https://duck.co/duckduckhack/determine_your_instant_answer_type) your idea, and review the [docs and guidelines](https://duck.co/duckduckhack/ddh-intro) that apply. -**3. Involve us** +**2. Involve us** Before you start coding, [let us know your plans](mailto:open@duckduckgo.com). By involving us early we can provide guidance and potentially save you a lot of time and effort. Email us at [open@duckduckgo.com](mailto:open@duckduckgo.com) with what idea you're working on and how you're thinking of going about it. From f6b95d635d12957071beb05559ec6910a8e7ec6b Mon Sep 17 00:00:00 2001 From: mohan08p Date: Mon, 14 Dec 2015 04:11:03 +0000 Subject: [PATCH 283/379] Ambiguous fields removed. --- share/goodie/cheat_sheets/json/language/malayalam.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/goodie/cheat_sheets/json/language/malayalam.json b/share/goodie/cheat_sheets/json/language/malayalam.json index a7a083467..92c63d734 100644 --- a/share/goodie/cheat_sheets/json/language/malayalam.json +++ b/share/goodie/cheat_sheets/json/language/malayalam.json @@ -1,12 +1,13 @@ { "id" : "malayalam_cheat_sheet", "name" : "Malayalam Cheat Sheet", + "description" : "Basic Malayalam words and phrases", "metadata" : { "sourceName" : "Pravasi Malayalam", "sourceUrl" : "http://www.pravasimalayalam.com/index.shtml" }, "aliases": [ - "malayalam", "malayalam phrases", "Malayalam phrases", "english to malayalam", + "malayalam phrases", "english to malayalam", "basic malayalam phrases", "basic malayalam" ], "template_type": "language", @@ -17,7 +18,6 @@ "Travelling", "Going out for dinner" ], - "description" : "Basic Malayalam words and phrases", "sections" : { "Etiquette" : [ { From b764142570ff3e147ec4e0fd704bee395d7b985f Mon Sep 17 00:00:00 2001 From: tagawa Date: Tue, 15 Dec 2015 05:49:48 +0000 Subject: [PATCH 284/379] StarCraft2: Fixed capitalisation and added aliases --- share/goodie/cheat_sheets/json/starcraft2.json | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/share/goodie/cheat_sheets/json/starcraft2.json b/share/goodie/cheat_sheets/json/starcraft2.json index 906fb6b25..ff8bf7721 100644 --- a/share/goodie/cheat_sheets/json/starcraft2.json +++ b/share/goodie/cheat_sheets/json/starcraft2.json @@ -1,13 +1,16 @@ { "id": "starcraft2_cheat_sheet", - "name": "Starcraft 2", - "description": "Cheat codes for the campaign and offline custom games of Starcraft 2", + "name": "StarCraft 2", + "description": "Cheat codes for the campaign and offline custom games of StarCraft 2", "metadata": { "sourceName": "Battle.net Cheats", "sourceUrl": "http://us.battle.net/sc2/en/blog/9135373/game-guide-starcraft-ii-cheat-codes-3-1-2012" }, "aliases": [ "starcraft 2", + "star craft 2", + "starcraft ii", + "star craft ii", "sc2" ], "template_type": "reference", From e4696f00f059e693df2a18315b526083b64281ba Mon Sep 17 00:00:00 2001 From: jonk1993 Date: Tue, 15 Dec 2015 06:26:53 +0000 Subject: [PATCH 285/379] included anchors in regex so longer expressions do not trigger LaserShip IA --- lib/DDG/Goodie/LaserShip.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/DDG/Goodie/LaserShip.pm b/lib/DDG/Goodie/LaserShip.pm index 99a2e877c..807d40390 100644 --- a/lib/DDG/Goodie/LaserShip.pm +++ b/lib/DDG/Goodie/LaserShip.pm @@ -15,7 +15,7 @@ category 'ids'; topics 'special_interest'; attribution github => [ 'https://github.com/duckduckgo', 'duckduckgo']; -triggers query_nowhitespace_nodash => qr/(l[a-z]\d{8})/i; +triggers query_nowhitespace_nodash => qr/(^l[a-z]\d{8}$)/i; handle query_nowhitespace_nodash => sub { return $1, heading => "Lasership Shipment Tracking", html => qq(Track this shipment at Lasership.) if $1; From 93313f1192a5208d104d3a10e2a8920d0a9a73fa Mon Sep 17 00:00:00 2001 From: ankushg07 Date: Tue, 15 Dec 2015 07:29:34 +0000 Subject: [PATCH 286/379] Few Text Edititng --- .../{kde-keyboard.json => kde.json} | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) rename share/goodie/cheat_sheets/{kde-keyboard.json => kde.json} (80%) diff --git a/share/goodie/cheat_sheets/kde-keyboard.json b/share/goodie/cheat_sheets/kde.json similarity index 80% rename from share/goodie/cheat_sheets/kde-keyboard.json rename to share/goodie/cheat_sheets/kde.json index 89ee62671..5c648b738 100644 --- a/share/goodie/cheat_sheets/kde-keyboard.json +++ b/share/goodie/cheat_sheets/kde.json @@ -1,20 +1,17 @@ { - "id": "kde_keyboard_cheat_sheet", - "name": "KDE Keyboard Shortcuts", - "description": "List of useful keyboard shortcuts for KDE", + "id": "kde_cheat_sheet", + "name": "KDE", + "description": "List of useful keyboard commands for KDE", "metadata": { "sourceName": "KDE Help", "sourceUrl": "http://community.linuxmint.com/tutorial/view/47" }, "template_type": "keyboard", - "section_order": ["Desktop Navigation", "Desktop Shortcuts", "ScreenShot" , "Web Browser" , "Tab Management"], + "section_order": ["Desktop Navigation", "Desktop Commands", "ScreenShot" , "Web Browser" , "Tab Management"], "sections": { "Desktop Navigation": [{ "val": "Start menu / Access applications", "key": "[Alt] [F1]" - }, { - "val": "Pop up new window", - "key": "[Alt] [F2]" }, { "val": "Lock desktop / Switch active user", "key": "[Ctrl] [Alt] [L]" @@ -28,7 +25,7 @@ "val": "Rename file", "key": "F2" }], - "Desktop Shortcuts": [{ + "Desktop Commands": [{ "val": "File menu", "key": "[Alt] [F]" }, { @@ -57,17 +54,20 @@ "Web Browser": [{ "val": "Bookmarks menu", "key": "[Alt] [B]" + },{ + "val": "Pop up new window", + "key": "[Alt] [F2]" }, { - "val": "URL Shortcuts (Adds www. + .com)", + "val": "Insert (www.) + (.com)", "key": "[Ctrl] [Enter]" }, { - "val": "URL Shortcuts (Adds www. + .org)", + "val": "Insert (www.) + (.org)", "key": "[Ctrl] [Shift] [Enter]" }, { - "val": "URL Shortcuts (Adds www. + .net)", + "val": "Insert (www.) + (.net)", "key": "[Shift] [Enter]" }, { - "val": "Add a bookmark for the current location", + "val": "Add a bookmark for the current URL", "key": "[Ctrl] [B]" }, { "val": "Manage bookmarks", From 2265f67bcf3d0dc9dec3649c5f8e4bcce5e67929 Mon Sep 17 00:00:00 2001 From: Zac Pappis Date: Tue, 15 Dec 2015 19:54:49 -0500 Subject: [PATCH 287/379] final quick update --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c7bc877fa..01d062a1e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ # Contribute to Goodie Instant Answers -There are several options for contributing Goodie Instant Answers, explained below. +You don't need to use perl to contribute Goodie Instant Answers. You can always find the [Instant Answer Documentation here](https://duck.co/duckduckhack/ddh-intro). Also, if you have any questions at any point, feel free to ask on one of our community channels: From 7046cbec6ea5d34799189727b5f4bfa84ee878ac Mon Sep 17 00:00:00 2001 From: jonk1993 Date: Wed, 16 Dec 2015 05:06:22 +0000 Subject: [PATCH 288/379] included test case for erroneous longer queries --- t/LaserShip.t | 1 + 1 file changed, 1 insertion(+) diff --git a/t/LaserShip.t b/t/LaserShip.t index 323cb2ac5..11df69b33 100644 --- a/t/LaserShip.t +++ b/t/LaserShip.t @@ -20,6 +20,7 @@ ddg_goodie_test( heading => 'Lasership Shipment Tracking', html => qq(Track this shipment at Lasership.) ), + '1LS12345678999999999' => undef ); done_testing; From 38a433b86172349f8be112631681e2bb97b0d04c Mon Sep 17 00:00:00 2001 From: tagawa Date: Wed, 16 Dec 2015 05:15:31 +0000 Subject: [PATCH 289/379] vcgencmd: Updated aliases --- share/goodie/cheat_sheets/json/vcgencmd.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/share/goodie/cheat_sheets/json/vcgencmd.json b/share/goodie/cheat_sheets/json/vcgencmd.json index e29c387f8..f5170226a 100644 --- a/share/goodie/cheat_sheets/json/vcgencmd.json +++ b/share/goodie/cheat_sheets/json/vcgencmd.json @@ -7,7 +7,8 @@ "sourceUrl": "http://elinux.org/RPI_vcgencmd_usage" }, "aliases": [ - "vcgencmd" + "raspberry pi firmware", + "raspi firmware" ], "template_type": "terminal", "section_order": [ From a564566680f69826aba062b5e65bbf30aad205ac Mon Sep 17 00:00:00 2001 From: "Gautam krishna.R" Date: Wed, 16 Dec 2015 17:29:38 +0530 Subject: [PATCH 290/379] Added markdown cheatsheet --- share/goodie/cheat_sheets/json/markdown.json | 153 +++++++++++++++++++ 1 file changed, 153 insertions(+) create mode 100644 share/goodie/cheat_sheets/json/markdown.json diff --git a/share/goodie/cheat_sheets/json/markdown.json b/share/goodie/cheat_sheets/json/markdown.json new file mode 100644 index 000000000..29c731810 --- /dev/null +++ b/share/goodie/cheat_sheets/json/markdown.json @@ -0,0 +1,153 @@ +{ + "id": "markdown_cheat_sheet", + "name": "Markdown cheat sheet", + "description": "Markdown is a lightweight markup language with plain text formatting syntax designed so that it can be converted to HTML", + "metadata": { + "sourceName": "GitHub", + "sourceUrl": "https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet" + }, + "aliases": [ + "md", + "markdown language" + ], + "template_type": "terminal", + "section_order": [ + "Headers", + "Emphasis", + "Lists", + "Links", + "Imaages", + "Code and Syntax Highlighting", + "Blockquotes", + "Inline HTML", + "Horizontal Rule" + ], + "sections": { + "Headers": [ + { + "key": "# Heading", + "val": "H1" + }, + { + "key": "## Heading", + "val": "H2" + }, + { + "key": "### Heading", + "val": "H3" + }, + { + "key": "#### Heading", + "val": "H4" + }, + { + "key": "##### Heading", + "val": "H5" + } + ], + "Emphasis": [ + { + "key": "* Text *", + "val": "Displays text in Italics" + }, + { + "key": "** Text **", + "val": "Displays the text in bold" + }, + { + "key": "** _Texe_ ** ", + "val": "Displays the text in bold and italics" + }, + { + "key": "~~ Text ~~", + "val": "Adds strikethrough effect to the text" + } + ], + "Lists": [ + { + "key": "1. item1", + "val": "First ordered list item" + }, + { + "key": "2. item2", + "val": "Second ordered list item" + }, + { + "key": "⋅⋅1. Item", + "val": "Ordered sub-list item" + }, + { + "key": "* Item", + "val": "Unordered list item" + }, + { + "key": "⋅⋅* Item", + "val": "⋅Unordered sub-list item" + }, + { + "key": "DEL", + "val": "Delete files or directory" + }, + { + "key": "RMDIR", + "val": "Removes a directory" + } + ], + "Links": [ + { + "key": "[I'm an inline-style link](https://www.duckduckgo.com)", + "val": "Inline-style link" + }, + { + "key": "[I'm an inline-style link with title](https://www.google.com \"Google's Homepage\")", + "val": "Inline-style link with title" + }, + { + "key": "[I'm a reference-style link][Arbitrary case-insensitive reference text]", + "val": "Reference style lnik" + }, + { + "key": "[You can use numbers for reference-style link definitions][1]", + "val": "Liks with a reference number. The number eeds to be defined as [1]: http://slashdot.org" + } + ], + "Images": [ + { + "key": "![alt text](https://github.com/adam-p/markdown-here/raw/master/src/common/images/icon48.png \"Logo Title Text 1\")", + "val": "Inline style" + }, + { + "key": "[alt text][logo]", + "val": "The reference style. Reference need to be declared as [logo]: https://github.com/adam-p/markdown-here/raw/master/src/common/images/icon48.png \"Logo Title Text 2\"" + } + ], + "Code and Syntax Highlighting": [ + { + "key": "`code`", + "val": "Inline code has back-ticks around it." + }, + { + "key": "``` Code blocks ```", + "val": "Blocks of code are either fenced by lines with three back-ticks or are indented with four spaces" + } + ], + "Blockquotes": [ + { + "key": "> Blockquotes", + "val": "> Blockquotes are very handy in email to emulate reply text." + } + ], + "Inline HTML": [ + { + "key": "
    list
", + "val": "You can use the raw HTML in your Markdown " + } + ], + "Horizontal Rule": [ + { + "key": "---", + "val": "You can get a horizontal rule by typing three or more Hyphens or Asterisks or Underscores" + } + ] + } +} From 47ce5b5dc0b045668fd49508cb35c8f78e641295 Mon Sep 17 00:00:00 2001 From: "Gautam krishna.R" Date: Wed, 16 Dec 2015 17:41:06 +0530 Subject: [PATCH 291/379] Update markdown.json --- share/goodie/cheat_sheets/json/markdown.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/goodie/cheat_sheets/json/markdown.json b/share/goodie/cheat_sheets/json/markdown.json index 29c731810..203a3b667 100644 --- a/share/goodie/cheat_sheets/json/markdown.json +++ b/share/goodie/cheat_sheets/json/markdown.json @@ -108,7 +108,7 @@ }, { "key": "[You can use numbers for reference-style link definitions][1]", - "val": "Liks with a reference number. The number eeds to be defined as [1]: http://slashdot.org" + "val": "Links with a reference number. The number eeds to be defined as [1]: http://slashdot.org" } ], "Images": [ From 0fa689310826d1d3a656a4169ff3343e7dabe5b6 Mon Sep 17 00:00:00 2001 From: "Gautam krishna.R" Date: Wed, 16 Dec 2015 18:28:08 +0530 Subject: [PATCH 292/379] fixed some issues --- share/goodie/cheat_sheets/json/markdown.json | 26 +++++++------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/share/goodie/cheat_sheets/json/markdown.json b/share/goodie/cheat_sheets/json/markdown.json index 203a3b667..9d6fd95a0 100644 --- a/share/goodie/cheat_sheets/json/markdown.json +++ b/share/goodie/cheat_sheets/json/markdown.json @@ -83,42 +83,34 @@ { "key": "⋅⋅* Item", "val": "⋅Unordered sub-list item" - }, - { - "key": "DEL", - "val": "Delete files or directory" - }, - { - "key": "RMDIR", - "val": "Removes a directory" } ], "Links": [ { - "key": "[I'm an inline-style link](https://www.duckduckgo.com)", + "key": "\\[I'm an inline-style link\\](https://www.duckduckgo.com)", "val": "Inline-style link" }, { - "key": "[I'm an inline-style link with title](https://www.google.com \"Google's Homepage\")", + "key": "\\[I'm an inline-style link with title\\](https://www.google.com \"Google's Homepage\")", "val": "Inline-style link with title" }, { - "key": "[I'm a reference-style link][Arbitrary case-insensitive reference text]", + "key": "\\[I'm a reference-style link\\]\\[Arbitrary case-insensitive reference text\\]", "val": "Reference style lnik" }, { - "key": "[You can use numbers for reference-style link definitions][1]", - "val": "Links with a reference number. The number eeds to be defined as [1]: http://slashdot.org" + "key": "\\[You can use numbers for reference-style link definitions\\]\\[1\\]", + "val": "Links with a reference number. The number eeds to be defined as \\[1\\]: http://slashdot.org" } ], "Images": [ { - "key": "![alt text](https://github.com/adam-p/markdown-here/raw/master/src/common/images/icon48.png \"Logo Title Text 1\")", + "key": "!\\[alt text\\](https://github.com/adam-p/markdown-here/raw/master/src/common/images/icon48.png \"Logo Title Text 1\")", "val": "Inline style" }, { - "key": "[alt text][logo]", - "val": "The reference style. Reference need to be declared as [logo]: https://github.com/adam-p/markdown-here/raw/master/src/common/images/icon48.png \"Logo Title Text 2\"" + "key": "\\[alt text\\][logo\\]", + "val": "The reference style. Reference need to be declared as \\[logo\\]: https://github.com/adam-p/markdown-here/raw/master/src/common/images/icon48.png \"Logo Title Text 2\"" } ], "Code and Syntax Highlighting": [ @@ -134,7 +126,7 @@ "Blockquotes": [ { "key": "> Blockquotes", - "val": "> Blockquotes are very handy in email to emulate reply text." + "val": "Blockquotes are very handy in email to emulate reply text." } ], "Inline HTML": [ From 8eadbe57cc334b155641a96f329c16fb3f2f4741 Mon Sep 17 00:00:00 2001 From: "Gautam krishna.R" Date: Wed, 16 Dec 2015 18:37:32 +0530 Subject: [PATCH 293/379] Update markdown.json --- share/goodie/cheat_sheets/json/markdown.json | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/share/goodie/cheat_sheets/json/markdown.json b/share/goodie/cheat_sheets/json/markdown.json index 9d6fd95a0..5d17bcabf 100644 --- a/share/goodie/cheat_sheets/json/markdown.json +++ b/share/goodie/cheat_sheets/json/markdown.json @@ -1,7 +1,7 @@ { "id": "markdown_cheat_sheet", - "name": "Markdown cheat sheet", - "description": "Markdown is a lightweight markup language with plain text formatting syntax designed so that it can be converted to HTML", + "name": "Markdown", + "description": "It is a lightweight markup language with plain text formatting syntax designed so that it can be converted to HTML", "metadata": { "sourceName": "GitHub", "sourceUrl": "https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet" @@ -16,7 +16,7 @@ "Emphasis", "Lists", "Links", - "Imaages", + "Images", "Code and Syntax Highlighting", "Blockquotes", "Inline HTML", @@ -48,7 +48,7 @@ "Emphasis": [ { "key": "* Text *", - "val": "Displays text in Italics" + "val": "Displays text in italics" }, { "key": "** Text **", @@ -82,7 +82,7 @@ }, { "key": "⋅⋅* Item", - "val": "⋅Unordered sub-list item" + "val": "Unordered sub-list item" } ], "Links": [ @@ -96,11 +96,11 @@ }, { "key": "\\[I'm a reference-style link\\]\\[Arbitrary case-insensitive reference text\\]", - "val": "Reference style lnik" + "val": "Reference style link" }, { "key": "\\[You can use numbers for reference-style link definitions\\]\\[1\\]", - "val": "Links with a reference number. The number eeds to be defined as \\[1\\]: http://slashdot.org" + "val": "Links with a reference number. The number needs to be defined as \\[1\\]: http://slashdot.org" } ], "Images": [ @@ -116,7 +116,7 @@ "Code and Syntax Highlighting": [ { "key": "`code`", - "val": "Inline code has back-ticks around it." + "val": "Inline code has back-ticks around it" }, { "key": "``` Code blocks ```", @@ -126,13 +126,13 @@ "Blockquotes": [ { "key": "> Blockquotes", - "val": "Blockquotes are very handy in email to emulate reply text." + "val": "Blockquotes are very handy in email to emulate reply text" } ], "Inline HTML": [ { "key": "
    list
", - "val": "You can use the raw HTML in your Markdown " + "val": "You can use the raw HTML in your Markdown" } ], "Horizontal Rule": [ From 7d27955054d1e891c3a535311e00c775d95cc794 Mon Sep 17 00:00:00 2001 From: "Gautam krishna.R" Date: Wed, 16 Dec 2015 18:51:35 +0530 Subject: [PATCH 294/379] Update markdown.json --- share/goodie/cheat_sheets/json/markdown.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/goodie/cheat_sheets/json/markdown.json b/share/goodie/cheat_sheets/json/markdown.json index 5d17bcabf..d429489c8 100644 --- a/share/goodie/cheat_sheets/json/markdown.json +++ b/share/goodie/cheat_sheets/json/markdown.json @@ -1,7 +1,7 @@ { "id": "markdown_cheat_sheet", "name": "Markdown", - "description": "It is a lightweight markup language with plain text formatting syntax designed so that it can be converted to HTML", + "description": "A lightweight markup language with plain text formatting syntax designed so that it can be converted to HTML", "metadata": { "sourceName": "GitHub", "sourceUrl": "https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet" From cc3246069ba0e45b53f8d0a37d3f9fc4bda851d7 Mon Sep 17 00:00:00 2001 From: mysskin Date: Wed, 16 Dec 2015 20:01:36 +0530 Subject: [PATCH 295/379] Update rust-types.json --- .../goodie/cheat_sheets/json/rust-types.json | 36 ++++++++++--------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/share/goodie/cheat_sheets/json/rust-types.json b/share/goodie/cheat_sheets/json/rust-types.json index cdb6e47cf..811f1b794 100644 --- a/share/goodie/cheat_sheets/json/rust-types.json +++ b/share/goodie/cheat_sheets/json/rust-types.json @@ -3,9 +3,13 @@ "name": "Rust Types", "description": "Rust Language object types", "metadata": { - "sourceName": "The Rust Reference", + "sourceName": "Rust Lang", "sourceUrl": "https://doc.rust-lang.org/stable/reference.html#types" }, + "aliases": [ + "rust objects", + "rust object types" + ], "section_order": [ "Primitive Types", "Machine Types", @@ -22,7 +26,7 @@ "Primitive Types": [ { "key": "bool", - "val": "boolean, true or false" + "val": "Boolean, True or False" } ], "Machine Types": [ @@ -62,37 +66,37 @@ "Machine-dependent Integer Types": [ { "key": "usize", - "val": "Unsigned integer type with the same number of bits as the platform's pointer type." + "val": "Unsigned integer type with the same number of bits as the platform's pointer type" }, { "key": "isize", - "val": "Signed integer type with the same number of bits as the platform's pointer type." + "val": "Signed integer type with the same number of bits as the platform's pointer type" } ], "Textual Types": [ { "key": "char", - "val": "A Unicode scalar value (i.e. a code point that is not a surrogate), represented as a 32-bit unsigned word in the 0x0000 to 0xD7FF or 0xE000 to 0x10FFFF range." + "val": "A Unicode scalar value (i.e. a code point that is not a surrogate), represented as a 32-bit unsigned word in the 0x0000 to 0xD7FF or 0xE000 to 0x10FFFF range" }, { "key": "str", - "val": "Unicode string, represented as an array of 8-bit unsigned bytes holding a sequence of UTF-8 code points." + "val": "Unicode string, represented as an array of 8-bit unsigned bytes holding a sequence of UTF-8 code points" } ], "Tuple Types": [ { "key": "tuple", - "val": "Tuple types and values are denoted by listing the types or values of their elements, respectively, in a parenthesized, comma-separated list." + "val": "Tuple types and values are denoted by listing the types or values of their elements, respectively, in a parenthesized, comma-separated list" } ], "Array and Slice Types": [ { "key": "array", - "val": "An array has a fixed size, and can be allocated on either the stack or the heap." + "val": "An array has a fixed size, and can be allocated on either the stack or the heap" }, { "key": "slice", - "val": "A slice is a 'view' into an array. It doesn't own the data it points to, it borrows it." + "val": "A slice is a 'view' into an array. It doesn't own the data it points to, it borrows it" }, { "key": "vector", @@ -102,35 +106,35 @@ "Structure Types": [ { "key": "struct", - "val": "The memory layout of a struct is undefined by default to allow for compiler optimizations like field reordering, but it can be fixed with the #[repr(...)] attribute." + "val": "The memory layout of a struct is undefined by default to allow for compiler optimizations like field reordering, but it can be fixed with the #[repr(...)] attribute" }, { "key": "tuple struct", - "val": "Just like a structure type, except that the fields are anonymous." + "val": "Just like a structure type, except that the fields are anonymous" }, { "key": "unit-like struct", - "val": "Like a structure type, except that it has no fields. The one value constructed by the associated structure expression is the only value that inhabits such a type." + "val": "Like a structure type, except that it has no fields. The one value constructed by the associated structure expression is the only value that inhabits such a type" } ], "Enumerated Types": [ { "key": "enumerated type", - "val": "A nominal, heterogeneous disjoint union type, denoted by the name of an enum item. " + "val": "A nominal, heterogeneous disjoint union type, denoted by the name of an enum item" }, { "key": "enum item", - "val": "Declares both the type and a number of variant constructors, each of which is independently named and takes an optional tuple of arguments." + "val": "Declares both the type and a number of variant constructors, each of which is independently named and takes an optional tuple of arguments" } ], "Pointer Types": [ { "key": "reference (&)", - "val": "Point to memory owned by some other value." + "val": "Point to memory owned by some other value" }, { "key": "raw (*)", - "val": "Pointers without safety or liveness guarantees." + "val": "Pointers without safety or liveness guarantees" } ] } From ae1a446468ab9e159864c0fd3459f613fb18a083 Mon Sep 17 00:00:00 2001 From: "Gautam krishna.R" Date: Thu, 17 Dec 2015 01:01:45 +0530 Subject: [PATCH 296/379] Update markdown.json --- share/goodie/cheat_sheets/json/markdown.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/goodie/cheat_sheets/json/markdown.json b/share/goodie/cheat_sheets/json/markdown.json index d429489c8..9a8e494a3 100644 --- a/share/goodie/cheat_sheets/json/markdown.json +++ b/share/goodie/cheat_sheets/json/markdown.json @@ -138,7 +138,7 @@ "Horizontal Rule": [ { "key": "---", - "val": "You can get a horizontal rule by typing three or more Hyphens or Asterisks or Underscores" + "val": "You can get a horizontal rule by typing three or more hyphens (-), asterisks (*) or underscore (_)" } ] } From 265e990950c1911c8f90730e434c90b855b71835 Mon Sep 17 00:00:00 2001 From: mohan08p Date: Thu, 17 Dec 2015 14:42:50 +0000 Subject: [PATCH 297/379] changed according to original source --- share/goodie/cheat_sheets/json/mongodb.json | 36 ++++++++++++--------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/share/goodie/cheat_sheets/json/mongodb.json b/share/goodie/cheat_sheets/json/mongodb.json index 04441934b..a23ac1a4a 100644 --- a/share/goodie/cheat_sheets/json/mongodb.json +++ b/share/goodie/cheat_sheets/json/mongodb.json @@ -213,31 +213,31 @@ "Pipeline Stages": [ { "key": "$project", - "val": "Change the set of documents by modifying keys and values. This is a 1:1 mapping." + "val": "Reshapes each document in the stream (add or remove) and for each input document, outputs one document." }, { "key": "$match", - "val": "This is a filtering operation and thus this can reduce the amount of documents that are given as input to the next stage. This can be used for example if aggregation should only happen on a subset of the data." + "val": "Filters the document stream to allow only matching documents to pass and for each input document, outputs either one document (a match) or zero documents (no match)." }, { "key": "$group", - "val": "This does the actual aggregation and as we are grouping by one or more keys this can have a reducing effect on the amount of documents." + "val": "Groups input documents by a specified identifier expression and applies the accumulator expression(s) on all input documents and outputs single document." }, { "key": "$sort", - "val": "Sorting the documents one way or the other for the next stage. It should be noted that this might use a lot of memory. Thus if possible one should always try to reduce the amount of documents first." + "val": "Reorders the document stream by a specified sort key. For each input document, outputs one document." }, { "key": "$skip", - "val": "With this it is possible to skip forward in the list of documents for a given amount of documents. This allows for example starting only from the 10th document. Typically this will be used together with “$sort” and especially together with “$limit”." + "val": "Skips the first n documents where n is the specified skip number and passes the remaining documents unmodified to the pipeline." }, { "key": "$limit", - "val": "This limits the amount of documents to look at by the given number starting from the current position." + "val": "Passes the first n documents unmodified to the pipeline where n is the specified limit." }, { "key": "$unwind", - "val": "This is used to unwind document that are using arrays. When using an array the data is kind of pre-joined and this operation will be undone with this to have individual documents again. Thus with this stage we will increase the amount of documents for the next stage." + "val": "Deconstructs an array field from the input documents to output a document for each element. For each input document, outputs n documents where n is the number of array elements and can be zero for an empty array." } ], "Comparison with SQL": [ @@ -285,7 +285,7 @@ }, { "key": "Arbiter", - "val": "Arbiter nodes are only there for voting purposes. They can be used to ensure that there is a certain amount of nodes in a replica set even though there are not that many physical servers." + "val": "Arbiter nodes are only there for voting purposes and to ensure that number of nodes, even not that physical servers." }, { "key": "Delayed", @@ -324,20 +324,24 @@ ], "Durability of Writes": [ { - "key": "w=0 && j=0", - "val": "This is “fire and forget”." + "key": "\\{ w: , j: , wtimeout: \\}", + "val": "The w option to request acknowledgment that the write operation has propagated to a specified number of mongod instances. j, write operation written to the journal and wtimeout prevent write from blocking indefinitely." }, { - "key": "w=1 && j=0", - "val": "Waits for an acknowledgement that the write was received and no indexes have been violated. Data can still be lost." + "key": "w : 1", + "val": "Requests acknowledgement that the write operation has propagated to the standalone mongod and is the default write concern for MongoDB." }, { - "key": "w=1 && j=1", - "val": "The most save configuration by waiting for the write to the journal to be completed" + "key": "w : 0", + "val": "Requests no acknowledgment of the write operation. It might return information about socket exceptions and networking errors to the application." }, { - "key": "w=0 && j=1", - "val": "Basically as same as above." + "key": "w : 0 && j : true", + "val": "It prevails to request acknowledgement from the standalone mongod or the primary of a replica set." + }, + { + "key": "w : \"majority\"", + "val": "It implies j: true. Along, the primary also writes to the on-disk journal before acknowledging the write." } ] } From a4a3d73c05fe24a67fb9ca6b48ae9cc0ddc24c8b Mon Sep 17 00:00:00 2001 From: "Gautam krishna.R" Date: Thu, 17 Dec 2015 21:29:25 +0530 Subject: [PATCH 298/379] Update markdown.json --- share/goodie/cheat_sheets/json/markdown.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/share/goodie/cheat_sheets/json/markdown.json b/share/goodie/cheat_sheets/json/markdown.json index 9a8e494a3..437005791 100644 --- a/share/goodie/cheat_sheets/json/markdown.json +++ b/share/goodie/cheat_sheets/json/markdown.json @@ -87,25 +87,25 @@ ], "Links": [ { - "key": "\\[I'm an inline-style link\\](https://www.duckduckgo.com)", + "key": "\\[link text\\](https://duckduckgo.com)", "val": "Inline-style link" }, { - "key": "\\[I'm an inline-style link with title\\](https://www.google.com \"Google's Homepage\")", + "key": "\\[link text\\](https://duckduckgo.com \"DDG Home\")", "val": "Inline-style link with title" }, { - "key": "\\[I'm a reference-style link\\]\\[Arbitrary case-insensitive reference text\\]", + "key": "\\[Reference-style link\\]\\[Arbitrary case-insensitive reference text\\]", "val": "Reference style link" }, { - "key": "\\[You can use numbers for reference-style link definitions\\]\\[1\\]", + "key": "\\[Use numbers for reference-style link definitions\\]\\[1\\]", "val": "Links with a reference number. The number needs to be defined as \\[1\\]: http://slashdot.org" } ], "Images": [ { - "key": "!\\[alt text\\](https://github.com/adam-p/markdown-here/raw/master/src/common/images/icon48.png \"Logo Title Text 1\")", + "key": "!\\[alt text\\](https://github.com/n48.png \"Logo Title\")", "val": "Inline style" }, { From 28f1ac05f643cdca2d2b88d51d737992ab42d9b1 Mon Sep 17 00:00:00 2001 From: mohan08p Date: Thu, 17 Dec 2015 17:53:18 +0000 Subject: [PATCH 299/379] corrected fields along with description --- share/goodie/cheat_sheets/json/mongodb.json | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/share/goodie/cheat_sheets/json/mongodb.json b/share/goodie/cheat_sheets/json/mongodb.json index a23ac1a4a..47948873a 100644 --- a/share/goodie/cheat_sheets/json/mongodb.json +++ b/share/goodie/cheat_sheets/json/mongodb.json @@ -2,15 +2,14 @@ "id": "mongodb_cheat_sheet", "name": "MongoDB", "template_type": "terminal", - "description": "Mongo shell", + "description": "MongoDB is an open-source, scalable, high-performance, document database with a dynamic schema written in the C++ programming language.", "metadata": { "sourceName": "Codecentric", "sourceUrl": "https://blog.codecentric.de/files/2012/12/MongoDB-CheatSheet-v1_0.pdf" }, "aliases": [ "mongo db", - "mongo db shell", - "MongoDB" + "mongo db shell" ], "section_order": [ "Basic Conceptes & Shell Commands", @@ -41,7 +40,7 @@ }, { "key": "show collections", - "val": "Lists the available collections" + "val": "List the available collections" }, { "key": "help", @@ -99,29 +98,29 @@ "Finding Documents": [ { "key": "db.collection.findOne()", - "val": "Finds one arbitrary document" + "val": "Find one arbitrary document" }, { "key": "db.collection.find().prettyPrint()", - "val": "Finds all documents and using nice formatting" + "val": "Find all documents and using nice formatting" }, { "key": "db.collection.find(\\{\\}, \\{key:true, _id:false\\})", - "val": "Shows only the respective key of the collection" + "val": "Show only the respective key of the collection" }, { "key": "db.collection.findOne(\\{'key':'value'\\})", - "val": "Finds one document by corresponding attribute" + "val": "Find one document by corresponding attribute" } ], "Finding Documents using Operators": [ { "key": "db.collection.find(\\{class:\\{$gt:’P'\\}\\})", - "val": "Greater than / greater than equals" + "val": "Greater than / greater than or equal" }, { "key": "db.collection.find(\\{class:\\{$lte:’P'\\}\\})", - "val": "Lesser than / lesser than equals" + "val": "Less than / less than or equal" }, { "key": "db.collection.find(\\{type:\\{$exists:true\\}\\})", From 310e99c8a3f1f98d1b8174f6d6daa83087e5fbd4 Mon Sep 17 00:00:00 2001 From: mohan08p Date: Fri, 18 Dec 2015 15:14:20 +0000 Subject: [PATCH 300/379] updated --- share/goodie/cheat_sheets/json/mongodb.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/share/goodie/cheat_sheets/json/mongodb.json b/share/goodie/cheat_sheets/json/mongodb.json index 47948873a..58d7d1eb9 100644 --- a/share/goodie/cheat_sheets/json/mongodb.json +++ b/share/goodie/cheat_sheets/json/mongodb.json @@ -2,7 +2,7 @@ "id": "mongodb_cheat_sheet", "name": "MongoDB", "template_type": "terminal", - "description": "MongoDB is an open-source, scalable, high-performance, document database with a dynamic schema written in the C++ programming language.", + "description": "An open-source, scalable, high-performance, document database with a dynamic schema written in the C++ programming language.", "metadata": { "sourceName": "Codecentric", "sourceUrl": "https://blog.codecentric.de/files/2012/12/MongoDB-CheatSheet-v1_0.pdf" @@ -40,7 +40,7 @@ }, { "key": "show collections", - "val": "List the available collections" + "val": "Lists the available collections" }, { "key": "help", @@ -106,7 +106,7 @@ }, { "key": "db.collection.find(\\{\\}, \\{key:true, _id:false\\})", - "val": "Show only the respective key of the collection" + "val": "Shows only the respective key of the collection" }, { "key": "db.collection.findOne(\\{'key':'value'\\})", @@ -324,23 +324,23 @@ "Durability of Writes": [ { "key": "\\{ w: , j: , wtimeout: \\}", - "val": "The w option to request acknowledgment that the write operation has propagated to a specified number of mongod instances. j, write operation written to the journal and wtimeout prevent write from blocking indefinitely." + "val": "The w option to request acknowledgment that the write operation has propagated to a specified number of mongod instances. j, write operation written to the journal and wtimeout prevent write from blocking indefinitely" }, { "key": "w : 1", - "val": "Requests acknowledgement that the write operation has propagated to the standalone mongod and is the default write concern for MongoDB." + "val": "Requests acknowledgement that the write operation has propagated to the standalone mongod and is the default write concern for MongoDB" }, { "key": "w : 0", - "val": "Requests no acknowledgment of the write operation. It might return information about socket exceptions and networking errors to the application." + "val": "Requests no acknowledgment of the write operation and might return information about socket exceptions and networking errors to the application" }, { "key": "w : 0 && j : true", - "val": "It prevails to request acknowledgement from the standalone mongod or the primary of a replica set." + "val": "It prevails to request acknowledgement from the standalone mongod or the primary of a replica set" }, { "key": "w : \"majority\"", - "val": "It implies j: true. Along, the primary also writes to the on-disk journal before acknowledging the write." + "val": "It implies j: true along, the primary also writes to the on-disk journal before acknowledging the write" } ] } From e05c88bc006ddf1f1bd7273043d17786052f77f7 Mon Sep 17 00:00:00 2001 From: mohan08p Date: Fri, 18 Dec 2015 16:17:43 +0000 Subject: [PATCH 301/379] periods removed --- share/goodie/cheat_sheets/json/mongodb.json | 34 ++++++++++----------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/share/goodie/cheat_sheets/json/mongodb.json b/share/goodie/cheat_sheets/json/mongodb.json index 58d7d1eb9..3de6e473b 100644 --- a/share/goodie/cheat_sheets/json/mongodb.json +++ b/share/goodie/cheat_sheets/json/mongodb.json @@ -212,31 +212,31 @@ "Pipeline Stages": [ { "key": "$project", - "val": "Reshapes each document in the stream (add or remove) and for each input document, outputs one document." + "val": "Reshapes each document in the stream (add or remove) and for each input document, outputs one document" }, { "key": "$match", - "val": "Filters the document stream to allow only matching documents to pass and for each input document, outputs either one document (a match) or zero documents (no match)." + "val": "Filters the document stream to allow only matching documents to pass and for each input document, outputs either one document (a match) or zero documents (no match)" }, { "key": "$group", - "val": "Groups input documents by a specified identifier expression and applies the accumulator expression(s) on all input documents and outputs single document." + "val": "Groups input documents by a specified identifier expression and applies the accumulator expression(s) on all input documents and outputs single document" }, { "key": "$sort", - "val": "Reorders the document stream by a specified sort key. For each input document, outputs one document." + "val": "Reorders the document stream by a specified sort key and for each input document, outputs one document" }, { "key": "$skip", - "val": "Skips the first n documents where n is the specified skip number and passes the remaining documents unmodified to the pipeline." + "val": "Skips the first n documents where n is the specified skip number and passes the remaining documents unmodified to the pipeline" }, { "key": "$limit", - "val": "Passes the first n documents unmodified to the pipeline where n is the specified limit." + "val": "Passes the first n documents unmodified to the pipeline where n is the specified limit" }, { "key": "$unwind", - "val": "Deconstructs an array field from the input documents to output a document for each element. For each input document, outputs n documents where n is the number of array elements and can be zero for an empty array." + "val": "Deconstructs an array field from the input documents to output a document for each element and each input document, outputs n documents where n is the number of array elements and can be zero for an empty array" } ], "Comparison with SQL": [ @@ -280,45 +280,45 @@ "Replica Sets": [ { "key": "Regular", - "val": "This is the most typical kind of node. It can act as a primary or secondary node" + "val": "This is the most typical kind of node and act as a primary or secondary node" }, { "key": "Arbiter", - "val": "Arbiter nodes are only there for voting purposes and to ensure that number of nodes, even not that physical servers." + "val": "Arbiter nodes are only there for voting purposes and to ensure that number of nodes, even not that physical servers" }, { "key": "Delayed", - "val": "Often used as a disaster recovery node. The data stored here is usually a few hours behind the real working data." + "val": "Often used as a disaster recovery node and the data stored here is usually a few hours behind the real working data" }, { "key": "Hidden", - "val": "Often used for analytics in the replica set." + "val": "Often used for analytics in the replica set" } ], "Sharding": [ { "key": "1", - "val": "Every document has to define a shard-key." + "val": "Every document has to define a shard-key" }, { "key": "2", - "val": "The value of the shard-key is immutable." + "val": "The value of the shard-key is immutable" }, { "key": "3", - "val": "The shard-key must be part of an index and it must be the first field in that index." + "val": "The shard-key must be part of an index and it must be the first field in that index" }, { "key": "4", - "val": "There can be no unique index unless the shard-key is part of it and is then the first field." + "val": "There can be no unique index unless the shard-key is part of it and is then the first field" }, { "key": "5", - "val": "Reads done without specifying the shard-key will lead to requests to all the different shards." + "val": "Reads done without specifying the shard-key will lead to requests to all the different shards" }, { "key": "6", - "val": "The shard-key must offer sufficient cardinality to be able to utilize all shards." + "val": "The shard-key must offer sufficient cardinality to be able to utilize all shards" } ], "Durability of Writes": [ From ce5432da0a2e2185038cfaec8fc060599fd17746 Mon Sep 17 00:00:00 2001 From: JUST FOR A HORROR Date: Fri, 18 Dec 2015 21:59:39 +0530 Subject: [PATCH 302/379] Update svn.json --- share/goodie/cheat_sheets/json/svn.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/share/goodie/cheat_sheets/json/svn.json b/share/goodie/cheat_sheets/json/svn.json index 8eda26579..471d94f88 100644 --- a/share/goodie/cheat_sheets/json/svn.json +++ b/share/goodie/cheat_sheets/json/svn.json @@ -1,9 +1,9 @@ { "id": "svn_cheat_sheet", "name": "Subversion", - "description": "Useful commands for working with Subversion version control system", + "description": "Useful commands for Subversion version control system", "metadata": { - "sourceName": "Version Control with Subversion", + "sourceName": "Red Bean", "sourceUrl": "http://svnbook.red-bean.com/" }, "aliases": [ @@ -11,11 +11,11 @@ ], "template_type": "terminal", "section_order": [ - "Basic usage", - "Advanced usage" + "Basic Usage", + "Advanced Usage" ], "sections": { - "Basic usage": [{ + "Basic Usage": [{ "val": "Create a working copy", "key": "svn checkout http://svn.example.com/svn/repo/trunk" }, { @@ -41,7 +41,7 @@ "key": "svn commit -m \"\\[descriptive commit message\\]\"" } ], - "Advanced usage": [{ + "Advanced Usage": [{ "val": "Fetch specific revision to working copy", "key": "svn update -r \\[revision\\]" }, { From 21419d10638a83e629670d0e2beebc8272535edf Mon Sep 17 00:00:00 2001 From: jsalli Date: Fri, 18 Dec 2015 22:52:20 +0000 Subject: [PATCH 303/379] First commit of new phpstorm-osx cheat sheet --- .../cheat_sheets/json/phpstorm-osx.json | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 share/goodie/cheat_sheets/json/phpstorm-osx.json diff --git a/share/goodie/cheat_sheets/json/phpstorm-osx.json b/share/goodie/cheat_sheets/json/phpstorm-osx.json new file mode 100644 index 000000000..9fe42afde --- /dev/null +++ b/share/goodie/cheat_sheets/json/phpstorm-osx.json @@ -0,0 +1,82 @@ +{ + "id": "phpstorm_osx_cheat_sheet", + "name": "JetBrains PHPStorm IDE (OS X)", + "descriptions": "Keyboard shortcuts for OS X version PHPStorm IDE, a PHP IDE developed by JetBrains", + "metadata": { + "sourceName": "OverAPI", + "sourceUrl": "http://overapi.com/phpstorm/" + }, + "aliases": ["phpstorm os x", "phpstorm mac"], + "template_type": "keyboard", + "section_order": ["General", "Productivity", "Editing", "Searching/Replacing", "Navigation"], + "sections": { + "General": [{ + "key": "[⌘] [0...9]", + "val": "Open/close corresponding tool window" + }, { + "key": "[Shift] [Alt] [I]", + "val": "Inspect current file with current profile" + }, { + "key": "[⌘] [S]", + "val": "Save" + }], + "Productivity": [{ + "key": "[⌘] [O]", + "val": "Open any class" + }, { + "key": "[Shift] [⌘] [O]", + "val": "Open any file" + }, { + "key": "[Ctrl] [Space]", + "val": "Code completion" + }, { + "key": "[⌘] [N]", + "val": "(In project view) Create new..." + }], + "Editing": [{ + "key": "[⌘] [/]", + "val": "Comment or uncomment with line comment" + }, { + "key": "[⌘] [Shift] [/]", + "val": "Comment or uncomment with block comment" + }, { + "key": "[Opt] [⌘] [L]", + "val": "Reformat code" + }, { + "key": "[Ctrl] [Opt] [O]", + "val": "Optimize imports" + }, { + "key": "[Ctrl] [Opt] [I]", + "val": "Auto indent lines" + }], + "Searching/Replacing": [{ + "key": "[Shift] [Shift]", + "val": "Search everywhere" + }, { + "key": "[⌘] [F]", + "val": "Find" + }, { + "key": "[⌘] [G]", + "val": "Find next" + }, { + "key": "[Shift] [⌘] [G]", + "val": "Find previous" + }, { + "key": "[⌘] [R]", + "val": "Replace" + }], + "Navigation": [{ + "key": "[⌘] [L]", + "val": "Go to line" + }, { + "key": "[⌘] [E]", + "val": "Recent files" + }, { + "key": "[⌘] [Shift] [Backspace]", + "val": "Go to last edit location" + }, { + "key": "[⌘] [B]", + "val": "Go to declaration" + }] + } +} From 46df96f0b08605d74ce7e33a869db92e224e0aee Mon Sep 17 00:00:00 2001 From: jsalli Date: Sat, 19 Dec 2015 11:19:01 +0000 Subject: [PATCH 304/379] Added aliases, removed extra spaces and changed the source URL --- share/goodie/cheat_sheets/json/phpstorm-osx.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/share/goodie/cheat_sheets/json/phpstorm-osx.json b/share/goodie/cheat_sheets/json/phpstorm-osx.json index 9fe42afde..65229c376 100644 --- a/share/goodie/cheat_sheets/json/phpstorm-osx.json +++ b/share/goodie/cheat_sheets/json/phpstorm-osx.json @@ -4,9 +4,9 @@ "descriptions": "Keyboard shortcuts for OS X version PHPStorm IDE, a PHP IDE developed by JetBrains", "metadata": { "sourceName": "OverAPI", - "sourceUrl": "http://overapi.com/phpstorm/" + "sourceUrl": "http://overapi.com/static/cs/PhpStorm_ReferenceCard.pdf" }, - "aliases": ["phpstorm os x", "phpstorm mac"], + "aliases": ["phpstorm os x", "phpstorm mac", "phpstorm macos", "phpstorm mac os"], "template_type": "keyboard", "section_order": ["General", "Productivity", "Editing", "Searching/Replacing", "Navigation"], "sections": { @@ -53,7 +53,7 @@ "key": "[Shift] [Shift]", "val": "Search everywhere" }, { - "key": "[⌘] [F]", + "key": "[⌘] [F]", "val": "Find" }, { "key": "[⌘] [G]", @@ -62,7 +62,7 @@ "key": "[Shift] [⌘] [G]", "val": "Find previous" }, { - "key": "[⌘] [R]", + "key": "[⌘] [R]", "val": "Replace" }], "Navigation": [{ From b2212526d64b44d679062d37b29424137d7983d6 Mon Sep 17 00:00:00 2001 From: karthiksurendran8395 Date: Sun, 20 Dec 2015 11:38:03 +0530 Subject: [PATCH 305/379] Update perldoc.json MODIFIED NAME, VAL FIELDS --- share/goodie/cheat_sheets/json/perldoc.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/share/goodie/cheat_sheets/json/perldoc.json b/share/goodie/cheat_sheets/json/perldoc.json index 584875525..246b76f54 100644 --- a/share/goodie/cheat_sheets/json/perldoc.json +++ b/share/goodie/cheat_sheets/json/perldoc.json @@ -1,9 +1,9 @@ { "id": "perldoc_cheat_sheet", - "name": "perldoc", + "name": "Perldoc", "description": "Perl Documentation", "metadata": { - "sourceName": "perldoc Manual", + "sourceName": "PERL", "sourceUrl": "http://perldoc.perl.org/perldoc.html" }, "template_type": "terminal", @@ -12,11 +12,11 @@ "Usage": [ { "key": "[perldoc