This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Contributed by Stjujsckij Nickolaj | |
| def enconvert(text, enc_name): | |
| ''' Convert from non-standard encoding, "Convert to encoding: $0, Encoding: $1" | |
| &Encoding, combo, cp1250, cp1251, cp1252, cp1253, cp1254, cp1255, cp1256, cp1257, cp1258''' | |
| return text.encode("latin1", 'replace').decode(enc_name, 'replace') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| prefix = /home/user/.local | |
| root = /home/user/.local/lib/node_modules | |
| binroot = /home/user/.local/bin | |
| manroot = /home/user/.local/share/man |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $widgets = array(); | |
| $widgets['a'] = 'hello'; | |
| print($widgets['a'][0]); // show 'h' | |
| print("\n"); | |
| $o = & $widgets['a'][0]; // Show "Cannot create references to/from string offsets" | |
| //print($o); | |
| ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/src/FeedlyProvider.cpp b/src/FeedlyProvider.cpp | |
| index 5303901..d345613 100644 | |
| --- a/src/FeedlyProvider.cpp | |
| +++ b/src/FeedlyProvider.cpp | |
| @@ -194,8 +194,14 @@ const std::vector<PostData>* FeedlyProvider::giveStreamPosts(const std::string& | |
| return NULL; | |
| } | |
| - for(unsigned int i = 0; i < root["items"].size(); i++) | |
| - feeds.push_back(PostData{root["items"][i]["summary"]["content"].asString(), root["items"][i]["title"].asString(), root["items"][i]["id"].asString(), root["items"][i]["originId"].asString()}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdlib.h> | |
| #include <string.h> | |
| #include <assert.h> | |
| char* reverse(char* s) { | |
| assert(s!=NULL); | |
| char *r = (char*)strdup(s); | |
| int len = strlen(s); | |
| if(r==NULL) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <string> | |
| #inculde <sstream> | |
| std::string toupper(std::string& s) { | |
| for(std::string::iterator c=s.begin(); c!=s.end(); c++) { | |
| *c = std::toupper(*c); | |
| } | |
| return s; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| # https://docs.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/RPM_Guide/ch-rpm-programming-python.html | |
| # Acts like rpm -qa and lists the names of all the installed packages. | |
| # Usage: | |
| # python rpmqa.py | |
| import rpm | |
| ts = rpm.TransactionSet() | |
| mi = ts.dbMatch() | |
| #for p in mi: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <sstream> | |
| #include <iostream> | |
| #include <string> | |
| #include <algorithm> | |
| std::string toupper(std::string& s) { | |
| for(std::string::iterator c=s.begin(); c!=s.end(); c++) { | |
| *c = std::toupper(*c); | |
| } | |
| return s; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #define BUFFER_SIZE 512 | |
| int doPadding(char* buffer, int startOffset) { | |
| int i; | |
| for(i = startOffset; i<BUFFER_SIZE; ++i) { | |
| *(buffer+i) = 0xff; |
OlderNewer