Skip to content

Instantly share code, notes, and snippets.

@lanbau
lanbau / django_cheat_sheet.md
Created June 13, 2019 06:14 — forked from bradtraversy/django_cheat_sheet.md
Django command cheat sheet

Django 2.x Cheat Sheet

Creating a virtual environment

We need to create a virtual env for our app to run in: More Here Run this command in whatever folder you want to create your venv folder

python -m venv ./venv
@lanbau
lanbau / php2js-curl-basic-auth.js
Created August 27, 2018 09:38 — forked from kostasx/php2js-curl-basic-auth.js
PHP to Node.js: cURL with Basic Authentication
/*
<?php
// THE FOLLOWING IMPLEMENTATION CAN BE USED FOR VARIOUS APIs. THIS WAS TESTED SUCCESSFULLY ON THE pingdom.com API
$email = "[email protected]";
$passwd = 'password';
$api_key = "API_KEY";
$curl = curl_init();
@lanbau
lanbau / quasar.md
Created July 18, 2018 04:11
mobile quasar overlap
<q-page padding class="row justify-center">
    <div class="row justify-center full-height full-width text-center">
        <q-scroll-area style="width: 100%; height: 500px; margin-bottom: 80px; padding:20px;">

          <q-chat-message
            label='Sunday, 19th'
          />
            <q-chat-message
                name="me"
@lanbau
lanbau / data-structure.js
Created June 2, 2018 14:33 — forked from sararob/data-structure.js
Role-based security in Firebase
/*
This example shows how you can use your data structure as a basis for
your Firebase security rules to implement role-based security. We store
each user by their Twitter uid, and use the following simplistic approach
for user roles:
0 - GUEST
10 - USER
20 - MODERATOR
@lanbau
lanbau / correct.md
Created October 30, 2017 15:24
Vue.js Correct Lifecycle Structure
Lifecycle Method () { 
  this.increment()
}
@lanbau
lanbau / wrong.md
Last active October 30, 2017 15:22
Vue.js Wrong Lifecycle Structure
methods: { 
  increment () { 
    this.count += 1 
  }
},
Lifecycle Method: () => { 
  this.increment()
}
@lanbau
lanbau / gist:7b5985cc9e2848aec086743a4a70f111
Created March 17, 2017 05:56 — forked from paulallies/gist:0052fab554b14bbfa3ef
Remove node_modules from git repo
#add 'node_modules' to .gitignore file
git rm -r --cached node_modules
git commit -m 'Remove the now ignored directory node_modules'
git push origin master
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<script src="https://wzrd.in/standalone/expect@latest"></script>
</head>
<body>
@lanbau
lanbau / readme.md
Created October 26, 2016 09:08 — forked from coolaj86/how-to-publish-to-npm.md
How to publish packages to NPM

Getting Started with NPM (as a developer)

If you haven't already set your NPM author info, now you should:

npm set init.author.name "Your Name"
npm set init.author.email "[email protected]"
npm set init.author.url "http://yourblog.com"

npm adduser

@lanbau
lanbau / SavingsAccount.java
Created July 17, 2016 07:12 — forked from jimmykurian/SavingsAccount.java
A Java program that creates a Bank Account with withdraw, deposit, and intrest functions. And a tester class, that tests the SavingsAccount class.
//SavingsAccount.java - Jimmy Kurian
public class SavingsAccount
{
private double balance;
private double interest;
public SavingsAccount()
{
balance = 0;