Skip to content

Instantly share code, notes, and snippets.

View Zadigo's full-sized avatar
🌴
On vacation

John PENDENQUE Zadigo

🌴
On vacation
View GitHub Profile
@Zadigo
Zadigo / profile_view.py
Last active June 7, 2018 23:21
Code for profile view in user account
class ProfileView(LoginRequiredMixin, View):
def get(self, request, *args, **kwargs):
context = {}
# Redirect user if is_admin
if request.user.is_admin or request.user.is_staff:
return redirect('/admin/')
# Create context with factory
context = self.profile_factory(request)
return render(request, 'shared/content_profile.html', context)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Zadigo
Zadigo / rails-postgres-backbone-bootstrap-bootswatch
Created November 6, 2017 12:59 — forked from sionc/rails-postgres-backbone-bootstrap-bootswatch
Instructions on creating a new app using Ruby on Rails, Postgresql, Backbone.js, Twitter Boostrap, Bootstwatch
- Check rails version
$ rails -v
- To update rails
$ gem update rails
- Creating a new rails app using postgresql
$ mkdir rails_projects
$ cd rails_projects
$ rails new myapp --database=postgresql
@Zadigo
Zadigo / DynamicMacroShapes.bas
Last active October 25, 2017 18:15
Assigning a macro to any given shape in Excel
Option Explicit
Sub assign_MacroToShape()
'
' This macro assigns a macro to a given shape
'
'Set variables
Dim active_Book As Workbook
Set active_Book = ActiveWorkbook
@Zadigo
Zadigo / DynamicBorders.bas
Created October 25, 2017 18:08
Create table borders anywhere in Excel
Sub create_Table_BordersAnywhere()
'Get current range selected
Dim current_Selection As Range
Set current_Selection = Selection
'Set in range
Dim create_Table As Range
Set create_Table = Range(current_Selection.Address)
Dim elements(5) As String