Android Studio keyboard shortcuts I use often.
SHIFT + F6
to refactor methods, classes, and variable namesCTRL + O
to override methodsCOMMAND + N
- Generate getter, setter, and constructor method for a class (when in editor pane)
package com.example.android; | |
import com.thoughtworks.xstream.*; | |
import com.thoughtworks.xstream.io.*; | |
import com.thoughtworks.xstream.mapper.*; | |
import com.thoughtworks.xstream.converters.*; | |
import com.thoughtworks.xstream.converters.collections.*; | |
import java.util.*; |
var MyModel = Backbone.Model.extend({ | |
initialize: (attrs){ | |
var self = this; | |
self.updateDate(); | |
self.bind('change:date', function(){ | |
self.updateDate(); | |
}); | |
}, | |
updateDate: function(){ | |
var date = this.get('date'); |
using System.Text.RegularExpressions; | |
public static class StringHelpers { | |
private const char _cr = '\u000D'; | |
private const char _lf = '\u000A'; | |
private const string _crlf = _cr + _lf; | |
private static Regex _crlfRegex = new Regex(_cr + '|' + _lf + '|' + _crlf); | |
public static string NormalizeNewline(this string str){ |
#!/bin/bash | |
############################################### | |
# To use: | |
# https://raw.github.com/gist/2776351/??? | |
# chmod 777 install_postgresql.sh | |
# ./install_postgresql.sh | |
############################################### | |
echo "*****************************************" | |
echo " Installing PostgreSQL" | |
echo "*****************************************" |
package com.example.testchart; | |
import java.util.*; | |
import java.io.*; | |
import java.text.DateFormat; | |
import android.os.Bundle; | |
import android.app.Activity; | |
import android.util.Log; | |
import android.view.*; |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<!-- Le styles --> | |
<link href="../bootstrap/css/bootstrap.css" rel="stylesheet"> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.js"></script> | |
</head> | |
<body> |
// Copyright (c) 2013 Daniel Grunwald | |
// | |
// Permission is hereby granted, free of charge, to any person | |
// obtaining a copy of this software and associated documentation | |
// files (the "Software"), to deal in the Software without | |
// restriction, including without limitation the rights to use, | |
// copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the | |
// Software is furnished to do so, subject to the following | |
// conditions: |
using System; | |
namespace Virtlink | |
{ | |
/// <summary> | |
/// Executes a particular piece of code based on the type of the argument. | |
/// </summary> | |
/// <example> | |
/// Usage example: | |
/// <code> |
using System; | |
using System.Collections.Generic; | |
using System.Data; | |
using System.Data.SqlClient; | |
using NHibernate; | |
namespace NHibernate.Helpers | |
{ | |
public static class SqlProcedureHelper | |
{ |