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
const features = (...features) => BaseClass => | |
features.forEach(feature => { | |
for (const methodName of Object.getOwnPropertyNames(feature)) { | |
if (BaseClass.prototype.hasOwnProperty(methodName)) { | |
throw Error( | |
`Method <${methodName}> in <${BaseClass.name}> exists in a feature.` | |
); | |
} | |
} |
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 | |
HOST=${1} | |
mkdir -p ~/.ssl | |
# generate cert and key | |
openssl req -newkey rsa:2048 -x509 -nodes -keyout ~/.ssl/$HOST.key -new -out ~/.ssl/$HOST.crt -subj /CN=$HOST -reqexts SAN -extensions SAN -config <(cat /System/Library/OpenSSL/openssl.cnf <(printf "[SAN]\nsubjectAltName=DNS:${HOST}")) -sha256 -days 3650 | |
# add to keychains | |
sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain ~/.ssl/${HOST}.crt |
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 | |
BACKUP_PATH=/Volumes/WD-BACKUP-DUO/Backups.backupdb/xx/$1* | |
echo "want to delete: $1"; | |
for i in $BACKUP_PATH ; | |
do | |
echo "$i"; | |
done |
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
server { | |
listen 80; | |
server_name domain.com; | |
root /var/www/domain.com/public; | |
# enable gzip compression | |
gzip on; | |
gzip_min_length 1100; | |
gzip_buffers 4 32k; | |
gzip_types text/plain application/x-javascript image/svg+xml text/xml text/css; |
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
@section('css') | |
<link rel="stylesheet" href="css/field1.css" /> | |
@parent | |
@stop | |
@section('js') | |
<script src="js/field1.js"></script> | |
@parent | |
@stop |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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>Bootstrap 101 Template</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<!-- Bootstrap --> | |
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0-rc1/css/bootstrap.min.css"> | |
</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
var EventUtil = { | |
addHandler: function(element, type, handler) { | |
if (element.addEventListener) { | |
element.addEventListener(type, handler, false); | |
} else if ( element.attachEvent ) { | |
element.attachEvent("on" + type, handler); | |
} else { | |
element["on"+type] = handler; | |
} |
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/sh | |
# | |
# This shell script passes all its arguments to the binary inside the | |
# MacVim.app application bundle. If you make links to this script as view, | |
# gvim, etc., then it will peek at the name used to call it and set options | |
# appropriately. | |
# | |
# Based on a script by Wout Mertens and suggestions from Laurent Bihanic. This | |
# version is the fault of Benji Fisher, 16 May 2005 (with modifications by Nico | |
# Weber and Bjorn Winckler, Aug 13 2007). |
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
<snippet> | |
<content><![CDATA[ | |
namespace ${1:Vendor}\\${2:Package}; | |
use Illuminate\Console\Command; | |
use Symfony\Component\Console\Input\InputOption; | |
use Symfony\Component\Console\Input\InputArgument; | |
class ${2:Package}CreatorCommand extends Command { |
NewerOlder