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 / 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
@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 / 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
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@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)
@Zadigo
Zadigo / nginxproxy.md
Created May 30, 2020 11:12 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

import argparse
import os
import threading
import time
from urllib import parse
import requests
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
This file has been truncated, but you can view the full file.
# Top 20K hashes from the Troy Hunt / haveibeenpwned Pwned Passwords list v2 (2018-02-21)
# Original raw as published is at https://gist.github.com/roycewilliams/eef06c1148707ce8c8a1dea85768b207
20760336:7c4a8d09ca3762af61e59520943dc26494f8941b:123456
7016669:f7c3bc1d808e04732adf679965ccc34ca7ae3441:123456789
3599486:b1b3773a05c0ed0176787a4f1574ff0075f7521e:qwerty
3303003:5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8:password
2900049:3d4f2bf07dc1be38b20cd6e46949a1071f9d0e3d:111111
2680521:7c222fb2927d828af22f592134e8932480637c0d:12345678
2670319:6367c48dd193d56ea7b0baad25b19455e529f5ee:abc123
2310111:e38ad214943daad1d64c102faec29de4afe9da3d:password1
@Zadigo
Zadigo / conditional_lists.vb
Created August 19, 2020 19:14
Populates a dropdown list automatically based on the option button that a user has clicked in the form
Dim wk As Worksheet
Private Sub UserForm_Initialize()
' 1. Create a list of items to populate the list with
' when the user opens the form
Me.ComboBox1.AddItem "Kendall Jenner", 0
Me.ComboBox1.AddItem "Kylie Jenner", 1
Me.ComboBox1.AddItem "Kim Kardashian", 2
Me.OptionButton1.Value = True
@Zadigo
Zadigo / django_base_html_page.html
Last active August 19, 2020 20:35
Base HTML page for Django from which all other pages can extend. Includes all SEO tags, Analytics, bootstrap, Lodash, JQuery and VueJS
{% load static %}
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>{% block title %}{% endblock %}</title>