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 javax.xml.bind.JAXB; | |
| import java.io.StringReader; | |
| import java.io.StringWriter; | |
| public class JAXBUtils | |
| { | |
| /** | |
| * Unmarshal an XML string | |
| * @param xml The XML string | |
| * @param type The JAXB class type. |
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
| #!/bin/bash -e | |
| line_num="$1" | |
| if [ -z "$line_num" ]; then | |
| echo "Usage: $0 <line num>" | |
| exit 1 | |
| fi | |
| known_hosts="${HOME}/.ssh/known_hosts" | |
| tmp_file="${known_hosts}.$$" |
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
| #!/bin/bash | |
| # Case 1: prefix stdout with 'test' | |
| exec 1> >(sed 's/^/test /') | |
| # Case 2: prefix a group of commands with 'test' | |
| { | |
| echo "prefixed line" | |
| } > >(sed 's/^/test /') |
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 python | |
| import SimpleHTTPServer | |
| import SocketServer | |
| import sys | |
| import os | |
| import getopt | |
| def main(argv): | |
| try: |
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
| package file; | |
| import java.io.IOException; | |
| import java.nio.charset.Charset; | |
| import java.nio.file.Files; | |
| import java.nio.file.Paths; | |
| public class FileReader | |
| { | |
| public static void main(String[] args) throws IOException |
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
| # Ctrl+W to delete the previous word | |
| bind "^W" ed-delete-prev-word | |
| # Ctrl+U to delete the current line contents | |
| bind "^U" vi-kill-line-prev | |
| # Ctrl+R to search the query history | |
| bind "^R" em-inc-search-prev | |
| # Ctrl+Left Arrow to go the previous word | |
| bind "\e[1;5D" vi-prev-word | |
| # Ctrl+Right Arrow to go to the next word | |
| bind "\e[1;5C" vi-next-word |
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
| CREATE FUNCTION CURRENT_TIME_MILLIS () | |
| RETURNS BIGINT | |
| LANGUAGE SQL | |
| SQL SECURITY INVOKER | |
| BEGIN | |
| DECLARE _time BIGINT; | |
| select conv(concat(substring(uid,16,3), substring(uid,10,4), substring(uid,1,8)), 16,10) | |
| div 10000 - (141427 * 24 * 60 * 60 * 1000) into _time | |
| from (select uuid() uid) as alias; |
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 javax.persistence.*; | |
| @Entity | |
| public class Resource | |
| { | |
| @Id | |
| private int id; | |
| private String value; | |
| public int getId() |
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
| <link rel="import" href="../core-pages/core-pages.html"> | |
| <link rel="import" href="../paper-checkbox/paper-checkbox.html"> | |
| <polymer-element name="my-element"> | |
| <template> | |
| <style> | |
| :host { | |
| position: absolute; | |
| width: 100%; |
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
| <link rel="import" href="../core-field/core-field.html"> | |
| <link rel="import" href="../core-icon/core-icon.html"> | |
| <link rel="import" href="../core-input/core-input.html"> | |
| <link rel="import" href="../core-icons/core-icons.html"> | |
| <link rel="import" href="../core-scaffold/core-scaffold.html"> | |
| <link rel="import" href="../core-header-panel/core-header-panel.html"> | |
| <link rel="import" href="../core-menu/core-menu.html"> | |
| <link rel="import" href="../core-item/core-item.html"> | |
| <link rel="import" href="../core-icon-button/core-icon-button.html"> | |
| <link rel="import" href="../core-toolbar/core-toolbar.html"> |