Skip to content

Instantly share code, notes, and snippets.

@somaria
somaria / home.blade.php
Created June 14, 2024 00:21
home.blade.php
@extends('layouts.app')
@section('title')
Dashboard
@endsection
@section('content')
@include('layouts.partials.sidebar', array('active' => 'dashboard'))
<?php $role_name=Auth::user()->role->name; ?>
@somaria
somaria / upload
Created October 4, 2023 08:40
upload
'use client'
import classnames from 'classnames'
import React, { ChangeEvent, use, useState } from 'react'
import Image from 'next/image'
import { useSession } from 'next-auth/react'
import { useRouter } from 'next/navigation'
import 'react-quill/dist/quill.snow.css';
import ReactQuill from 'react-quill'
const SubmitPost = () => {
@somaria
somaria / mvvm
Created September 13, 2023 01:30
mvvm
package com.example.samplemvvm
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
@somaria
somaria / checkbox
Created June 2, 2022 01:47
collection check box
<div class="staff-page form-staff-new-page">
<%= render 'layouts/staff_top_bar' %>
<div class="content">
<a href="<%= staff_forms_path %>" class="back-button">&lt; Back</a>
<div class="top-group">
<div class="page-title my-7">New Session</div>
</div>
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby '2.6.6'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 6.1.4.4'
# Use postgresql as the database for Active Record
gem 'pg', '>= 0.18', '< 2.0'
# Use Puma as the app server
class ApplicationController < ActionController::Base
def prevent_page_cache
@turbolinks_no_cache = true
response.headers['Cache-Control'] = 'no-cache, no-store'
response.headers['Pragma'] = 'no-cache'
response.headers['Expires'] = 'Fri, 01 Jan 1990 00:00:00 GMT'
end
class AuthController < ApplicationController
before_action :prevent_page_cache
skip_before_action :verify_authenticity_token
def student
reset_session
end
def student_callback
import { useCollection, useDocumentOnce } from 'react-firebase-hooks/firestore'
import firebase from '../../firebase'
import { useEffect, useState } from 'react'
import ReactPaginate from 'react-paginate'
const ShowTWVideoList = ({ uid }) => {
const [allPosts, loading, error] = useCollection(
firebase
.firestore()
.collection('twitchVideos')
<!DOCTYPE html>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://stg-id.singpass.gov.sg/static/ndi_embedded_auth.js"></script>
<script>
function getData(ajaxurl) {
return $.ajax({
url: ajaxurl,
type: "GET"
});
<template>
<div>
<div>Login Page</div>
<div ref="ndi"></div>
</div>
</template>
<script>
export default {
data() {