Skip to content

Instantly share code, notes, and snippets.

@giannisp
giannisp / gist:ebaca117ac9e44231421f04e7796d5ca
Last active March 1, 2024 14:39
Upgrade PostgreSQL 9.6.5 to 10.0 using Homebrew (macOS)
After automatically updating Postgres to 10.0 via Homebrew, the pg_ctl start command didn't work.
The error was "The data directory was initialized by PostgreSQL version 9.6, which is not compatible with this version 10.0."
Database files have to be updated before starting the server, here are the steps that had to be followed:
# need to have both 9.6.x and latest 10.0 installed, and keep 10.0 as default
brew unlink postgresql
brew install postgresql@9.6
brew unlink postgresql@9.6
brew link postgresql
@rezapadillah
rezapadillah / keymap.cson
Last active November 29, 2019 13:41
Enable Emmet In laravel blade and vue language on atom
1. Go to keymap.cson on your atom editor
2. Copy and paste :
'atom-text-editor[data-grammar="text html php blade"]:not([mini])':
'tab': 'emmet:expand-abbreviation-with-tab'
'atom-text-editor[data-grammar~="vue"]:not([mini])':
'tab': 'emmet:expand-abbreviation-with-tab'
@PavloBezpalov
PavloBezpalov / 1 Gist conventions
Last active January 7, 2024 11:55
Deploy Rails 5.0.0.beta3 to VPS(Ubuntu 14.04.4 LTS). Nginx, Puma, Capistrano3, PostgreSQL, RVM.
<<APP>> change this variables
@tikolakin
tikolakin / fish_alias.md
Last active May 2, 2024 14:21
Create alias in Fish shell and save this as a permanent function

Directly from CLI

alias x='exit'
funcsave x

or create a file in

~/.config/fish/functions 

with name

@1950195
1950195 / openshift.md
Last active May 8, 2017 02:08
介绍如何更新openshift的nodejs版本到最新

Openshift —— 强大的免费nodejs空间!(含免费二级域名)

简介

网址:https://www.openshift.com/

redhat 旗下站点,提供多种语言的免费云空间。

创建属于你的Nodejs站点

如何创建

  • 免费注册用户
@emiller42
emiller42 / gist:4982462
Last active October 17, 2022 19:00
Adding Tomcat to MAMP
1) Install MAMP normally
2) Download the latest binary of tomcat from http://tomcat.apache.org/ and extract it into the MAMP folder
(you should now have a /Applications/MAMP/apache-tomcat-version folder)
3) Create a link to the apache-tomcat folder:
ln -s /Applications/apache-tomcat-7.0.37/ tomcat
4) Make sure all the binaries are executable:
cd /Applications/tomcat/bin
@cobyism
cobyism / gh-pages-deploy.md
Last active June 26, 2024 23:06
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@mikedfunk
mikedfunk / README.md
Created August 28, 2012 21:17
CodeIgniter Pagination for Twitter Bootstrap

This uses Twitter Bootstrap classes for CodeIgniter pagination.

Drop this file into application/config.

@vorushin
vorushin / jquery-csrf.js
Created June 24, 2011 08:51
Small jQuery plugin for adding csrf-token to Ajax/Ajaj requests
$.ajaxSetup({
beforeSend: function(xhr, settings) {
function getCookie(name) {
var cookieValue = null;
if (document.cookie && document.cookie != '') {
var cookies = document.cookie.split(';');
for (var i = 0; i < cookies.length; i++) {
var cookie = jQuery.trim(cookies[i]);
// Does this cookie string begin with the name we want?
if (cookie.substring(0, name.length + 1) == (name + '=')) {