Skip to content

Instantly share code, notes, and snippets.

@EmperorEarth
EmperorEarth / material-design-shadows.css
Created August 25, 2021 11:42 — forked from serg0x/material-design-shadows.css
Google material design elevation system shadows as css. Based on https://material.io/design/environment/elevation.html#default-elevations Exported with Sketchapp from the Google material design theme editor plugin "Baseline" theme.
/* Shadow 0dp */
box-shadow: none;
/* Shadow 1dp */
box-shadow: 0 1px 1px 0 rgba(0,0,0,0.14), 0 2px 1px -1px rgba(0,0,0,0.12), 0 1px 3px 0 rgba(0,0,0,0.20);
/* Shadow 2dp */
box-shadow: 0 2px 2px 0 rgba(0,0,0,0.14), 0 3px 1px -2px rgba(0,0,0,0.12), 0 1px 5px 0 rgba(0,0,0,0.20);
/* Shadow 3dp */
@EmperorEarth
EmperorEarth / go-playground-vim.md
Created July 26, 2021 14:55 — forked from robbiev/go-playground-vim.md
vim keybindings for the Go Playground at https://play.golang.org

Wasavi is some sort of vim implementation for browser text fields.

Once installed go to https://play.golang.org, you can use INSERT or CTRL+ENTER to enter the vim mode. To quit use the usual vim commands.

Tips:

  • The default keybinding to enter vim mode, CTRL+ENTER, conflicts with the standard playground shortcuts (CTRL+ENTER to format, SHIFT+ENTER to run). I recommend configuring wasavi to not enter vim mode on CTRL+ENTER (just use INSERT or configure something else)
  • Once you remapped CTRL+ENTER, you can have the following workflow:
to check if the server works - https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice
stun:
stun.l.google.com:19302,
stun1.l.google.com:19302,
stun2.l.google.com:19302,
stun3.l.google.com:19302,
stun4.l.google.com:19302,
stun.ekiga.net,
stun.ideasip.com,
import React from "react";
import { Button, Text, View } from "react-native";
class App extends React.Component {
render() {
const remaining = this.state.deadline - this.state.now;
const minutes = Math.floor(remaining / 60000);
const seconds = Math.round((remaining - minutes * 60000) / 1000);
return (
<View style={{ padding: 10 }}>
@EmperorEarth
EmperorEarth / Chat.js
Last active July 26, 2020 17:02
learn-react-component-state
import React from "react";
class App extends React.Component {
render() {
return (
<div style={{ display: "flex", flexDirection: "row" }}>
<Status />
<Conversation />
</div>
);
@EmperorEarth
EmperorEarth / class.js
Created July 20, 2020 01:53
Color picker learning example
import React from "react";
class App extends React.Component {
render() {
const { redIntensity, greenIntensity, blueIntensity } = this.state;
const { _setRedIntensity, _setGreenIntensity, _setBlueIntensity } = this;
return (
<div style={{ display: "flex", flexDirection: "row" }}>
<div
style={{
@EmperorEarth
EmperorEarth / text-height-measurer.js
Created July 8, 2019 12:24 — forked from Ashoat/text-height-measurer.js
React Native component for measuring text height
// @flow
import type {
StyleObj,
} from 'react-native/Libraries/StyleSheet/StyleSheetTypes';
import React from 'react';
import PropTypes from 'prop-types';
import { Text, View, StyleSheet } from 'react-native';
import invariant from 'invariant';
@EmperorEarth
EmperorEarth / material_design_guidelines_dimens.xml
Created July 2, 2019 21:56 — forked from aeroechelon/material_design_guidelines_dimens.xml
Recommended Material Design Dimensions for Android
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!--
# Material Design Dimensions
These dimensions are provided as per Material Design Guidelines
to adhere to a 8 dp baseline grid. (With the exception of the
toolbar and notification bar.).
## References
const createMySocketMiddleware = (url) => {
return storeAPI => {
let socket = createMyWebsocket(url);
socket.on("message", (message) => {
storeAPI.dispatch({
type : "SOCKET_MESSAGE_RECEIVED",
payload : message
});
});
@EmperorEarth
EmperorEarth / install_nodejs_and_yarn_homebrew.md
Created June 12, 2019 22:50 — forked from nijicha/install_nodejs_and_yarn_homebrew.md
Install NVM, Node.js, Yarn via Homebrew

Install NVM, NodeJS, Yarn via Homebrew

Prerequisites

  • Homebrew should be installed (Command line tools for Xcode are included).

Getting start

Install NVM and NodeJS

  1. Install nvm via Homebrew