Skip to content

Instantly share code, notes, and snippets.

View gsans's full-sized avatar
🚁
Hawaii is Awesome

Gerard Sans gsans

🚁
Hawaii is Awesome
View GitHub Profile
@gsans
gsans / LogIn.vue
Created June 14, 2022 15:04
codez054: fix login page
<template>
<div class="w-full mt-5 flex justify-center items-center flex-col p-5 md:p-0">
<i class="fab fa-twitter text-blue text-4xl mb-8"></i>
<p class="font-bold text-2xl mb-4">Log in to Twitter</p>
<div class="w-full md:w-1/3 bg-lightblue border-b-2 border-dark mb-4 p-2">
<p class="text-dark">Phone, email, or username</p>
<input v-model="email" class="w-full bg-lightblue text-lg" type="text" ref="email">
</div>
<div class="w-full md:w-1/3 bg-lightblue border-b-2 border-dark mb-4 p-2">
<p class="text-dark">Password</p>
@gsans
gsans / tailwind.config.js
Created June 11, 2022 10:25
codez053: set media query breakpoints
const defaultTheme = require('tailwindcss/defaultTheme')
module.exports = {
purge: { content: ['./public/**/*.html', './src/**/*.vue'] },
darkMode: false, // or 'media' or 'class'
theme: {
container: {
center: true
},
maxHeight: {
@gsans
gsans / GLDToken.sol
Created February 25, 2022 15:58
ERC20 GLD token
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract GLDToken is ERC20, Ownable {
constructor(uint256 initialSupply) ERC20("Gold", "GLD") {
_mint(msg.sender, initialSupply);
}
function mint(address to, uint256 amount) public onlyOwner {
@gsans
gsans / hello-world.sol
Created February 25, 2022 15:39
Helloworld smart contract
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.10;
contract HelloWorld {
string message = "Hello world!";
function set(string memory _msg) public {
message = _msg;
}
@gsans
gsans / hello-world_test.sol
Created February 25, 2022 12:28
Solidity unit test
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.10;
// This import is automatically injected by Remix
import "remix_tests.sol";
// This import is required to use custom transaction context
// Although it may fail compilation in 'Solidity Compiler' plugin
// But it will work fine in 'Solidity Unit Testing' plugin
import "remix_accounts.sol";
@gsans
gsans / hello-world_test.sol
Created February 25, 2022 12:28
Solidity unit test
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.10;
// This import is automatically injected by Remix
import "remix_tests.sol";
// This import is required to use custom transaction context
// Although it may fail compilation in 'Solidity Compiler' plugin
// But it will work fine in 'Solidity Unit Testing' plugin
import "remix_accounts.sol";
@gsans
gsans / Profile.vue
Created January 14, 2022 19:46
codez052: add send message to Profile page
<template>
<div id="app" class="flex container h-screen w-full">
<div class="flex container h-screen w-full">
<SideNav />
<div class="w-full md:w-2/3 lg:w-1/2 h-full overflow-y-scroll" v-scroll:bottom="loadMore">
<div class="px-5 py-3 border-b border-lighter flex items-center">
<button @click="gotoHome()" class="rounded-full md:pr-2 focus:outline-none hover:bg-lightblue">
<i class="fas fa-arrow-left text-blue"></i>
</button>
@gsans
gsans / UserNewMessage.vue
Created January 14, 2022 19:45
codez051: new message user details
<template>
<div v-if="profile.id !== user.id" @click="user.followedBy && selected(user)" class="w-full px-4 py-2 border-b hover:bg-lightest flex flex-row cursor-pointer" :class="!user.followedBy?'cursor-not-allowed opacity-60':''">
<div class="flex-none">
<img :src="`${user.imageUrl || 'default_profile.png'}`" class="h-12 w-12 rounded-full"/>
</div>
<div class="ml-2 flex flex-col w-full">
<div class="flex flex-row justify-between w-full">
<div class="flex flex-col">
<p class="font-bold">{{ user.name }}</p>
<p class="text-dark text-sm">@{{ user.screenName }} {{!user.followedBy?"cant'be messaged":''}}</p>
@gsans
gsans / ResultsNewMessage.vue
Created January 14, 2022 19:44
codez050: new message results
<template>
<div>
<div v-for="result in results" :key="result.id">
<UserNewMessage
v-if="result.screenName"
:user="result"
@selected="selected"
/>
</div>
</div>
@gsans
gsans / NewMessageOverlay.vue
Created January 14, 2022 19:42
codez049: new message overlay
<template>
<div class="fixed w-full h-full top-0 left-0 flex items-center justify-center">
<div class="absolute w-full h-full bg-gray-900 opacity-50" @click.prevent="$emit('update:showNewMessageModal', false);"></div>
<div class="modal-main bg-white mx-auto rounded-lg z-50 overflow-y-auto w-full sm:w-3/5 md:w-2/5 max-h-full">
<div class="pl-1 pr-4 py-1 h-16 border-b-2 border-lightblue">
<div class="flex flex-row mt-1 ml-4">
<i @click="$emit('update:showNewMessageModal', false);" class="fas fa-times text-blue text-2xl w-10 h-10 mr-1 xl:mr-6 mt-1 pt-1 pl-3 rounded-full bg-white hover:bg-lightblue"></i>
<p class="text-xl pt-1 font-bold mt-1">New message</p>
</div>