Skip to content

Instantly share code, notes, and snippets.

<?php
echo "test";
?>
$( 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>' +
$(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)
@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
}
@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 / 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
*/
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;
/**
//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);
@b3457m0d3
b3457m0d3 / bs-oc-breadcrumbs
Created May 26, 2014 04:44
bootstrap breadcrumbs for opencart
<!--// Breadcrumbs-->
<ol class="breadcrumb">
<?php $last = array_pop($breadcrumbs); ?>
<?php foreach ($breadcrumbs as $breadcrumb) { ?>
<li>
<a href="<?php echo $breadcrumb['href']; ?>">
<?php echo $breadcrumb['text']; ?>
</a>
</li>
<?php } ?>
@b3457m0d3
b3457m0d3 / vqmod-xml-temlpate
Created May 26, 2014 19:41
vqmod xml template
<modification>
<id><![CDATA[Name]]></id>
<version><![CDATA[1.0]]></version>
<vqmver><![CDATA[2.4.1]]></vqmver>
<author><![CDATA[Demo]]></author>
<file name="catalog/language/english/checkout/checkout.php">
<operation>
<search position="replace"><![CDATA[ line of code from checkout.php (you can search only 1 line)]]></search>
<add><![CDATA[New line/lines that will replace the searched one]]></add>
</operation>