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/bash | |
cd ~ | |
git clone https://github.com/m00zi/dblb.git | |
cd dblb | |
bash build.sh |
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 <iostream> | |
using namespace std; | |
// get max element of array | |
int findMax(int myArr[]) { | |
int max = myArr[0]; | |
for (int i = 0; i < 5; i++) { | |
if (myArr[i] > max) { | |
max = myArr[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
package main | |
import ( | |
"context" | |
"flag" | |
"fmt" | |
"log" | |
"net/http" | |
"os" | |
"os/signal" |
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
// npm install fs-extra concat --save-dev | |
// place this file in the root of project next to angular.json | |
const fs = require('fs-extra'); | |
const concat = require('concat'); | |
(async function build() { | |
const files = [ | |
'./dist/app/runtime.js', | |
'./dist/app/polyfills.js', | |
'./dist/app/main.js', |
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
// Connect to database | |
func InitDataDB(dsn string, autoMigrate bool) (db *gorm.DB, err error) { | |
db, err = gorm.Open("mysql", dsn) | |
if err != nil { | |
log.Fatalf("error while open connection to database: %v\n", err) | |
} | |
//SetMaxIdleConns sets the maximum number of connections in the idle connection pool. | |
//If MaxOpenConns is greater than 0 but less than the new MaxIdleConns, then the new MaxIdleConns will be | |
//reduced to match the MaxOpenConns limit. |
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
# HAPROXY Config for FTP | |
# my apologies for the spacing | |
global | |
log 127.0.0.1 local0 info | |
chroot /var/lib/haproxy | |
user haproxy | |
group haproxy | |
defaults | |
log global |
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 'dart:io'; | |
import 'package:dio/dio.dart'; | |
import 'package:freezed_annotation/freezed_annotation.dart'; | |
part 'network_exceptions.freezed.dart'; | |
@freezed | |
abstract class NetworkExceptions with _$NetworkExceptions { | |
const factory NetworkExceptions.requestCancelled() = RequestCancelled; |
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 'package:flutter/material.dart'; | |
void main() => runApp(new MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return new MaterialApp( | |
title: 'Flutter Demo', | |
theme: new ThemeData( |
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 main | |
import ( | |
"context" | |
"log" | |
"net/http" | |
"time" | |
"github.com/gin-gonic/gin" | |
) |
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 main | |
import ( | |
"context" | |
"fmt" | |
"log" | |
"net/http" | |
"os" | |
"os/signal" | |
"strconv" |
NewerOlder