Skip to content

Instantly share code, notes, and snippets.

View arvi's full-sized avatar
🎯
Focusing

arvi

🎯
Focusing
View GitHub Profile
@arvi
arvi / flightplan-deploy.md
Created July 1, 2016 08:33 — forked from learncodeacademy/flightplan-deploy.md
Deploy Node.js Apps with Flightplan

##Setup your server (this would ideally be done with automated provisioning)

  • add a deploy user with password-less ssh see this gist
  • install forever npm install -g forever

##Install flightplan

  • npm install -g flightplan
  • in your project folder npm install flightplan --save-dev
  • create a flightplan.js file
@arvi
arvi / deployUser.md
Created July 1, 2016 07:40 — forked from learncodeacademy/deployUser.md
Adding a deploy user in Linux

(wherever it says url.com, use your server's domain or IP)

Login to new server as root, then add a deploy user

sudo useradd --create-home -s /bin/bash deploy
sudo adduser deploy sudo
sudo passwd deploy

And Update the new password

@arvi
arvi / js-textarea-expand.js
Last active June 14, 2016 10:47
Textarea autoexpand
//autoexpand textarea when initial has input already
$(editBlock).find('textarea').each(function() {
var $this = $(this);
textCount = $this.val().length;
if(textCount > 25) {
rowBreaks = textCount / 25;
rowBreaks = Math.ceil(rowBreaks);
textareaName = $this.attr('name');
/* EFFECT 1 */
.effect1
{
-webkit-box-shadow: 0 10px 6px -6px #777;
-moz-box-shadow: 0 10px 6px -6px #777;
box-shadow: 0 10px 6px -6px #777;
}
/* EFFECT 2 */
.effect2
.separator {
display: flex;
align-items: center;
text-align: center;
}
.separator::before, .separator::after {
content: '';
flex: 1;
border-bottom: 1px solid #000;
}
table {
border-collapse: separate;
border-spacing: 0 1em;
}
@arvi
arvi / sublime-jsx-emmet-trigger.json
Created June 6, 2016 09:18
Sublime Key Binding cheatsheet
[
//jsx emmet tab trigger: https://gist.github.com/wesbos/2bb4a6998635df97c748
{
"keys": ["tab"],
"command": "expand_abbreviation_by_tab",
// put comma-separated syntax selectors for which
// you want to expandEmmet abbreviations into "operand" key
// instead of SCOPE_SELECTOR.
// Examples: source.js, text.html - source
//source:https://scotch.io/tutorials/aesthetic-sass-3-typography-and-vertical-rhythm
@import url(https://fonts.googleapis.com/css?family=Raleway:400,200,600);
$container-width: 750px;
$container-height: 440px;
$base-font-size: 1rem;
$base-line-height: 1.25 * $base-font-size;
//JS
$(function () {
$(":file").change(function () {
if (this.files && this.files[0]) {
var reader = new FileReader();
reader.onload = imageIsLoaded;
reader.readAsDataURL(this.files[0]);
}
});
});
<?php
namespace Application\Theme\MyThemeName;
use Concrete\Core\Page\Theme\Theme;
class PageTheme extends Theme {
//just telling the theme that it supports a particular grid framework, in this case Bootstrap 3
protected $pThemeGridFrameworkHandle = 'bootstrap3';