This file contains hidden or 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
package se.marteinn.ui; | |
import android.content.Context; | |
import android.util.AttributeSet; | |
import android.view.View; | |
import android.widget.ScrollView; | |
public class InteractiveScrollView extends ScrollView { | |
OnBottomReachedListener onBottomReachedListener; |
This file contains hidden or 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
package se.marteinn.ui; | |
import android.content.Context; | |
import android.util.AttributeSet; | |
import android.widget.AbsListView; | |
import android.widget.ListView; | |
/** | |
* Triggers a event when scrolling reaches bottom. |
This file contains hidden or 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
/*global require, define, console, Modernizr */ | |
define([ | |
"jquery", | |
"backbone" | |
], function ($, Backbone) { | |
var storage = {}; | |
if (Modernizr.localstorage) { |
This file contains hidden or 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
// Resize and return image sprite | |
@mixin sprite-2x($map, $sprite, $show-bg: 1) { | |
$sprite-image: sprite-file($map, $sprite); | |
$sprite-width: image-width($sprite-image); | |
$sprite-positions: sprite-position($map, $sprite); | |
@media all and (-webkit-min-device-pixel-ratio : 1.5) { | |
@if $show-bg == 1 { | |
background-image: sprite-url($map); | |
} |
This file contains hidden or 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
from flask.ext.admin import Admin, expose, AdminIndexView | |
class HomeView(AdminIndexView): | |
@expose("/") | |
def index(self): | |
return self.render('admin/home.html') | |
admin = Admin(app, "MadeInStockholm.se", index_view=HomeView(name='Home')) |
This file contains hidden or 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
def html_decorator(func): | |
""" | |
This decorator wraps the output in html. | |
(From http://stackoverflow.com/a/14647943) | |
""" | |
def _decorated(*args, **kwargs): | |
response = func(*args, **kwargs) | |
wrapped = ("<html><body>", |
This file contains hidden or 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
<?php | |
/** | |
* Create image attachment using a web url. | |
* | |
* @param String url Url path to the image we want to add (http://test.com/img.jpg) | |
* @param String filename Name of file ex: image.jpg. Will otherwise be loaded by header. | |
* @param int post_id The post where image should be associated if featured | |
* is true. (Optiona) | |
* @param Boolean featured Whether a file should be featured or not. (Optional) |
This file contains hidden or 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
private void showDelayedKeyboard (final View view) { | |
showDelayedKeyboard(view, 100); | |
} | |
private void showDelayedKeyboard (final View view, final int delay) { | |
new AsyncTask<Void, Void, Void>() { | |
@Override | |
protected Void doInBackground(Void... params) { | |
try { | |
Thread.sleep(delay); |
This file contains hidden or 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
// Pick up data from service.php and send returned data to wp ajax admin. | |
var win = window.dialogArguments || opener || parent || top | |
$.ajax({ | |
url: ajaxurl, | |
type: "POST", | |
contentType: "application/x-www-form-urlencoded; charset=UTF-8", | |
data: postData, |