Skip to content

Instantly share code, notes, and snippets.

View edwardsmoses's full-sized avatar
🏠
Working from home

Edwards Moses edwardsmoses

🏠
Working from home
View GitHub Profile
// Copyright 2017, Google, Inc.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// Copyright 2017, Google, Inc.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
resource "google_compute_instance" "vm_instance" {
name = "${var.instance_name}"
zone = "${var.instance_zone}"
machine_type = "${var.instance_type}"
boot_disk {
initialize_params {
image = "debian-cloud/debian11"
}
}
//The Gesture Handler
const drawGestureHandler = useAnimatedGestureHandler({
onStart: () => {},
onFinish: () => {
runOnJS(onDrawingComplete)();
},
onActive: (event) => {
shapeInDrawing.value = {
d: shapeInDrawing.value
@edwardsmoses
edwardsmoses / implementation.tsx
Created January 26, 2021 19:41
Hook to Capture Click Outside in React
import {useToCaptureClickOutside} from '../hooks/useToCaptureClickOutside';
const [isOpen, setOpen] = useState(false);
const closeOutsideNodeRef = useToCaptureClickOutside(isOpen, () => setOpen(false));
<div className="ml-3 relative" ref={closeOutsideRef}>
{/* rest of code */}
</div>
dotnet ef migrations add InitialCreate
dotnet ef database update
@edwardsmoses
edwardsmoses / BuildApkExpo
Last active April 20, 2020 13:15
Build Expo Android App to Apk..
expo build:android -t apk
@edwardsmoses
edwardsmoses / EmojiReactComponent.js
Created April 19, 2020 18:55
Render Emojis in React..
import React from 'react';
const Emoji = props => (
<span
className="emoji"
role="img"
aria-label={props.label ? props.label : ""}
aria-hidden={props.label ? "false" : "true"}
>
{props.symbol}
</span>
using System;
using System.Collections.Generic;
namespace DictionaryTraining
{
public class Program
{
static Dictionary<ReportType, Func<int, string>> dictReports = new Dictionary<ReportType, Func<int, string>>();
static void Main(string[] args)
{
using System;
using System.Collections.Generic;
namespace DictionaryTraining
{
public class Program
{
static Dictionary<ReportType, Action> dictReports = new Dictionary<ReportType, Action>();
static void Main(string[] args)
{