This file contains 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
var context = []; | |
(function(context){ | |
setInterval(function(){ | |
var value = context.pop() | |
console.log('iteraciones ' + value); | |
},1000); | |
})(context); | |
process.on('message',function(value){ |
This file contains 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
< receiver android:enabled="true" android:name=".broadcast_reciber_class" > | |
< intent-filter android:priority="1"> | |
< action android:name="android.intent.action.ACTION_SET_WALLPAPER" /> | |
< /intent-filter> | |
< /receiver> |
This file contains 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
Bitmap BlurImage (Bitmap input) | |
{ | |
var rsScript = RenderScript.Create (Context); | |
var alloc = Allocation.CreateFromBitmap (rsScript, input); | |
var blur = ScriptIntrinsicBlur.Create (rsScript, alloc.Element); | |
blur.SetRadius (12); | |
blur.SetInput (alloc); | |
var result = Bitmap.CreateBitmap (input.Width, input.Height, input.GetConfig ()); |
This file contains 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 static String getStringFromInputStream(InputStream inputStream) { | |
BufferedReader buffer = null; | |
StringBuilder sb = new StringBuilder(); | |
String line; | |
try { | |
buffer = new BufferedReader(new InputStreamReader(inputStream)); | |
while ((line = buffer.readLine()) != null) { |
This file contains 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 String getPath(Uri uriFile){ | |
String[] proj = { MediaStore.Images.Media.DATA }; | |
CursorLoader loader = new CursorLoader(this, uriFile, proj, null, null, null); | |
Cursor cursor = loader.loadInBackground(); | |
int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA); | |
This file contains 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
setOnScrollListener(new OnScrollListener(){ | |
public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) { | |
// TODO Auto-generated method stub | |
} | |
public void onScrollStateChanged(AbsListView view, int scrollState) { | |
// TODO Auto-generated method stub | |
final ListView lw = getListView(); | |
if(scrollState == 0) | |
Log.i("a", "scrolling stopped..."); |
This file contains 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
[server:main] | |
use = gunicorn | |
host = 127.0.0.0 | |
port = 5000 | |
workers = 3 | |
proc_name = proc_name |
This file contains 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
jQuery(document).on('keypress','[data-val="number"]',function(event){ | |
var key = event.charCode; | |
if( ( key == 0 || (key < 58 && key > 46) ) == false ) | |
return false; | |
}); |
This file contains 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
var bindTemaplte = function(template,data) | |
{ | |
for(key in data) | |
{ | |
var reg = new RegExp('{{ ' + key + ' }}','g'); | |
template = template.replace(reg,data[key]); | |
} | |
return template; | |
} |
This file contains 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
$('input[data-val=number]').on('keydown', function (event) { | |
var code = event.keyCode; | |
if ( (code < 48 || code > 57) && code !== 8 ) { | |
event.preventDefault(); | |
return false; | |
} | |
}); |