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 // index.php | |
// bulletproof debug mode | |
define("DEBUG_MODE", rand(1, 2) === 1); | |
if (isset($_GET["trigger"]) && DEBUG_MODE) { | |
file_put_contents("request.dat", serialize(get_defined_vars())); | |
} | |
// go through normal stuff, start the app, etc. |
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
#!/usr/bin/env perl -w | |
use strict; | |
use warnings; | |
use Test::Simple tests => 7; | |
sub check_output_contains { | |
my $output = shift; | |
my $wanted = shift; |
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 <stdio.h> | |
#include <stdlib.h> | |
#define LINE_LENGTH 1024 | |
int get_line_with_prefix_from_file(const char* prefix, FILE* file, char* result_buf) { | |
char line_buf[LINE_LENGTH]; | |
int matches = 0; | |
while (fgets(line_buf, LINE_LENGTH, file)) { |
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
wget https://github.com/spf13/hugo/releases/download/v0.11/hugo_0.11_linux_386.tar.gz | |
tar xvzf hugo_0.11_linux_386.tar.gz | |
mv hugo_0.11_linux_386/hugo_0.11_linux_386 hugo | |
chmod +x ./hugo | |
./hugo new site blah | |
echo "your new site is in 'blah'" |
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 | |
use Illuminate\Console\Command; | |
use Illuminate\Foundation\Testing\Client; | |
use Symfony\Component\Console\Input\InputOption; | |
use Symfony\Component\Console\Input\InputArgument; | |
class SnapshotCommand extends Command | |
{ | |
/** |
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
# move all the front-end assets into a public dir | |
find . -type f \( \ | |
-name "*.css" -o \ | |
-name "*.html" -o \ | |
-name "*.js" -o \ | |
-name "robots.txt" -o \ | |
-name "humans.txt" -o \ | |
-name "favicon.ico" -o \ | |
-name ".htaccess" \) | | |
while read file |
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
# sources: | |
# - http://stackoverflow.com/questions/24585419/ | |
# - https://coreos.com/docs/running-coreos/bare-metal/installing-to-disk/ | |
# - https://www.linode.com/docs/platform/custom-kernels-distros/run-a-distributionsupplied-kernel-with-pvgrub | |
set -e -o pipefail | |
apt-get update -y | |
apt-get upgrade -y --show-upgraded | |
mkdir /boot/grub |
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 | |
abstract class Result | |
{ | |
public static function fromValue($value, $reject = null) | |
{ | |
return ($value !== $reject) ? new Success($value) : new Failure; | |
} | |
public static function failOnException($callback) |
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> | |
<meta charset="utf-8"> | |
<title>socketdotnet</title> | |
<meta name="description" content=""> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
</head> | |
<body> |
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 ( | |
"encoding/json" | |
"errors" | |
"flag" | |
"fmt" | |
"io/ioutil" | |
"net/http" | |
"os" |
OlderNewer