Skip to content

Instantly share code, notes, and snippets.

@vimm0
vimm0 / center-div.html
Created August 21, 2024 13:17
Simple 4 steps to center div!!
<!DOCTYPE html>
<html>
<head>
<style>
body {
background-color: blue; /* optional */
}
.container {
@vimm0
vimm0 / graphiql.html
Created October 14, 2021 10:15
Graphql-voyager on graphene-django
<!--
The request to this GraphQL server provided the header "Accept: text/html"
and as a result has been presented GraphiQL - an in-browser IDE for
exploring GraphQL.
If you wish to receive JSON, provide the header "Accept: application/json" or
add "&raw" to the end of the URL within a browser.
-->
{% load static %}
<!DOCTYPE html>
<html>
@vimm0
vimm0 / collapsible-tree-menu.html
Created June 12, 2020 08:34
Collapsible tree menu
<!-- 2014/05/01 9:31:11 - Minimal css for clickable pure CSS/HTML collapsible tree menu -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!--[if lt IE 9]>
<script src="http://ie7-js.googlecode.com/svn/version/2.1(beta4)/IE9.js"></script>
<![endif]-->
@vimm0
vimm0 / flutter_tap_isActive_statefulWidget.dart
Last active March 18, 2020 05:31
StateFulWidgetInFlutter
// TapboxA manages its own state.
//------------------------- TapboxA ----------------------------------
import 'package:flutter/material.dart';
class TapboxA extends StatefulWidget {
TapboxA({Key key}) : super(key: key);
@override
@vimm0
vimm0 / README.md
Created February 12, 2019 18:27 — forked from Yogendra0Sharma/README.md
Setting up a Dockerized web application with Django REST APIs, ReactJS with Redux pattern, and Webpack Hot Reloading! Mouthful.

Guide on how to create and set up a Dockerized web app using Django REST APIs and ReactJS

Hopefully this will answer "How do I setup or start a Django project using REST Framework and ReactJS?"

I created this because it was SUCH a pain in the ass setting up a project using all the latest technologies. After some research, I figured it out and have it working. The repo that implements this is located here. Feel free to use it as a boilerplate ;)

Main features:

  • Django REST APIs
  • ReactJS with Redux Pattern
  • Webpack module bundler manager
@vimm0
vimm0 / gh-pages-deploy.md
Created August 18, 2018 11:39 — forked from cobyism/gh-pages-deploy.md
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).

@vimm0
vimm0 / postgres-cheatsheet.md
Created February 16, 2018 09:10 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@vimm0
vimm0 / decorators_cheat_sheet.py
Created September 20, 2016 16:49 — forked from xpostudio4/decorators_cheat_sheet.py
Decorators Cheat Sheet
import functools # Part of Python standard library
def decorator(wrapped_function):
def _wrapper(*args, **kwargs):
# do something before the function call
result = wrapped_function(*args, **kwargs)
# do something after the function call
return result
return _wrapper
@vimm0
vimm0 / python-cheat-sheet-basic.py
Created September 20, 2016 16:30 — forked from filipkral/python-cheat-sheet-basic.py
Basic Python Cheat Sheet
#!/usr/bin/env python
"""Basic Python Cheat Sheet by Filip Kral on 2015/02/16"""
"""
Python is a cross-platform, interpreted, object-oriented programming language.
That means you can run it on Linux, Windows, Mac, and other platforms,
you don't need to compile your code to execute it because it is compiled on
the fly, and you can use classes and objects.