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,
@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
@EmperorEarth
EmperorEarth / keyrepeat.shell
Created May 26, 2019 12:44 — forked from kconragan/keyrepeat.shell
Enable key repeat in Apple Lion for Sublime Text in Vim mode
# Mac OS X Lion introduced a new, iOS-like context menu when you press and hold a key
# that enables you to choose a character from a menu of options. If you are on Lion
# try it by pressing and holding down 'e' in any app that uses the default NSTextField
# for input.
#
# It's a nice feature and continues the blending of Mac OS X and iOS features. However,
# it's a nightmare to deal with in Sublime Text if you're running Vintage (Vim) mode,
# as it means you cannot press and hold h/j/k/l to move through your file. You have
# to repeatedly press the keys to navigate.
@EmperorEarth
EmperorEarth / valuer.go
Created March 6, 2019 14:56 — forked from jmoiron/valuer.go
Example uses of sql.Scanner and driver.Valuer
package main
import (
"bytes"
"compress/gzip"
"database/sql/driver"
"errors"
"fmt"
"github.com/jmoiron/sqlx"
_ "github.com/mattn/go-sqlite3"
@EmperorEarth
EmperorEarth / GolangCPUProfiles.sh
Created March 4, 2019 11:20 — forked from bgadrian/GolangCPUProfiles.sh
Golang Flame graph profiles
#install FlameGraph library
cd /opt/
sudo git clone https://github.com/brendangregg/FlameGraph.git
#make it accesible from any folder
vim ~/.bashrc
##add these lines anywhere and exit vim (if you can)
export FLAMEPATH=/opt/FlameGraph
PATH=$PATH:$FLAMEPATH