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 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 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 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 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
| 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 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
| < 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 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
| var context = []; | |
| (function(context){ | |
| setInterval(function(){ | |
| var value = context.pop() | |
| console.log('iteraciones ' + value); | |
| },1000); | |
| })(context); | |
| process.on('message',function(value){ |
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 | |
| # -*- coding: utf-8 -*- | |
| import os | |
| from twisted.application import service | |
| from twisted.web import server, static | |
| from twisted.web.resource import Resource | |
| from twisted.web.wsgi import WSGIResource | |
| from twisted.internet import reactor | |
| from flask.views import MethodView |
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
| { | |
| "country": { | |
| "iso_code": "CO", | |
| "names": { | |
| "pt-BR": "Colômbia", | |
| "es": "Colombia", | |
| "ru": "Колумбия", | |
| "en": "Colombia", | |
| "zh-CN": "哥伦比亚", | |
| "fr": "Colombie", |
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
| #!/bin/sh | |
| rpm -Uih https://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm | |
| curl -L https://get.rvm.io | bash -s stable | |
| rvm install 2.0.0 | |
| rvm use 2.0.0@global --default | |
| # for chinese user, if you have a wonderful speed ignore this part | |
| # to have a faster download speed | |
| # switch gem source to ruby.taobao.org |
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
| describe('/blog', function() { | |
| it('returns blog posts as JSON', function(done) { | |
| api.get('/blog') | |
| .set('x-api-key', '123myapikey') | |
| .auth('correct', 'credentials') | |
| .expect(200) | |
| .expect('Content-Type', /json/) | |
| .end(function(err, res) { | |
| if (err) return done(err); |
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
| // file "NSDictionary+UrlEncoding.m" | |
| #import "NSDictionary+UrlEncoding.h" | |
| // helper function: get the string form of any object | |
| static NSString *toString(id object) { | |
| return [NSString stringWithFormat: @"%@", object]; | |
| } | |
| // helper function: get the url encoded string form of any object | |
| static NSString *urlEncode(id object) { |
OlderNewer