Skip to content

Instantly share code, notes, and snippets.

View agusbrand's full-sized avatar

Agustin Brandoni agusbrand

View GitHub Profile
myButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
SimpleDateFormat formatter = new SimpleDateFormat("h:mm:ss a");
String strWhen = formatter.format(new Date());
TextView myTextview = (TextView)
findViewById(R.id.TextViewToShow);
myTextview.setText("Clicked at " + strWhen);
}
});
final TextView firstTextView = (TextView) findViewById(R.id.textView);
final Button firstButton = (Button) findViewById(R.id.firstButton);
// ACA escribir View.OnClickListener(){ Y APRETAR CTRL+i
firstButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
firstTextView.setText("You clicked!");
}
});
String usersName = String.valueOf(usersNameEditText.getText());
Toast.makeText(this, yourYesResponse, Toast.LENGTH_SHORT).show();
@agusbrand
agusbrand / gist:5fd44c7729f3eeae580f
Created March 17, 2015 02:22
color sintaxis p google docs
Integer iNum = new Integer(123);
String sText = "The number one-two-three = ";
String sFullText = sText + iNum; // aca llama al toString, es al pedo ponerlo o no.
/**
* This method simply throws an Exception if the incoming parameter a is not a positive number, just for fun.
*
* @param shouldThrow Whether or not to throw an exception
* @throws Exception
*/
import android.app.Activity;
String strClassName = Activity.class.getName(); // android.app.Activity
String silly = "Silly String!";
Class someKindOfClass = silly.getClass();
String strSillyClassName = someKindOfClass.getName(); // java.lang.String
<resources>
<string name="app_name">My Android App Name!</string>
</resources>
{"version":1,"resource":"file:///home/agustin/airmed/AirMed/app/javascript/components/common/TableSkeleton.jsx","entries":[{"id":"qyuV.jsx","source":"Fix all fixable ESLint issues","timestamp":1657639077030},{"id":"mu3P.jsx","timestamp":1657639090062},{"id":"0Hsl.jsx","source":"Fix all fixable ESLint issues","timestamp":1657639225557},{"id":"ZKam.jsx","timestamp":1657639332111}]}
@agusbrand
agusbrand / gist:198d3d9512b7a3495c7f51a1bf30fda3
Last active June 13, 2021 21:35
Keep a fork in sync with upstream in git

Keep a fork in sync with upstream in git

1. Add a new remote to point to the upstream repo:

 > git remote add upstream git://github.com/USERNAME/UPSTREAM-REPO.git

2. Check remotes:

> git remote -v
@agusbrand
agusbrand / how_to_squash.md
Last active June 13, 2021 21:35
How to squash commits

How to squash commits

1. Rebase using interactive editor. N = last N commits to be squashed into one commit.

 > git rebase -i HEAD~N

2. Let the first commit marked with "pick". Then "squash" the rest. Use "fixup" to discard that particular commit message.

3. Force push

@agusbrand
agusbrand / example.json
Created March 16, 2022 15:06
United healthcare example
{
"responses": [
{
"textAnnotations": [
{
"locale": "en",
"description": "U UnitedHealthcare | e\nHMO\nHealth Plan (80840): 000-00000-00\nMember ID: 000000000 00\nMember:\nMARY SMITH\nGroup Number: 000000\nPayer ID 12345 EM. Date:01.01/2011\nOPTUMR\nCopys\nOfice: $15\nRx Bin: 012345\nRx PCN: 9789\nRx Grp: AAAA\nER S50\nSignatureValue HMO\nOffered by UnitedHealthcare of California\n",
"boundingPoly": {
"vertices": [
{