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 | |
title File uploads | |
body | |
form(method="post", action="/file", enctype="multipart/form-data") | |
input(type="file", name="file") | |
input(type="submit", value="Upload") |
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
tail -f /var/log/syslog | grep CRON |
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
Show hidden characters
{ | |
"extends": ["tslint:recommended", "tslint-react", "tslint-config-prettier"], | |
"linterOptions": { | |
"exclude": [ | |
"config/**/*.js", | |
"node_modules/**/*.ts" | |
] | |
}, | |
"rules": { | |
"variable-name": [true, "allow-leading-underscore"], |
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
command="${1: }" | |
arguments="${@:2}" | |
case ${command} in | |
-h) | |
help | |
;; | |
--help) | |
help | |
;; |
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
alias pl="sed 's/:/\n/g' <<< \"$PATH\"" |
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
# Directory $ | |
export PS1="\n\W \\$ " | |
# With red dir and orange $ | |
export PS1="\n\[\e[31m\]\W\[\e[m\] \\[\e[33m\]$\[\e[m\] " |
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 | |
# This pulls a list of repositories from repositories.txt, and pushes each of them to their new location, including all | |
# branches and tags. | |
# | |
# Please note the following: | |
# - unless the remote is configured to allow a repository to be created when pushing, | |
# the destination repository should be created and empty. | |
# - repositories.txt should have a newline at end of file, otherwise it will not process the last | |
# entry. |
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
<Project Sdk="Microsoft.NET.Sdk.Web"> | |
<PropertyGroup> | |
<TargetFramework>netcoreapp2.2</TargetFramework> | |
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel> | |
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS> | |
</PropertyGroup> | |
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> | |
<DocumentationFile>bin\$(Configuration)\Api.xml</DocumentationFile> |
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 class Role | |
{ | |
public static Role Author {get;} = new Role(0, "Author"); | |
public static Role Editor {get;} = new Role(1, "Editor"); | |
public static Role Administrator {get;} = new Role(2, "Administrator"); | |
public static Role SalesRep {get;} = new Role(3, "Sales Representative"); | |
public string Name { get; private set; } | |
public int Value { get; private set; } |
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
[HttpPost, Route("project/{projectId}/folder/{folderId}/upload")] | |
public async Task<object> UploadFile(string projectId, string folderId) | |
{ | |
var request = Request; | |
// This solution was provided by: http://www.asp.net/web-api/overview/advanced/sending-html-form-data-part-2 | |
// Check if the request contains multipart/form-data. | |
if (!Request.Content.IsMimeMultipartContent()) | |
{ | |
throw new HttpResponseException(HttpStatusCode.UnsupportedMediaType); |
OlderNewer