Skip to content

Instantly share code, notes, and snippets.

View mbvissers's full-sized avatar
🐰

mbvissers mbvissers

🐰
View GitHub Profile
@mbvissers
mbvissers / OneLine.pug
Created September 18, 2019 12:28
An example of the powers of PugJS
p Hello, world!
@mbvissers
mbvissers / Nesting.pug
Created September 18, 2019 12:28
An example of nesting in pugJS
div
p Hello, nesting!
@mbvissers
mbvissers / ClassesAndIds.pug
Created September 18, 2019 12:30
An example of classes and ids in PugJS
div.container
p.white-text.bg-black#chapter-one
@mbvissers
mbvissers / Form.pug
Created September 18, 2019 12:33
An example form with PugJS.
form(method="post")
label(for="username") Username
input.form-input#username(name="username")
@mbvissers
mbvissers / RandomPug.pug
Created September 18, 2019 15:28
Random Pug code
div.container
h1.header-large Cool Header
p this is a short example
div#some-id
emp.thick What do you think?
p Pretty weird huh?
<!-- import jQuery using the google CDN -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
$("button.add#1").on("click", function () {
console.log("clicked button 1");
})
</script>
<button class="add" id="1">Button 1</button>
<script>
document.getElementById("myBtn").addEventListener("click", function (){
console.log("clicked")
});
</script>
<button id="myBtn">My button</button>
<!-- import jQuery using the google CDN -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
$("button#fadeIn").on("click", function () {
$(".fadedText").fadeIn();
})
$("button#fadeOut").on("click", function () {
$(".fadedText").fadeOut();
import React from 'react';
import { SafeAreaView, Text, StatusBar } from 'react-native';
const App = () => {
return (
<>
<StatusBar barStyle="light-content" />
<SafeAreaView style={{padding: 8}}>
<Text>Some sample text</Text>
</SafeAreaView>
import Realm from "realm";
// Declare Schema
class BookSchema extends Realm.Object {}
BookSchema.schema = {
name: 'Book',
properties: {
title: 'string',
pages: 'int',
edition: 'int?'