Skip to content

Instantly share code, notes, and snippets.

View and2long's full-sized avatar
🏠
Working from home

Lilong Zhang and2long

🏠
Working from home
View GitHub Profile
@johnestima
johnestima / cognito-delete-all-users.sh
Created August 21, 2020 17:21
Cognito delete all users from user pool
#!/bin/bash
USER_POOL_ID=POOL_ID
RUN=1
until [ $RUN -eq 0 ] ; do
echo "Listing users"
USERS=`aws cognito-idp list-users --user-pool-id ${USER_POOL_ID} | grep Username | awk -F: '{print $2}' | sed -e 's/\"//g' | sed -e 's/,//g'`
if [ ! "x$USERS" = "x" ] ; then
for user in $USERS; do
@sandabu
sandabu / Example.php
Last active February 7, 2022 12:14
Stripe API Japanese Error Messages
<?php
//Composerでstripe/stripe-php をrequire済み
require_once __FILE__. './jp.php';
try{
Stripe\Stripe::setApiKey('sk_test_YOUR_KEY');
Stripe\Charge::create([]);
}catch(Stripe\Error\Base $e) {
$err = $e->getJsonBody()['error'];
if(key_exists('code', $err)) {
@goodev
goodev / AndroidLogKotlin.xml
Last active November 1, 2021 07:29
Android log live template for kotlin:
<templateSet group="AndroidLogKotlin">
<template name="logm" value="android.util.Log.d(TAG, $FORMAT$)" description="Log method name and its arguments" toReformat="true" toShortenFQNames="true">
<variable name="FORMAT" expression="groovyScript(&quot;def params = _2.collect {it + ' = [$' + it + ']'}.join(', '); return '\&quot;' + _1 + '() called' + (params.empty ? '' : ' with: ' + params) + '\&quot;'&quot;, kotlinFunctionName(), functionParameters())" defaultValue="" alwaysStopAt="false" />
<context>
<option name="KOTLIN_STATEMENT" value="true" />
</context>
</template>
<template name="logd" value="android.util.Log.d(TAG, &quot;$METHOD_NAME$: $content$&quot;)" description="Log.d(String)" toReformat="true" toShortenFQNames="true">
<variable name="METHOD_NAME" expression="kotlinFunctionName()" defaultValue="" alwaysStopAt="false" />
<variable name="content" expression="" defaultValue="" alwaysStopAt="true" />
@parmentf
parmentf / GitCommitEmoji.md
Last active May 24, 2024 00:27
Git Commit message Emoji
@chenshengzhi
chenshengzhi / gemUninstallAllPackets.sh
Created November 6, 2015 01:46
卸载所有gem包
for i in `gem list --no-versions`; do sudo gem uninstall -aIx $i; done
@zeroseis
zeroseis / disable-auto-android-file-transfer.md
Created September 14, 2015 17:28
Disable auto start for Android File Transfer
  • Close Android File Transfer
  • Open Activity Monitor and kill “Android File Transfer Agent”
  • Go to where you installed “Android File Transfer.app” (I have it under /Applications)
  • Ctrl+click –> “Show package contents”
  • Go to Contents/Resources
  • Rename “Android File Transfer Agent” to e.g. “Android File Transfer Agent_DISABLED”
  • Then go to “/Users/username/Library/Application Support/Google/Android File Transfer” and again rename the Agent app.