Skip to content

Instantly share code, notes, and snippets.

View arleighdickerson's full-sized avatar
🦊
Returning to Westinghouse in the fall. Go Bulldogs! 🐶🤓🤠

Arleigh Dickerson arleighdickerson

🦊
Returning to Westinghouse in the fall. Go Bulldogs! 🐶🤓🤠
View GitHub Profile
@bcherny
bcherny / options-in-typescript.ts
Last active February 25, 2023 23:57
Options in TypeScript
type None = {
flatMap<U>(f: (value: null) => Option<U>): None
getOrElse<U>(def: U): U
isEmpty(): true
map<U>(f: (value: null) => U): None
nonEmpty(): false
orElse<U>(alternative: Option<U>): Option<U>
}
type Some<T> = {
@Zagrophyte
Zagrophyte / MS15-034Tester.ps1
Last active April 4, 2021 15:58
Sends a CVE-2015-1635 / MS15-034 Request and checks for vulnerability
# Sends a CVE-2015-1635 / MS15-034 Request and checks for vulnerability
function TestMS15_034($hostname, $port)
{
if ($port -eq $null)
{
$port = 80
}
$tc = New-Object Net.Sockets.TcpClient
@arbabnazar
arbabnazar / vagrant-aws
Last active July 9, 2019 17:57
vagrant file for creating an ec2 instance on aws
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "aws"
config.vm.synced_folder ".", "/vagrant", disabled: true
config.vm.provider :aws do |aws, override|
aws.access_key_id = ENV['AWS_ACCESS_KEY']
aws.secret_access_key = ENV['AWS_SECRET_KEY']
@jordancalder
jordancalder / gist:6817ef9bf045f1262eab
Created January 26, 2015 19:56
Install MongoDB on AWS
echo "[MongoDB]
name=MongoDB Repository
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64
gpgcheck=0
enabled=1" | sudo tee -a /etc/yum.repos.d/mongodb.repo
sudo yum install -y mongodb-org-server mongodb-org-shell mongodb-org-tools
sudo mkdir /data /log /journal
@mikehaertl
mikehaertl / README.md
Last active September 19, 2022 21:20
How to develop with docker and Yii2

Docker Development Workflow

These ideas are WORK IN PROGRESS!

Summary

The core idea with this workflow is that we end up with a self contained docker image of your application. This image will not only contain our code, but also all the dependencies that are neccessary to run the code. This image can then be used for both, easy deployment in production and as basis for ongoing development.

The image is not a static, though. In fact, it will see many revisions over time - which is supported nicely through dockers inheritance approach. We basically

@NTICompass
NTICompass / moment.phpDateFormat.js
Last active May 25, 2018 02:15
Use PHP's date() formats in moment.js
(function(m){
/*
* PHP => moment.js
*
* http://www.php.net/manual/en/function.date.php
* http://momentjs.com/docs/#/displaying/format/
*/
var formatMap = {
d: 'DD',
D: 'ddd',
@fullstackto
fullstackto / Responsive canvas redrawing of Chart.js using jQuery
Created February 27, 2014 21:32
Responsive canvas redrawing of Chart.js using jQuery
var width = $('canvas').parent().width();
$('canvas').attr("width",width);
new Chart(ctx).Line(data,options);
window.onresize = function(event){
var width = $('canvas').parent().width();
$('canvas').attr("width",width);
new Chart(ctx).Line(data,options);
};
# Install dependencies
#
# * checkinstall: package the .deb
# * libpcre3, libpcre3-dev: required for HTTP rewrite module
# * zlib1g zlib1g-dbg zlib1g-dev: required for HTTP gzip module
apt-get install checkinstall libpcre3 libpcre3-dev zlib1g zlib1g-dbg zlib1g-dev && \
mkdir -p ~/sources/ && \
# Compile against OpenSSL to enable NPN
@mpilone
mpilone / VaadinSecurityContext.java
Created July 31, 2013 15:00
Vaadin, Shiro, and Push. Support classes to integrate Shiro with Vaadin 7.1+ push support. See http://mikepilone.blogspot.com/ for more information.
package org.mpilone.util.shiro;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.mgt.DefaultSecurityManager;
import org.apache.shiro.mgt.SecurityManager;
import org.apache.shiro.subject.PrincipalCollection;
import org.apache.shiro.subject.Subject;
import org.mpilone.util.shiro.SecurityContext;
import com.vaadin.server.VaadinSession;
@mariussoutier
mariussoutier / JsonFormats.scala
Last active December 6, 2016 07:19
ReactiveMongo Play Plugin Extensions
package json
import reactivemongo.bson._
import reactivemongo.bson.handlers.DefaultBSONHandlers._
import play.api.libs.json._
import play.api.libs.json.Json._
import play.api.libs.json.util._
import play.api.libs.json.Writes._
import play.api.libs.functional.syntax._