Skip to content

Instantly share code, notes, and snippets.

@kirqe
kirqe / nyancat.gif
Created April 24, 2021 16:43
Nyan Cat
nyancat.gif
@kirqe
kirqe / gist:8b968ade687cd527d691598288ebeaaf
Created August 26, 2020 19:34 — forked from jamiehodge/gist:1327195
Warden and Sinatra example
require 'sinatra/base'
require 'rack/flash'
require 'warden'
require 'slim'
require 'sequel'
require 'sqlite3'
DB = Sequel.sqlite
DB.create_table :users do
primary_key :id
@kirqe
kirqe / index.html
Created February 16, 2017 11:33 — forked from mdunbavan/console.log
VUEX example within template
<section id="home-container" class="parralex-scroll">
<div class="wrapper">
<div class="grid">
<template id="people-listing-template">
<div class="wrapper grid" id="start-parralex">
<div class="grid__item large--one-third medium--one-whole no-padding product" v-for="product in products" v-cloak>
<router-link :to="{ name: 'product', params: { handle: product.handle }}">
@kirqe
kirqe / rails-apis.md
Created October 4, 2016 00:09 — forked from dideler/rails-apis.md
From Code School's Zombies series

API Best Practices

Routes

Restricting routes

resources :zombies, only: [:index, :show]
resources :humans, except: [:destroy, :edit, :update] 
@kirqe
kirqe / Gemfile
Created May 7, 2016 00:05 — forked from Joseph-N/Gemfile
File upload using dropzone.js, paperclip in rails. Tutorial link http://josephndungu.com/tutorials/ajax-file-upload-with-dropezonejs-and-paperclip-rails
source 'https://rubygems.org'
# default gems here
#---------------------------
# add paperclip and bootstrap
gem "paperclip", "~> 4.1"
gem 'bootstrap-sass', '~> 3.1.1'
@kirqe
kirqe / README.md
Created January 20, 2016 15:43 — forked from joyrexus/README.md
Node.js streams demystified

A quick overview of the node.js streams interface with basic examples.

This is based on @brycebaril's presentation, Node.js Streams2 Demystified

Overview

Streams are a first-class construct in Node.js for handling data.

Think of them as as lazy evaluation applied to data.

@kirqe
kirqe / deploy.rb
Last active August 29, 2015 14:12 — forked from jbwyatt4/deploy.rb
require 'mina/bundler'
require 'mina/rails'
require 'mina/git'
# require 'mina/rbenv' # for rbenv support. (http://rbenv.org)
require 'mina/rvm' # for rvm support. (http://rvm.io)
set :domain, '148.211.114.67'
set :user, 'user'
set :webroot, '/var/www'
set :app_name, 'your_rails_app'
# Add devise to Gemfile
gem 'devise'
# Run bundle
bundle install
# Run devise install
rails generate devise:install
# Make sure alert code in application.html.erb
# Login as root
ssh root@domain
# Create deploy user
adduser <username> #Adds User with username given. Enter Password when Prompted. Other Details are Optional
# Add user to sudo group
usermod -g <groupname> <username>
# Add .ssh/authorized_keys for deploy user