Skip to content

Instantly share code, notes, and snippets.

View farism's full-sized avatar

Faris Mustafa farism

View GitHub Profile
@farism
farism / gist:f0ee1b90f47726fde77cdc7ed5ef53be
Created September 6, 2021 09:25
Change default git init branch to "main"
git config --global init.defaultBranch trunk
@farism
farism / form.svelte
Last active February 28, 2020 16:34
Form
<script>
import * as yup from 'yup'
let schema = yup.object({
isBig: yup.boolean(),
count: yup
.number()
.when('isBig', {
is: true,
then: yup.number().min(5),
@farism
farism / gui.ts
Last active February 25, 2020 22:18
gui
const gui = new GUI(
{},
Row(
{
width: love.graphics.getWidth(),
height: love.graphics.getHeight(),
vAlign: 'stretch',
backgroundColor: gray,
padding: 20,
},
@farism
farism / App.svelte
Created December 5, 2019 23:32
test svelte gist
<script>
const foo = "bar"
</script>
@farism
farism / MultiSelect.svelte
Created November 18, 2019 19:34
multiselect
<script>
import { afterUpdate, tick } from 'svelte'
import { matchwidth } from '../actions/matchwidth'
import { isEventSource } from '../utils/isEventSource'
import Arrow from './Arrow'
import Card from './Card'
import Clear from './Clear'
import Ellipses from './Ellipses'
import List from './List'
@farism
farism / Pagination.svelte
Created November 14, 2019 19:29
Pagination
<script>
import range from 'lodash/range'
import Notation from './Notation'
import PaginationArrow from './PaginationArrow'
import Select from './Select'
import SelectOption from './SelectOption'
export let page = 1
export let perPage = 50
@farism
farism / DateSelect.svelte
Last active November 14, 2019 08:15
svelte date select component
<script>
import { flyplacement } from '../transitions/flyplacement'
import { isEventSource } from '../utils/isEventSource'
import Calendar from './Calendar'
import DateInput from './DateInput'
import OverlayTrigger from './OverlayTrigger'
export let refs = {}
export let placement = 'bottom-left'
export let trigger = 'click'
// core.yml
- core
- tieredSelect
- label1
- label2
- label3
- label4
const ComponentA = (props, ref) => {
<div ref={ref}>a</div>
}
const ComponentB = (props, ref) => {
<ComponentA ref={ref} />
}
const ComponentC = () => {
const bRef = React.createRef()
local A = A or {};
A.__index = A;
A.prototype = A.prototype or {};
A.prototype.__index = A.prototype;
A.prototype.constructor = A;
A.new = function(...)
local self = setmetatable({}, A.prototype);
self:____constructor(...);
return self;
end;