Skip to content

Instantly share code, notes, and snippets.

@oodavid
oodavid / README.md
Last active October 11, 2024 00:36 — forked from aronwoost/README.md
Deploy your site with git

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
@Adirael
Adirael / fix-wordpress-permissions.sh
Created August 17, 2012 23:16
Fix wordpress file permissions
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org>
#
WP_OWNER=www-data # <-- wordpress owner
WP_GROUP=www-data # <-- wordpress group
WP_ROOT=$1 # <-- wordpress root directory
@pertrai1
pertrai1 / sass media queries
Created September 25, 2012 11:55
Sass Media Queries
// Media Queries in Sass 3.2
//
// These mixins make media queries a breeze with Sass.
// The media queries from mobile up until desktop all
// trigger at different points along the way
//
// And important point to remember is that and width
// over the portrait width is considered to be part of the
// landscape width. This allows us to capture widths of devices
// that might not fit the dimensions exactly. This means the break
@davidlumley
davidlumley / client.rb
Last active March 23, 2020 18:42
Collection of XML requests and responses from AutoTasks SOAP API
=begin
======
example Savon client for connecting to AutoTask's SOAP API
- install savon via `gem install savon`
- ensure AUTOTASK_USERNAME and AUTOTASK_PASSWORD environment variables are set
=====
=end
@sogko
sogko / app.js
Last active November 8, 2022 12:31
gulp + expressjs + nodemon + browser-sync
'use strict';
// simple express server
var express = require('express');
var app = express();
var router = express.Router();
app.use(express.static('public'));
app.get('/', function(req, res) {
res.sendfile('./public/index.html');
@woloski
woloski / multitenant.md
Last active February 11, 2024 23:14
Multi Tenant Apps in Auth0

Multitenancy refers to a principle in software architecture where a single instance of the software runs on a server, serving multiple client-organizations (tenants)

Let's start by enumerating some multi tenant applications and understand how they handle it.

Slack

Authentication:

@Lissy93
Lissy93 / gulpfile.js
Last active April 2, 2018 08:15
An over-commented example of a Gulp setup for Express Node apps, with live reload from browser-sync and nodemon as well as a complete build setup using various modules
/**
* Created by alicia.sykes on 17/07/2015.
* To run script run "gulp" in the command line
* To just watch files run "gulp watch"
* To just clean the public directory run "gulp clean"
*/
/* Include the necessary modules */
var gulp = require('gulp');
var gutil = require('gulp-util'); // For logging stats and warnings
@husobee
husobee / validation-main.go
Created January 8, 2016 20:07
input validation sanely
package main
import (
"encoding/json"
"errors"
"net/http"
"github.com/asaskevich/govalidator"
)
@Darkside73
Darkside73 / webpack.server.js
Created January 14, 2016 08:22
Webpack dev server with hot reload
const webpack = require('webpack');
const WebpackDevServer = require('webpack-dev-server');
const config = require('../webpack.config');
const hotWebpackPort = process.env.HOT_WEBPACK_PORT || 3500;
config.output.publicPath = `https://localhost:${hotWebpackPort}/assets/`;
['entry1', 'entry2'].forEach(entryName => {
config.entry[entryName].push(
'webpack-dev-server/client?https://localhost:' + hotWebpackPort,
'webpack/hot/only-dev-server'
@rrafal
rrafal / sqlx_json.go
Created March 31, 2016 00:02
Use JSON field with golang sqlx driver
package main
import (
"encoding/json"
"errors"
"database/sql/driver"
"fmt"
"github.com/jmoiron/sqlx"
_ "github.com/lib/pq"
"log"