Skip to content

Instantly share code, notes, and snippets.

@matzar
matzar / .zshrcOR.bash_profile
Last active August 15, 2022 09:35
git bash aliases and functions to improve your workflow.
# Copy and paste the contents of this file to your .zshrc or .bash_profile file.
#
# Example use:
# to commit with only one letter go:
#
# c feat: your commit message
#
# In the above example, the following would happen:
# - Your changes would be staged for commit
# - A commit with a message - "feat: your commit message" - would be created.
@tricki
tricki / StencilAsync.ts
Last active August 1, 2022 19:46
Stencil Async Helper (Promise + RXJS/Observables)
import { ComponentInterface, forceUpdate, getRenderingRef } from '@stencil/core';
import type { Observable, Subscription } from 'rxjs';
import { ComponentRegistration, ObservableRegistration } from "./types";
export function async<T>(obj: Observable<T> | Promise<T>): T | undefined {
return getAsyncValue(obj);
}
export interface ComponentRegistration<T = any> {
promises: PromiseMap;
@phosphoer
phosphoer / SimpleGeo.cs
Last active June 11, 2024 16:16
Simple Geometry Painter for Unity
// The MIT License (MIT)
// Copyright (c) 2016 David Evans @phosphoer
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
@NiteshOswal
NiteshOswal / variable_sized_arrays.cpp
Created January 23, 2016 20:35
You are given N integer sequences and Q queries. Each query is in the following format: "a b" where a denotes the index of the sequence, and b denotes the index of the element in that sequence. Your task is to find the value of the element described in each query. Input Format The first line consists of N and Q separated by a space. The followin…
/*
2 2
3 1 5 4
5 1 2 8 9 3
0 1
1 3
*/
#include<iostream>
using namespace std;
int main() {