Skip to content

Instantly share code, notes, and snippets.

View jonathanbcsouza's full-sized avatar
:octocat:
Building stuff

Jonathan Souza jonathanbcsouza

:octocat:
Building stuff
View GitHub Profile
@jonathanbcsouza
jonathanbcsouza / script.js
Last active November 1, 2022 09:59
Multipliers Finder
// Return all sets of two numbers, that multiplied by each other, result in 18
const sub_array = [];
const super_array = [2, 5, 7, 12, 3, 4, 13, 9, 1, 6];
for (let i = 0; i < super_array.length; i++) {
for (let j = 0; j < super_array.length; j++) {
if (super_array[i] * super_array[j] == 18) {
sub_array.push([super_array[i], super_array[j]]);
}
@jonathanbcsouza
jonathanbcsouza / MainActivity.java
Last active January 15, 2020 09:43
How to get a Hash to use in Facebook - Easy Way
// 1- Past this code within your onCreate.
// 2- Run your app.
// 3- Check your logcat!
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
@jonathanbcsouza
jonathanbcsouza / MainActivity.java
Last active October 5, 2021 05:47
SOLUTION FOR: DEPRECATED >> Uri downloadUrl = taskSnapshot.getDownloadUrl
// Udacity - Does not working
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == RC_SIGN_IN) {
if (resultCode == RESULT_OK) {
Toast.makeText(getContext(), "Signed in!", Toast.LENGTH_SHORT).show();
} else if (resultCode == RESULT_CANCELED) {
Toast.makeText(getContext(), "Sign in canceled", Toast.LENGTH_SHORT).show();
getActivity().finish();
@jonathanbcsouza
jonathanbcsouza / gist:488fff1238b09d27decbf20b8ca68a50
Created November 7, 2017 12:27 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@jonathanbcsouza
jonathanbcsouza / releaseMediaPlayer.java
Created November 3, 2017 00:08
Cleaning up MediaPlayer resources
/**
* Clean up the media player by releasing its resources.
*/
private void releaseMediaPlayer() {
// If the media player is not null, then it may be currently playing a sound.
if (mMediaPlayer != null) {
// Regardless of the current state of the media player, release its resources
// because we no longer need it.
mMediaPlayer.release();