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/env perl | |
| # | |
| # Perl script to calculate the oauth_signature parameter as required by the OAuth protocol. | |
| # | |
| # Another method on UNIX systems is to use the tools available on the command line: | |
| # Example: | |
| # echo `printf '%s' "GET&https%3A%2F%2Fapi.twitter.com%2Foauth%2Frequest_token&oauth_callback%3Dhttp%253A%252F%252Fwww.mysite.com%26oauth_consumer_key%myconsumerkey%26oauth_nonce%3D1345644784337%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1345644784%26oauth_version%3D1.0" | openssl dgst -sha1 -hmac "ufWahmHEvWSC2KVJs96M5G7y1tbBU4gGH6Nq4JZsBs&" -binary | openssl base64` | perl -MURI::Escape -ne 'chomp;print uri_escape($_),"\n"' |
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/env python2 | |
| import SimpleCV | |
| import time | |
| c = SimpleCV.Camera(1) | |
| js = SimpleCV.JpegStreamer() | |
| while(1): | |
| img = c.getImage() | |
| img = img.smooth() |
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 <iostream> | |
| #include <fstream> | |
| int main() | |
| { | |
| // bad | |
| std::string text = ""; | |
| std::ifstream readFile ("q.txt", std::ifstream::in); | |
| char c; |
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/env perl | |
| use strict; | |
| use warnings; | |
| open my $fh, '<', "file.txt" or die $!; | |
| my $total = 0; | |
| my $count = 0; | |
| while (<$fh>) { |
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
| QMainWindow, | |
| QAbstractItemView, | |
| QTreeView::branch, | |
| QTabBar::tab{ | |
| color: #EAEAEA; | |
| background: #333333; | |
| font-size: 9pt; | |
| } | |
| QAbstractItemView::item:selected { |
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/env bash | |
| # -------------------------------------- | |
| # | |
| # Title: build-tcpdump | |
| # Author: Loic Poulain, [email protected] | |
| # | |
| # Purpose: download & build tcpdump for arm android platform | |
| # | |
| # You have to define your android NDK directory before calling this script |
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/env python3 | |
| # ranwhen – Visualize when your system was running | |
| # | |
| # Requirements: | |
| # - *nix system with last(1) installed and supporting the -R and -F flags | |
| # - Python >= 3.2 | |
| # - Terminal emulator with support for Unicode and xterm's 256 color mode | |
| # | |
| # |
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 <type_traits> | |
| #include <string> | |
| namespace detail { | |
| using namespace std; | |
| struct has_to_string_impl { | |
| template< | |
| typename T, | |
| typename U = decltype(std::declval<const T&>().to_string()), | |
| bool E = std::is_same<typename std::decay<U>::type, std::string>::value> |
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 <iostream> | |
| #include <vector> | |
| class iterative_dfs | |
| { | |
| public: | |
| // use a vector-of-vectors to represent adjacency list | |
| typedef std::vector< int > nodes_t; | |
| typedef std::vector< nodes_t > graph_t; |
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 <thread> | |
| #include <chrono> | |
| #include <iostream> | |
| using namespace std; | |
| int main() | |
| { | |
| typedef chrono::high_resolution_clock clock; | |
| clock::time_point start = clock::now(); |