Skip to content

Instantly share code, notes, and snippets.

@toanz
toanz / GitlabContainerRegistrySetup.md
Created March 14, 2017 07:50 — forked from solidnerd/GitlabContainerRegistrySetup.md
GitLab Container Registry Setup

Settting up a Container Registry with docker-gitlab

This should be used for new users to getting started with the container registry feature on docker-gitlab.

Requirements

@toanz
toanz / bash_aliases
Created November 7, 2017 02:57 — forked from frdmn/bash_aliases
Nginx and PHP-FPM configuration + default virtual host
alias nginx.start='sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.nginx.plist'
alias nginx.stop='sudo launchctl unload /Library/LaunchDaemons/homebrew.mxcl.nginx.plist'
alias nginx.restart='nginx.stop && nginx.start'
alias php-fpm.start="launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.php56.plist"
alias php-fpm.stop="launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.php56.plist"
alias php-fpm.restart='php-fpm.stop && php-fpm.start'
alias mysql.start="launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist"
alias mysql.stop="launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist"
alias mysql.restart='mysql.stop && mysql.start'
alias nginx.logs.error='tail -250f /usr/local/etc/nginx/logs/error.log'
@toanz
toanz / dnsmasq OS X.md
Created January 19, 2018 02:54 — forked from ogrrd/dnsmasq OS X.md
Setup dnsmasq on OS X

Never touch your local /etc/hosts file in OS X again

To setup your computer to work with *.dev domains, e.g. project.dev, awesome.dev and so on, without having to add to your hosts file each time.

Requirements

Install

@toanz
toanz / brew-instructions.sh
Created January 19, 2018 02:54 — forked from petemcw/brew-instructions.sh
Setup dnsmasq on Mac OS X
# Install `dnsmasq` and configure for *.dev domains
$ brew install dnsmasq
$ vim /usr/local/etc/dnsmasq.conf
# Reload configuration and clear cache
$ sudo launchctl unload /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
$ sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
$ dscacheutil -flushcache
@toanz
toanz / userAvatar.js
Created March 9, 2018 06:46 — forked from SylarRuby/userAvatar.js
NodeJs AWS S3 Upload
/**
* This gist was inspired from https://gist.github.com/homam/8646090 which I wanted to work when uploading an image from
* a base64 string.
* This code is used in my startup, Zired.
* Web: http://zired.io
*/
// You can either "yarn add aws-sdk" or "npm i aws-sdk"
const AWS = require('aws-sdk')
@toanz
toanz / app.js
Created March 17, 2018 03:38 — forked from papandreou/app.js
graphqlInMultipartFormDataMiddleware.js
const { graphqlExpress } = require('graphql-server-express');
const graphQlTools = require('graphql-tools');
const schema = graphQlTools.makeExecutableSchema({
typeDefs: schemaText,
resolvers: {
Mutation: {
async uploadFiles(obj, { input }, req, info }) {
// ...
try {
@toanz
toanz / node-cms.md
Created April 9, 2018 06:47 — forked from eyecatchup/node-cms.md
[WIP] List of Node-based content management systems (CMS)
@toanz
toanz / letsencrypt_2017.md
Last active May 9, 2018 14:00 — forked from cecilemuller/letsencrypt_2020.md
How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

There are two main modes to run the Let's Encrypt client (called Certbot):

  • Standalone: replaces the webserver to respond to ACME challenges
  • Webroot: needs your webserver to serve challenges from a known folder.

Webroot is better because it doesn't need to replace Nginx (to bind to port 80).

In the following, we're setting up mydomain.com. HTML is served from /var/www/mydomain, and challenges are served from /var/www/letsencrypt.

@toanz
toanz / header.js
Last active July 6, 2020 09:31
tag manager
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({‘gtm.start’:
new Date().getTime(),event:‘gtm.js’});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!=‘dataLayer’?&l=+l:’’;j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id=’+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,‘script’,‘dataLayer’,‘GTM-P4H2WTX’);
function gtag(){dataLayer.push(arguments);}
</script>
<!-- End Google Tag Manager -->
@toanz
toanz / README.md
Created July 16, 2020 03:58 — forked from LongLiveCHIEF/README.md
Run node, npm, npx, yarn as container

Developing with Node, without installing node!

Note: currently only works on *nix systems (until a powershell script can be created)

With the technique below, you can run node, npm, npx, or yarn commands as if the programs were installed natively on your system, and you won't even know the difference! This includes any ports that your app or dev process will start up and use for development, as well as compatibility with persistent npm config --global cli usage.

See more in the Usage section below.