Skip to content

Instantly share code, notes, and snippets.

@zgia
zgia / debugDumpParams.php
Created August 5, 2020 14:05
PDOStatement::debugDumpParams
<?php
try {
$dbh = new PDO('mysql:host=127.0.0.1;dbname=mysql', 'root', 'pwd');
$host = 'localhost';
$sth = $dbh->prepare('SELECT * FROM user WHERE Host = :host');
$sth->bindValue(':host', $host, PDO::PARAM_STR);
$sth->execute();
@zgia
zgia / van-action-sheet
Created March 22, 2020 15:20
van-action-sheet
<template>
<div class="container">
<van-action-sheet show="{{ deleteFileConfirm }}"
actions="[{ name: '删除', color: '#ff0000' }]"
cancel-text="取消"
description="您要删除此文件吗?删除后不可以恢复。"
bind:close="onCancelAction"
bind:cancel="onCancelAction"
bind:select="doDeleteFile" />
@zgia
zgia / gist:36f793f5d592855ab1cdccb61522d660
Created March 10, 2020 06:44
van-checkbox-group horizontal is invalid
<van-cell-group title="标签">
<van-checkbox-group value="{{ tags }}" bind:change="onChangeTags" direction="horizontal">
<block v-for="(tagid, tagtitle) in tagList" :key="{{ tagid }}">
<van-checkbox name="{{ tagid }}" shape="square">{{ tagtitle }}</van-checkbox>
</block>
</van-checkbox-group>
</van-cell-group>
@zgia
zgia / gist:3e31d417df6e944f79c5d4b78aa7e36e
Created April 26, 2018 04:43 — forked from psayre23/gist:c30a821239f4818b0709
Runtime Complexity of Java Collections
Below are the Big O performance of common functions of different Java Collections.
List | Add | Remove | Get | Contains | Next | Data Structure
---------------------|------|--------|------|----------|------|---------------
ArrayList | O(1) | O(n) | O(1) | O(n) | O(1) | Array
LinkedList | O(1) | O(1) | O(n) | O(n) | O(1) | Linked List
CopyOnWriteArrayList | O(n) | O(n) | O(1) | O(n) | O(1) | Array
@zgia
zgia / rfc6750.md
Created May 30, 2016 10:05 — forked from yorkxin/rfc6750.md
RFC 6750 in Markdown - Edited from http://tools.ietf.org/rfc/rfc6750.txt
Internet Engineering Task Force (IETF)                          M. Jones
Request for Comments: 6750                                     Microsoft
Category: Standards Track                                       D. Hardt
ISSN: 2070-1721                                              Independent
                                                            October 2012

The OAuth 2.0 Authorization Framework: Bearer Token Usage

Abstract

@zgia
zgia / MyAppDelegate.m
Created November 28, 2011 14:39 — forked from Nitewriter/MyAppDelegate.m
UINavigationController custom navigation bar
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
// Create a new window and assign directly to provided iVar
_window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Implementation of new init method
MyCustomNavigationBar *navigationBar = [[MyCustomNavigationBar alloc] initWithFrame:CGRectZero];
UINavigationController *navigationController = [[UINavigationController alloc] initWithCustomNavigationBar:navigationBar];