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
| <html> | |
| <head> | |
| </head> | |
| <body> | |
| <canvas id="object-canvas" width="1920" height="1080"> | |
| <script> | |
| function randomNumber(start, end) { | |
| return Math.floor((Math.random() * end) + start) | |
| } |
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
| You will need 2 tools, lynx and awk, try this: | |
| $ lynx -dump http://www.google.com.br | awk '/http/{print $2}' > links.txt | |
| If you need numbering lines, use command nl, try this: | |
| $ lynx -dump http://www.google.com.br | awk '/http/{print $2}' | nl > links.txt |
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
| List<Long> items = new ArrayList<>(); | |
| for (String item : items) | |
| { | |
| negItems.add(Longs.tryParse(item)); | |
| } | |
| return Longs.toArray(negItems); |
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
| syntax on | |
| set nu " Enable number lines" | |
| set showcmd | |
| set incsearch | |
| set hlsearch | |
| set autoindent | |
| " Source a global configuration file if available | |
| if filereadable("/etc/vim/vimrc.local") | |
| source /etc/vim/vimrc.local | |
| endif |
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
| Title: What is the goal? | |
| Actor: Who desires it? | |
| Scenario: How is it accomplished? (Steps to archieve the goal) | |
| Extensions: Alternative work flows |
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
| // Convert all links to images | |
| $.each($("a"), function(k, v) { | |
| var link = $("<a>"); | |
| var img = $("<img>"); | |
| var hrefValue = $(v).attr("href"); | |
| link.attr("href", hrefValue); | |
| link.attr("target", "_blank"); | |
| img.attr("src", hrefValue); | |
| img.attr("style", "height: 50%; width: 50%;"); |
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
| from urllib2 import Request, urlopen, HTTPError | |
| import sys | |
| url = sys.argv[1].strip() | |
| req = Request(url) | |
| print url | |
| try: | |
| response = urlopen(req) | |
| except HTTPError as e: | |
| print e.code |
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
| import java.io.BufferedReader; | |
| import java.io.InputStreamReader; | |
| public class ExecuteShellComand { | |
| public static void main(String[] args) { | |
| ExecuteShellComand obj = new ExecuteShellComand(); | |
| String domainName = "google.com"; | |
| //in mac oxs |
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
| private void showAlert(String text, int duration) { | |
| Context context = getApplicationContext(); | |
| Toast toast = Toast.makeText(context, text, duration); | |
| toast.show(); | |
| } |
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
| String URL = "jdbc:mysql://localhost:5004/test"; | |
| try { | |
| Connection conn = DriverManager.getConnection (URL, "username", "password"); | |
| Statement statement = conn.createStatement(); | |
| ResultSet resultSet = statement.executeQuery("select * from tweet_post;"); | |
| while(resultSet.next()) { | |
| System.out.println(resultSet.getString("id") + "\t" + resultSet.getString("tweet")); | |
| } | |
| } catch (SQLException ex) { |