This file contains 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
<?php | |
use Illuminate\Support\Facades\Storage; | |
$public = Storage::disk('public'); | |
$s3 = Storage::disk('s3'); | |
$files = $public->files(null, true); | |
foreach ($files as $file) { |
This file contains 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
package com.vaibhavpandey.trimview; | |
import android.content.Context; | |
import android.content.res.TypedArray; | |
import android.graphics.Bitmap; | |
import android.graphics.Canvas; | |
import android.media.MediaMetadataRetriever; | |
import android.media.ThumbnailUtils; | |
import android.net.Uri; | |
import android.os.Build; |
This file contains 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
import android.graphics.Bitmap | |
import com.squareup.gifencoder.* | |
import java.io.File | |
import java.io.OutputStream | |
import java.util.concurrent.TimeUnit | |
class GifBuilder(file: File, | |
width: Int, | |
height: Int, | |
private val delay: Long = 250, |
This file contains 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
import android.os.Handler | |
import java.util.concurrent.TimeUnit | |
class ResumableTimer( | |
private var duration: Long, // in milliseconds | |
private var delay: Long = TimeUnit.SECONDS.toMillis(1), // in milliseconds | |
private val listener: OnCountDownListener? | |
) { |
This file contains 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
import android.annotation.SuppressLint | |
import android.content.Context | |
import android.util.AttributeSet | |
import android.view.MotionEvent | |
import com.otaliastudios.cameraview.CameraView | |
import kotlin.math.abs | |
class SwipeableCameraView(context: Context, attributes: AttributeSet) : CameraView(context, attributes) { |
This file contains 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
import java.io.IOException | |
import java.io.OutputStream | |
class WavHeader ( | |
private val format: Int = 0, | |
private val channels: Int = 0, | |
private val hertz: Int = 0, | |
private val bitrate: Int = 0, | |
private val size: Int = 0 | |
) { |
This file contains 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
package the.example.app | |
import android.content.ContentUris | |
import android.content.Context | |
import android.database.Cursor | |
import android.net.Uri | |
import android.os.Build | |
import android.os.Environment | |
import android.provider.DocumentsContract | |
import android.provider.MediaStore |
This file contains 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
#include <QCryptographicHash> | |
#include <QRandomGenerator> | |
#include <QStringList> | |
#include <openssl/conf.h> | |
#include <openssl/evp.h> | |
#include "SecurityUtil.h" | |
static char *bytes2chara(const QByteArray &bytes) { | |
auto size = bytes.size() + 1; | |
auto data = new char[size]; |
This file contains 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
import facebook | |
import os | |
import requests | |
APP_ID = os.getenv('FACEBOOK_APP_ID') | |
APP_SECRET = os.getenv('FACEBOOK_APP_SECRET') | |
LLT_ENDPOINT = 'https://graph.facebook.com/oauth/access_token?grant_type=fb_exchange_token&client_id=%s&client_secret' \ | |
'=%s&fb_exchange_token=%s ' |
This file contains 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
QRegularExpression emails(R"([A-Z0-9a-z._-]{1,}@(\w+)\.(\w+)(?:\.(\w+))?)"); | |
auto matches = emails.globalMatch(html); | |
while (matches.hasNext()) { | |
auto match = matches.next(); | |
if (match.hasMatch()) { | |
auto email = match.captured(0); | |
} | |
} |