This file contains 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
{ | |
date: "2024-09-03T10:15:00-04:00" | |
} |
This file contains 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
{ | |
"name": "Val", | |
"age": 23, | |
"favourite_colors": [ | |
"blue", | |
"yellow", | |
"green" | |
], | |
"fav_nums": [ | |
1, |
This file contains 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
{ | |
"name": "Movies", | |
"videos": [ | |
{ | |
"description": "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttps://www.bigbuckbunny.org", | |
"video": "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4", | |
"subtitle": "By Blender Foundation", | |
"thumb": "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/images/BigBuckBunny.jpg", | |
"title": "Big Buck Bunny" | |
}, |
This file contains 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 XCTest | |
// Credits: https://github.com/pointfreeco/swift-composable-architecture | |
//swiftlint:disable empty_string force_cast force_unwrapping unused_closure_parameter function_body_length | |
class MyCustomTestCase: XCTestCase { | |
func assertEqual<T: Equatable>( | |
expected: T, | |
actual: T | |
) { |
This file contains 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/sh | |
for x | |
do | |
echo "Converting $x" | |
tr -d '\015' < "$x" > "tmp.$x" | |
mv "tmp.$x" "$x" | |
done |
This file contains 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 myImage.jpg -crop 256x256 \ | |
-set filename:tile "%[fx:page.x/256]-%[fx:page.y/256]" \ | |
+repage +adjoin "Tile-%[filename:tile].png" | |
// converts an image into 256 tiles with the files named as Tile-row_num-column_num.png |
This file contains 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 android.os.Parcel; | |
import android.os.Parcelable; | |
public class Person implements Parcelable { | |
private String name; | |
private int age; | |
private String email; | |
private boolean hasPhone; | |
// Constuctor |
This file contains 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 an interface called AsyncResponse, AsyncResponse.java | |
public interface AsyncResponse { | |
void processFinish(String response); | |
} | |
// In the MainActivity.java override processFinish | |
// In processFinish put everything that you want to happen when you get a response from the AsyncTask | |
public class MainActivity extends Activity implements AsyncResponse { | |
protected void onCreate() { |
This file contains 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
public class SomeFragment extends Fragment { | |
MapView mapView; | |
GoogleMap map; | |
@Override | |
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { | |
View v = inflater.inflate(R.layout.some_layout, container, false); | |
This file contains 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
/* | |
Source: http://www.littlerobots.nl/blog/Handle-Android-RecyclerView-Clicks/ | |
USAGE: | |
ItemClickSupport.addTo(mRecyclerView).setOnItemClickListener(new ItemClickSupport.OnItemClickListener() { | |
@Override | |
public void onItemClicked(RecyclerView recyclerView, int position, View v) { | |
// do it | |
} | |
}); |
NewerOlder