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
diff --git a/plugins/gist_tag.rb b/plugins/gist_tag.rb | |
index 1620345..39b4bc9 100644 | |
@@ -17,6 +17,8 @@ module Jekyll | |
@text = text | |
@cache_disabled = false | |
@cache_folder = File.expand_path "../.gist-cache", File.dirname(__FILE__) | |
+ # Only for Octopress | |
+ @github_user = Jekyll.configuration({})['github_user'] | |
FileUtils.mkdir_p @cache_folder |
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
# A Liquid tag for Jekyll sites that allows embedding Gists and showing code for non-JavaScript enabled browsers and readers. | |
# by: Brandon Tilly | |
# Source URL: https://gist.github.com/1027674 | |
# Post http://brandontilley.com/2011/01/31/gist-tag-for-jekyll.html | |
# | |
# Example usage: {% gist 1027674 gist_tag.rb %} //embeds a gist for this plugin | |
require 'cgi' | |
require 'digest/md5' | |
require 'net/https' |
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 int __getImageOrientation(final String file) throws IOException { | |
ExifInterface exif = new ExifInterface(file); | |
int orientation = exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, 1); | |
BBAppLogger.i("EXIF %d", orientation); | |
switch (orientation) { | |
case ExifInterface.ORIENTATION_NORMAL: | |
return 0; | |
case ExifInterface.ORIENTATION_ROTATE_90: | |
return 90; | |
case ExifInterface.ORIENTATION_ROTATE_180: |
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 int __getImageOrientation(final String file) throws IOException { | |
ExifInterface exif = new ExifInterface(file); | |
int orientation = exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, 1); | |
BBAppLogger.i("EXIF %d", orientation); | |
switch (orientation) { | |
case ExifInterface.ORIENTATION_NORMAL: | |
return 0; | |
case ExifInterface.ORIENTATION_ROTATE_90: | |
return 90; | |
case ExifInterface.ORIENTATION_ROTATE_180: |
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 String __getFilePathFromURI(ContentResolver cr, Uri photoUri) throws IOException { | |
if (photoUri.getScheme().equals("file")) { | |
return photoUri.getPath(); | |
} | |
String[] queryTerms = {MediaStore.Images.Media.DATA}; | |
Cursor cursor = cr.query(photoUri, queryTerms, null, null, null); | |
int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA); | |
cursor.moveToFirst(); |
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
svn status | awk -F' ' '{ print $2 }' | xargs rm -rf | |
# output of svn status | |
# ? pygeoip-0.2.2 | |
# ? Django-1.4 | |
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
public void scrollBottom() { | |
// scroll bottom requires posting a runnable to the listView | |
// in the case of items loading by themselves dynamically | |
// there may be sync issues and scrolling won't be proper | |
m_bNeedScrollToBottom = false; | |
if (m_listView.getLastVisiblePosition()-m_listView.getFirstVisiblePosition() <= m_listView.getCount()) | |
m_listView.setStackFromBottom(false); | |
else | |
m_listView.setStackFromBottom(true); | |
BBUILoop.getInstance().delayPost(new Runnable() { |
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
#!/usr/bin/env python | |
import os | |
import sys | |
if __name__ == "__main__": | |
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "key.settings") | |
from django.core.management import execute_from_command_line | |
execute_from_command_line(sys.argv) |
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 setUpListeners() { | |
Button first = (Button) getView().findViewById(R.id.button); | |
first.setOnClickListener(new View.OnClickListener(){ | |
public void onClick(View v) | |
{ | |
firstCommandFired(); | |
} | |
}); | |
Button second = (Button) getView().findViewById(R.id.button1); |