Skip to content

Instantly share code, notes, and snippets.

//this is how you ask the editor to perform tasks
/*ex)
*
*
public void issueIntent(int requestCode, String[] data){
Intent openNewActivity = new Intent(getApplicationContext(), IntentHandler.class);
b.putStringArray("data", data);
openNewActivity.putExtras(b);
startActivityForResult(openNewActivity, requestCode);
import android.content.Context;
import android.content.ContextWrapper;
import android.content.res.AssetManager;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.util.DisplayMetrics;
import android.util.Log;
/**
@b3457m0d3
b3457m0d3 / java-comments
Created April 13, 2014 16:24
how to comment in your code (java)
coding is a long and arduous process. make things easier on yourself by leaving "breadcrumbs"
small comments can save you the time it would take to figure out where you last left off
they can also be useful as placeholders and TODO items
this is a standard single line comment
//everything on this line will be ignored by the compiler
this is a standard multi line comment
/*
* everything between the start and end is ignored by the compiler
*/
@b3457m0d3
b3457m0d3 / modal form submit
Created May 31, 2012 22:30
submit modal form in bootstrap
$('.modal-form-submit').on('click', function(e){
// We don't want this to act as a link so cancel the link action
e.preventDefault();
//grad id of form to submit from rel attr
var id = $(this).attr('rel');
// Find form and submit it
$('#'+id).submit();
});
@b3457m0d3
b3457m0d3 / url hash
Created May 30, 2012 22:24
get hash from url, without #
if(window.location.hash) {
var hash = window.location.hash.substring(1); //Puts hash in variable, and removes the # character
}
$(document).ready(function(){
//setup info
var id = "";//<- You user id
var num = 1;//<- How many images to pull in
// Grab JSON from Flickr
$.getJSON("http://api.flickr.com/services/feeds/groups_pool.gne?id="+id+"&lang=en-us&format=json&jsoncallback=?", displayImages);
//
function displayImages(data)
$( document ).ready( function () {
var html = "";
$.ajax( {
url : "https://api.github.com/users/MichaelMartinez/watched",
dataType : "jsonp",
success : function ( returndata ) {
$.each( returndata.data, function ( i, item ) {
html += '<li>' +
'<a class="btn" href="' + this.html_url + '">' + this.name + '</a>' +
<?php
echo "test";
?>