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 | |
/* | |
|-------------------------------------------------------------------------- | |
| Web Routes | |
|-------------------------------------------------------------------------- | |
| | |
| Here is where you can register web routes for your application. These | |
| routes are loaded by the RouteServiceProvider within a group which | |
| contains the "web" middleware group. Now create something great! |
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
public function base64Storage($input, $destination, $rename = "") | |
{ | |
list($type, $data) = explode(';', $input); | |
list(, $data) = explode(',', $data); | |
$data = base64_decode($data); | |
$file_name = sha1(time()) ; | |
$extention = explode('/', $type)[1] ; | |
$full_file_name = $file_name.'.'.$extention ; |
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
# Environment variables you need to set so you don't have to edit the script below. | |
export DOCKER_CHANNEL=edge | |
export DOCKER_COMPOSE_VERSION=1.21.0 | |
# Update the apt package index. | |
sudo apt-get update | |
# Install packages to allow apt to use a repository over HTTPS. | |
sudo apt-get install -y \ | |
apt-transport-https \ |
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
#!/bin/sh | |
parse_yaml() { | |
local prefix=$2 | |
local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @|tr @ '\034') | |
sed -ne "s|^\($s\)\($w\)$s:$s\"\(.*\)\"$s\$|\1$fs\2$fs\3|p" \ | |
-e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 | | |
awk -F$fs '{ | |
indent = length($1)/2; | |
vname[indent] = $2; | |
for (i in vname) {if (i > indent) {delete vname[i]}} |
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
#### db.js #### | |
import Realm from 'realm' | |
import Log from './schema/Log'; | |
import Setting from './schema/Setting'; | |
import UserProfile from './schema/UserProfile'; | |
import { asyncGetEncyptionKey } from '../src/utils'; | |
class db { | |
static realmInstance = null |
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 React, { useEffect } from "react"; | |
import { | |
Text, | |
View, | |
SafeAreaView, | |
ScrollView, | |
StyleSheet, | |
TouchableOpacity, | |
Image, | |
Platform |
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
{ | |
"data": { | |
"type": "any", | |
"required": true | |
}, | |
"meta": { | |
"response_code": { | |
"type": "string", | |
"pattern": "[0-9]{5}" | |
}, |
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
numCase = int(input()) | |
for c in range(numCase): | |
size = int(input()) | |
matrix = [] | |
rowCount = 0 | |
colCount = 0 | |
tranceCount = 0 | |
for i in range(size): | |
matrix.append(input().split(" ")) | |
# row |
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
def get_current_parentheses(current, previous, next): | |
before = "" | |
after = "" | |
if current == 0: | |
return "0" | |
if current == next: | |
pass | |
elif current > next: | |
after = ")" * (current - next) | |
# else: |
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
5 | |
3 | |
360 480 | |
420 540 | |
600 660 | |
3 | |
0 1440 | |
1 3 | |
2 4 | |
5 |
OlderNewer