- This is a collection of android snippets
DB.prototype.getCurrentOpStats = function() { | |
intervals = [1,5,10,30] | |
waitingForLock = 0; | |
secsRunningStats = {}; | |
inProg = db.currentOp()["inprog"] | |
inProg.forEach(function (op) { | |
if(op["waitingForLock"]) { | |
waitingForLock += 1; | |
} |
- Settings - Editor - Live Templates
- Add Live Template or create a Template Group. Choose the Template Group option will create an .xml file with the same name of the Template Group you defined before.
- The .xml file can be found in a different folder, depends on the operating system.
Example:
Log.e(TAG,MESSAGE);
<templateSet group="android"> | |
<template name="focvb" value="@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_$END$, container, false); ButterKnife.inject(this, view); return view; } " description="Fragment onCreateView with ButterKnife" toReformat="true" toShortenFQNames="true"> | |
<context> | |
<option name="JAVA_CODE" value="false" /> | |
<option name="JAVA_STATEMENT" value="false" /> | |
<option name="JAVA_EXPRESSION" value="true" /> | |
<option name="JAVA_DECLARATION" value="true" /> | |
<option name="JAVA_COMMENT" value="false" /> | |
<option name="JAVA_STRING" value="false" /> | |
<option name="COMPLETION" value="false" /> |
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
/* | |
* Copyright (C) 2013 The Android Open Source Project | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
int offset = computeVerticalScrollOffset(); | |
int range = computeVerticalScrollRange(); | |
int extent = computeVerticalScrollExtent(); | |
int leftoverExtent = range - offset - extent; | |
// In Case Items does not fill the screen (More accurate, if last | |
// Item is reachable from offset 0 | |
boolean isfillingScreen = getBottom() - height +yDelta< getHeight(); | |
// added line |
var Node = { | |
child: require('child_process'), | |
fs: require('fs'), | |
path: require('path') | |
}; | |
// This will be removed and then created and then removed: | |
var testdirectory = 'testfswatchmisses'; | |
if (Node.fs.remove !== undefined) throw new Error('fs.remove exists'); |
I've been wanting to do a serious project in Go. One thing holding me back has been a my working environment. As a huge PyCharm user, I was hoping the Go IDE plugin for IntelliJ IDEA would fit my needs. However, it never felt quite right. After a previous experiment a few years ago using Vim, I knew how powerful it could be if I put in the time to make it so. Luckily there are plugins for almost anything you need to do with Go or what you would expect form and IDE. While this is no where near comprehensive, it will get you writing code, building and testing with the power you would expect from Vim.
I'm assuming you're coming with a clean slate. For me this was OSX so I used MacVim. There is nothing in my config files that assumes this is the case.