This file contains hidden or 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
// Write a pid file, but first make sure it doesn't exist with a running pid. | |
func writePidFile(pidFile string) error { | |
// Read in the pid file as a slice of bytes. | |
if piddata, err := ioutil.ReadFile(pidFile); err == nil { | |
// Convert the file contents to an integer. | |
if pid, err := strconv.Atoi(string(piddata)); err == nil { | |
// Look for the pid in the process list. | |
if process, err := os.FindProcess(pid); err == nil { | |
// Send the process a signal zero kill. | |
if err := process.Signal(syscall.Signal(0)); err == nil { |
This file contains hidden or 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 SimpleHTTPServer | |
import SocketServer | |
from time import sleep | |
PORT = 5000 | |
SLEEP_TIME = 6 | |
class SlowHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): | |
def do_GET(self): |
This file contains hidden or 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 ( | |
"fmt" | |
"github.com/go-gomail/gomail" | |
) | |
func main () { | |
fmt.Printf("Hello") | |
m := gomail.NewMessage() |
This file contains hidden or 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>Servers Down</title> | |
<link href="https://fonts.googleapis.com/css?family=Inconsolata|Roboto:400,700" rel="stylesheet"> | |
<link rel="stylesheet" type="text/css" href="style.css"> | |
</head> | |
<body> | |
<h1>Our servers are currently down</h1> | |
<p>Our servers have shut down because an unauthorised device was in access of our database,<br> We immediately shut down the server to stop anymore damage possible to the server.<br> <a href="learnmore.html" target="_blank">Learn More!</a></p> |
This file contains hidden or 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 | |
namespace App\Providers; | |
use Illuminate\Support\ServiceProvider; | |
use Aws\S3\S3Client; | |
use League\Flysystem\AwsS3v3\AwsS3Adapter; | |
use League\Flysystem\Filesystem; | |
use Storage; |
This file contains hidden or 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
daemon off; | |
worker_processes auto; | |
error_log /var/log/nginx/error.log debug; | |
events { | |
worker_connections 1024; | |
} |
This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>CFBundleExecutable</key> | |
<string>myapp</string> | |
<key>CFBundleIdentifier</key> | |
<string>com.pocketgophers.myapp</string> | |
<key>CFBundleURLTypes</key> | |
<array> |
This file contains hidden or 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 os | |
cows = os.listdir('/usr/share/cowsay/cows') | |
base = r""" | |
@commands.command(aliases=['{0}']) | |
async def {1}say(self, *, txt:str): | |
msg = await self.do_cowsay(txt, '{0}') | |
await self.bot.say("```\n"+msg[:1992]+"```") | |
""" |
This file contains hidden or 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 | |
/** | |
* @link | |
* @since 1.0.0 | |
* @package TODO | |
* | |
* @wordpress-plugin | |
* Plugin Name: Use MailHog | |
* Description: Configure WordPress on Valet to use MailHog | |
* Version: 1.0.0 |
This file contains hidden or 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 | |
include("db.php"); | |
$str=mysqli_real_escape_string($con,$_GET["str"]); | |
//Get data's from the Table | |
if(isset($str)) | |
{ |