Skip to content

Instantly share code, notes, and snippets.

View xlanex6's full-sized avatar
🎿
Code web apps from the alps

Alex Duval xlanex6

🎿
Code web apps from the alps
View GitHub Profile
@kurenn
kurenn / gist:4421177
Last active March 29, 2017 21:16
This gist shows how to make a polymorphic association for users in rails which have an specific role, such as Member, Admin...works with devise
##Userable
module Userable
def self.included(base)
base.has_one :user, :as => :userable, :dependent => :destroy, :autosave => true
base.validate :user_must_be_valid
base.alias_method_chain :user, :autobuild
base.extend ClassMethods
base.define_user_accessors
end
@jonah-williams
jonah-williams / circle.yml
Last active May 29, 2019 14:53
Automating deployments to Heroku from CircleCI
test:
override:
- bundle exec rspec spec
deployment:
acceptance:
branch: master
commands:
- ./script/heroku_deploy.sh <ACCEPTANCE_HEROKU_APP>:
timeout: 300
@joyrexus
joyrexus / README.md
Last active May 3, 2024 10:41 — forked from liamcurry/gist:2597326
Vanilla JS equivalents of jQuery methods

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@Joseph-N
Joseph-N / Gemfile
Last active July 7, 2022 16:53
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'
@balvig
balvig / active_admin.js
Last active August 23, 2020 14:22
Active Admin Cloudinary
# app / assets / javascripts / active_admin.js
//= require active_admin/base
//= require jquery.ui.widget
//= require jquery.iframe-transport
//= require jquery.fileupload
//= require cloudinary/jquery.cloudinary
//= require attachinary
//= require attachments
@thanhluanuit
thanhluanuit / gist:48c0107a6b1bae8775d4
Last active November 9, 2018 09:46 — forked from basicallydan/gist:11c8c02bdaa1ced2e842
Upload from the browser to Cloudinary with no server
<!-- This example is for a blog post that can be found at http://danhough.com/blog/dropzone-cloudinary/ - read there to find out how to use it -->
<!DOCTYPE html>
<html>
<head>
<title>Dropzone Example</title>
</head>
<body>
<div id="dropzone-area" style="width:700px;height:700px;display:block;margin:20px auto;border:1px solid red;"></div>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/dropzone/4.0.1/dropzone.js"></script>
<script type="text/javascript">
@zulhfreelancer
zulhfreelancer / heroku_pg_db_reset.md
Last active January 29, 2024 10:09
How to reset PG Database on Heroku (for Rails app)?

It's important to note that running this reset will drop any existing data you have in the application

How to reset PG Database on Heroku?

  • Step 1: heroku restart
  • Step 2: heroku pg:reset DATABASE (no need to change the DATABASE)
  • Step 3: heroku run rake db:migrate
  • Step 4: heroku run rake db:seed (if you have seed)

One liner

@ssaunier
ssaunier / README.md
Last active August 1, 2023 21:28
Adding Le Wagon to your Linkedin Profil
@tablekat
tablekat / main.ts
Created June 30, 2016 20:24
Making gmail push notifications to webhook
import * as request from 'request';
import * as fs from 'fs';
import * as readline from 'readline';
var google = require('googleapis');
var googleAuth = require('google-auth-library');
/*************** STEPS
- made a project on https://console.cloud.google.com/cloudpubsub/topicList?project=testmabs thing?