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 asyncio | |
async def compute(x, y): | |
print("Compute %s + %s ..." % (x, y)) | |
await asyncio.sleep(1.0) | |
return x + y | |
async def print_sum(x, y): | |
result = await compute(x, y) | |
print("%s + %s = %s" % (x, y, result)) |
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
@echo off | |
cls | |
echo [101;93m STYLES [0m | |
echo ^<ESC^>[0m [0mReset[0m | |
echo ^<ESC^>[1m [1mBold[0m | |
echo ^<ESC^>[4m [4mUnderline[0m | |
echo ^<ESC^>[7m [7mInverse[0m | |
echo. | |
echo [101;93m NORMAL FOREGROUND COLORS [0m | |
echo ^<ESC^>[30m [30mBlack[0m (black) |
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
@rem ----[ This code block detects if the script is being running with admin PRIVILEGES If it isn't it pauses and then quits]------- | |
echo OFF | |
NET SESSION >nul 2>&1 | |
IF %ERRORLEVEL% EQU 0 ( | |
ECHO Administrator PRIVILEGES Detected! | |
) ELSE ( | |
echo ######## ######## ######## ####### ######## | |
echo ## ## ## ## ## ## ## ## ## | |
echo ## ## ## ## ## ## ## ## ## | |
echo ###### ######## ######## ## ## ######## |
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
@echo off | |
echo %~1 | |
::::::::::::::::::: has argument ? ::::::::::::::::::: | |
IF ["%~1"]==[""] ( | |
echo Missing argument!!! | |
echo Syntax: | |
echo setup ^<main_repo^> | |
exit /B 1; |
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
##### Color table ##### | |
# Black 0;30 Dark Gray 1;30 | |
# Red 0;31 Light Red 1;31 | |
# Green 0;32 Light Green 1;32 | |
# Brown/Orange 0;33 Yellow 1;33 | |
# Blue 0;34 Light Blue 1;34 | |
# Purple 0;35 Light Purple 1;35 | |
# Cyan 0;36 Light Cyan 1;36 | |
# Light Gray 0;37 White 1;37 | |
if test -t 1; then # if terminal |
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
$("input").on("invalid", function(e) { | |
if (this.validity.valueMissing){ | |
this.setCustomValidity("valueMissing"); | |
} | |
if (this.validity.tooShort){ | |
this.setCustomValidity("tooShort"); | |
} | |
// .... more custom message here. | |
}); | |
$("input").on("input", function(e) { |
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
var app = angular.module("app", ["ngRoute"]); | |
app.config(function ($routeProvider) { | |
$routeProvider | |
.when('/', { | |
templateUrl: "app.html", | |
controller: "ViewCtrl", | |
resolve: { | |
first: function () { | |
return "Hello world"; |
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
<!DOCTYPE html> | |
<html> | |
<head lang="en"> | |
<meta charset="utf-8"> | |
<title>Egghead Videos</title> | |
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/foundation/6.2.4/foundation.css"> | |
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.min.js"></script> | |
<script type="text/javascript" src="main.js"></script> | |
</head> | |
<body ng-app="app" scope="{{$id}}"> |
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
ALTER TABLE revinfo | |
AUTO_INCREMENT = 3; | |
INSERT INTO revinfo | |
(REV, REVTSTMP) | |
VALUES (2, 146613965300); | |
UPDATE revinfo | |
SET REV = REV + 1 | |
WHERE REVTSTMP > 1466139651507 |
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
/** | |
* @file A sample file demo about JSDoc | |
* @author dungdm93 | |
* @since 2016-05-26 | |
*/ | |
/** | |
* Person entity class | |
* @class | |
*/ |
NewerOlder