Skip to content

Instantly share code, notes, and snippets.

View Fykec's full-sized avatar

yinjiaji Fykec

View GitHub Profile
@nbouvrette
nbouvrette / inputTypeNumberPolyfill.js
Last active March 28, 2023 11:26
Stand alone JavaScript polyfill allow only numbers on input of type number.
/**
* Stand alone polyfill allow only numbers on input of type number.
*
* While input filtering is already supported by default by some browsers, maximum length has not been implemented by
* any. This script will solve both issue and make sure that only digits can be entered in input elements of type
* number. If the optional attribute `max` is set, it will calculate it's length and mimic the `maxlength` behavior on
* input of type text.
*
* Supports:
*
@martinesmann
martinesmann / 0README.md
Last active November 2, 2023 14:02
Couchbase N1QL Samples.

#Learn N1QL by sample

N1QL is the document query language used to query data in Couchbase Server (CB). N1QL will be an integrated part of CB 4, until then there is a preview version available.

##SQL for JSON Documents N1QL is the first language to combine the flexibility of JSON with power of SQL queries. With N1QL you can run SQL like queries against your CB data without the need to pre-build views. N1QL enables advanced ad-hoc document queries in a familiar query language.

##Learning

@j3j5
j3j5 / gist:8b3e48ccad746b90a54a
Last active November 16, 2023 15:11
Adyen Test Card Numbers
Adyen Test Card Numbers
These cards are only valid on our TEST system and they will never involve any actual transaction or transfer of funds. The TEST card numbers will not work on the Adyen LIVE Platform.
For all cards use the following expiration and CVV2/CVC2/or CID for Amex.
For all cards:
Expiration Dates CVV2 / CVC3 CID (American Express)
08/2018 OR 10/2020 737 7373
@vitorbritto
vitorbritto / rm_mysql.md
Last active November 5, 2024 05:41
Remove MySQL completely from Mac OSX

Remove MySQL completely

  1. Open the Terminal

  2. Use mysqldump to backup your databases

  3. Check for MySQL processes with: ps -ax | grep mysql

  4. Stop and kill any MySQL processes

  5. Analyze MySQL on HomeBrew:

    brew remove mysql
    
@prachigauriar
prachigauriar / QLCDispatchAsyncWithCompletionAndTimeout.m
Last active May 28, 2022 18:23
Examples in Objective-C and Swift that use dispatch_async and dispatch_semaphore to cleanly replicate the behavior of ‑[NSCondition waitUntilDate:].
//
// QLCDispatchAsyncWithCompletionAndTimeout.m
// Blocks-WaitUntilDate
//
// Created by Prachi Gauriar on 12/23/2013.
// Copyright (c) 2013 Prachi Gauriar.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
@scottslowe
scottslowe / pretty-json
Created November 8, 2013 12:09
This output came from running the raw JSON-serialized response to a REST API through the python json.tool command.
{
"result_count": 3,
"results": [
{
"_href": "/ws.v1/lswitch/3ca2d5ef-6a0f-4392-9ec1-a6645234bc55",
"_schema": "/ws.v1/schema/LogicalSwitchConfig",
"type": "LogicalSwitchConfig"
},
{
"_href": "/ws.v1/lswitch/81f51868-2142-48a8-93ff-ef612249e025",
@adamwiggins
adamwiggins / adams-heroku-values.md
Last active November 5, 2024 21:40
My Heroku values

Make it real

Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.

Ship it

Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.

Do it with style

@mattt
mattt / uiappearance-selector.md
Last active September 24, 2024 12:59
A list of methods and properties conforming to `UIAppearance` as of iOS 12 Beta 3

Generate the list yourself:

$ cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS*.sdk/System/Library/Frameworks/UIKit.framework/Headers
$ grep UI_APPEARANCE_SELECTOR ./*     | \
  sed 's/NS_AVAILABLE_IOS(.*)//g'     | \
  sed 's/NS_DEPRECATED_IOS(.*)//g'    | \
  sed 's/API_AVAILABLE(.*)//g'        | \
  sed 's/API_UNAVAILABLE(.*)//g'      | \
 sed 's/UI_APPEARANCE_SELECTOR//g' | \

Mac自带的Boot Camp程序,可以非常便利地帮助用户在Mac电脑上同时安装一个Windows系统。针对Macbook Air用户,这里记录下在没有光驱的情况下,使用USB制作启动盘来安装Windows的过程。

需要准备的物品:

1、U盘一个(>= 4g) 2、win7镜像文件(.iso) 3、rEFIT.dmg(用于让不支持USB等外设设备启动引导的设备能识别USB设备启动)

制作启动盘

@adamgit
adamgit / .gitignore
Last active November 11, 2024 06:14
.gitignore file for Xcode4 / OS X Source projects
#########################
# .gitignore file for Xcode4 and Xcode5 Source projects
#
# Apple bugs, waiting for Apple to fix/respond:
#
# 15564624 - what does the xccheckout file in Xcode5 do? Where's the documentation?
#
# Version 2.6
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
#