Skip to content

Instantly share code, notes, and snippets.

View connectkushal's full-sized avatar
🎵

Kushal Billaiya connectkushal

🎵
View GitHub Profile
@alexstyl
alexstyl / MaterialColors.kt
Created May 15, 2023 10:05
All colors found in the 2014 Material Design color palette, ready to be used in Jetpack Compose.
/**
* Contains all color defined in the 2014 Material Design color palette.
*
*
*/
object MaterialColors {
val Red50 = Color(0xFFFFEBEE)
val Red100 = Color(0xFFFFCDD2)
val Red200 = Color(0xFFEF9A9A)
val Red300 = Color(0xFFE57373)
@bradtraversy
bradtraversy / carbon-lang-snippets.md
Last active March 21, 2024 11:31
Google Carbon Snippets

Google Carbon Snippets

This file contains some of the basic syntax for Google Carbon as well as some info and how to get set up.

The official repo and docs can be found at: https://github.com/carbon-language/carbon-lang

Carbon is an experimental successor to C++. It is NOT ready for production and will not be for a while. This crash course and document were made to explore some of the basic syntax.

How to get started

@ityonemo
ityonemo / test.md
Last active July 27, 2024 17:22
Zig in 30 minutes

A half-hour to learn Zig

This is inspired by https://fasterthanli.me/blog/2020/a-half-hour-to-learn-rust/

Basics

the command zig run my_code.zig will compile and immediately run your Zig program. Each of these cells contains a zig program that you can try to run (some of them contain compile-time errors that you can comment out to play with)

@alexedwards
alexedwards / main.go
Last active February 19, 2024 07:16
JSON encoding benchmarks
package main
import (
"encoding/json"
"net/http"
)
func main() {}
func healthcheckHandlerEncoder(w http.ResponseWriter, r *http.Request) {

Interview Questions

Kotlin

Q1: What is a primary constructor in Kotlin? ☆☆

Answer: The primary constructor is part of the class header. Unlike Java, you don't need to declare a constructor in the body of the class. Here's an example:

@yyx990803
yyx990803 / commits.vue
Last active May 13, 2022 16:43
Vue examples comparisons in 2.x and function-based APIs
<template>
<div id="demo">
<h1>Latest Vue.js Commits</h1>
<template v-for="branch in branches">
<input type="radio"
:id="branch"
:value="branch"
name="branch"
v-model="currentBranch">
<label :for="branch">{{ branch }}</label>
@calebporzio
calebporzio / pure_html_css_modal.css
Last active February 28, 2022 18:15
The CSS for the pure HTML/CSS modal I tweeted about.
details summary {
cursor: pointer;
outline: none !important;
display: inline-block;
padding: 8px 12px;
padding-top: 10px;
border-radius: 4px;
overflow: hidden;
background: #F09825;
color: white;
@CJEnright
CJEnright / gzip.go
Last active July 1, 2024 21:17
Idiomatic golang net/http gzip transparent compression, an updated version of https://gist.github.com/bryfry/09a650eb8aac0fb76c24
package main
import (
"net/http"
"compress/gzip"
"io/ioutil"
"strings"
"sync"
"io"
)
@Nilpo
Nilpo / git-setup.sh
Last active November 3, 2018 08:39
Set up a friendly Git environment
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
git config --global alias.co checkout
git config --global alias.br branch
git config --global alias.ci commit
git config --global alias.st status
git config --global alias.unstage 'reset HEAD --'
git config --global alias.last 'log -1 HEAD'
git config --global alias.prune 'fetch --prune'
git config --global alias.undo 'reset --soft HEAD^'