cd /usr/bin/local
sudo wget https://gist.github.com/kibao/6192063/raw/529ca3eccda769b3111db42fb28eb4993482875b/xdebug-toggle
sudo chmod +x xdebug-toggle
sudo xdebug-toggle
| /** | |
| * Magic getters and setters. | |
| * Example: | |
| * Properties: | |
| * - name | |
| * - created_at | |
| * | |
| * Magic methods: | |
| * - setName($name) | |
| * - getName() |
| namespace.views.MyWizard = Backbone.Views.extend({ | |
| initialize: function() { | |
| _.bindAll(this, 'render', 'wizardMethod'); | |
| } | |
| render: function() { | |
| this.wizardMethod(); | |
| return this; | |
| }, |
| InputStream response; | |
| ByteArrayOutputStream buf = new ByteArrayOutputStream(); | |
| int result = response.read(); | |
| while(result != -1) { | |
| byte b = (byte)result; | |
| buf.write(b); | |
| result = response.read(); | |
| } | |
| System.out.println(buf.toString()); |
| <?php | |
| namespace Infun\HttpFoundation\File; | |
| use Symfony\Component\HttpFoundation\File\File; | |
| class ApiUploadedFile extends File | |
| { | |
| public function __construct($base64Content) |
| <?php | |
| namespace Serializer\Handler; | |
| use FOS\RestBundle\View\ViewHandler; | |
| use FOS\RestBundle\View\View; | |
| use Knp\Bundle\PaginatorBundle\Pagination\SlidingPagination; | |
| use Symfony\Component\HttpFoundation\Request; | |
| use Symfony\Component\Routing\RouterInterface; |
| <?php | |
| define('ITERATIONS', 1000 * 1000); | |
| function microtime_float() | |
| { | |
| list($usec, $sec) = explode(" ", microtime()); | |
| return ((float)$usec + (float)$sec); | |
| } |
| Verifying that +kibao is my blockchain ID. https://onename.com/kibao |
| import android.content.Context; | |
| import android.os.Bundle; | |
| import android.os.Parcel; | |
| import android.os.Parcelable; | |
| import android.support.annotation.NonNull; | |
| import android.support.annotation.Nullable; | |
| import android.support.v4.app.Fragment; | |
| import android.support.v4.app.FragmentManager; | |
| import android.support.v4.app.FragmentTransaction; | |
| import android.util.AttributeSet; |
| class Helper { | |
| public static boolean isAppForeground(Context context) { | |
| KeyguardManager keyguardManager = | |
| (KeyguardManager) context.getSystemService(KEYGUARD_SERVICE); | |
| if (keyguardManager.inKeyguardRestrictedInputMode()) { | |
| return false; | |
| } | |
| int myPid = Process.myPid(); | |
| List<RunningAppProcessInfo> runningAppProcesses = |