Skip to content

Instantly share code, notes, and snippets.

@balupton
balupton / next.config.js
Created February 3, 2017 16:00
next.js webpack configs
module.exports = {
webpack: (config) => {
const webpack = require('webpack')
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
config.plugins = config.plugins || []
config.plugins.push(new webpack.ContextReplacementPlugin(/moment[/\\]locale$/, /en/))
config.plugins.push(new BundleAnalyzerPlugin())
return config
}
}
@ryanttb
ryanttb / install_node_lsw.sh
Last active December 4, 2019 14:28
Install node on Linux Subsystem for Windows
#!/bin/sh
# this script requires root
# be sure to run the following before running this:
# $ sudo su
# since there's an issue piping the curl response to bash
# just download the install script
curl -sL https://deb.nodesource.com/setup_6.x > install_node.sh
package ws.eiennohito.utils.serialization
import java.lang.reflect.Modifier
import java.util.concurrent.ConcurrentHashMap
import akka.serialization.Serializer
import com.google.protobuf.CodedOutputStream
import com.trueaccord.scalapb.{GeneratedMessage, GeneratedMessageCompanion}
import com.typesafe.scalalogging.StrictLogging
Datomic.q(Query(
s"""[:find ?name
:in $$
:where [_ :db/ident ?ident]
[(namespace ?ident) ?ns]
[(name ?ident) ?name]
[(= ?ns "namespace_name")]
]"""
), database).foreach {
case name: String => println(name)
@santoshachari
santoshachari / nginx.default.conf
Last active February 22, 2022 22:11 — forked from sumardi/nginx.default.conf
PHP5.6 and NGINX: Install PHP56-FPM, Nginx & MySQL on EC2 with Amazon Linux AMI
# Install linux update, followed by GCC and Make
sudo yum -y update
sudo yum install -y gcc make
# Install Nginx and php56-FPM
sudo yum install -y nginx php56-fpm
# Install php56 extensions
sudo yum install -y php56-devel php-mysql php56-pdo php56-pear php56-mbstring php56-cli php56-odbc php56-imap php56-gd php56-xml php56-soap
@jorihardman
jorihardman / sumo_logic.config
Last active April 27, 2023 18:43
Elastic Beanstalk Sumo Logic Config
# This will automatically install the Sumo Logic collector on AWS Elastic
# Beanstalk instances. Add this to the .ebextensions folder in your app root
# and edit L24-25 to match your Sumo Logic accessid and accesskey. To add or
# remove tracked files, simply add or remove source hashes to the sources
# array on L36.
packages:
rpm:
SumoCollector: https://collectors.sumologic.com/rest/download/rpm/64
services:
@chrismdp
chrismdp / s3.sh
Last active March 5, 2024 12:57
Uploading to S3 in 18 lines of Shell (used to upload builds for http://soltrader.net)
# You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine
# This is how I upload my new Sol Trader builds (http://soltrader.net)
# Based on a modified script from here: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash
S3KEY="my aws key"
S3SECRET="my aws secret" # pass these in
function putS3
{
path=$1
@tanitanin
tanitanin / optionBinder.scala
Last active July 27, 2018 18:58
QueryStringBindable and Formatter for Option[T] ( @ Play Framework 2.x )
import play.api.data._
import play.api.data.format._
import play.api.data.format.Formats._
/**
* Option[T]をクエリとして解決するためのバインダ(必須でないパラメータなどに利用することを想定)
* 通常のFormと同様にbindFromRequestして使う
* クエリに該当するキーが含まれていない場合にはFormの値がNoneになる
*
* こんなかんじ (もっときれいに書きたいけど):
@iansltx
iansltx / _safari-iframe-cookie-workaround.md
Last active April 7, 2024 15:44
Safari iframe cookie workaround