Skip to content

Instantly share code, notes, and snippets.

const tree = {
{2, name},
{99, name},
{
id: 100,
name,
children: [
{3, name},
{4, name},
@ivan-hilckov
ivan-hilckov / better-font-smoothing.css
Created July 21, 2018 09:37 — forked from hsleonis/better-font-smoothing.css
Better font smoothing in cross browser
html {
/* Adjust font size */
font-size: 100%;
-webkit-text-size-adjust: 100%;
/* Font varient */
font-variant-ligatures: none;
-webkit-font-variant-ligatures: none;
/* Smoothing */
text-rendering: optimizeLegibility;
-moz-osx-font-smoothing: grayscale;
@ivan-hilckov
ivan-hilckov / await-async.js
Created July 13, 2018 13:49 — forked from MichalZalecki/await-async.js
Run generators and and await/async
import axios from "axios";
export default async function () {
const { data: { id } } = await axios.get("//localhost:3000/id");
const { data: { group } } = await axios.get("//localhost:3000/group");
const { data: { name } } = await axios.get(`//localhost:3000/${group}/${id}`);
console.log(name); // Michał
}
1 No one merges their own code
2 Never push directly to master
3 If you're working with UI, get a design review
4 If you're working on copy, get a copy review
5 Never, ever push directly to master
Rules are more like...
guidlines. 😅
const userTiming = () => (next) => (action) => {
if (performance.mark === undefined) return next(action);
performance.mark(`${action.type}_start`);
const result = next(action);
performance.mark(`${action.type}_end`);
performance.measure(
`${action.type}`,
`${action.type}_start`,
`${action.type}_end`,
);
{
test: /(?<!\.module)\.scss$/,
use: [
require.resolve('style-loader'),
{
loader: require.resolve('css-loader'),
options: {
importLoaders: 1,
},
},

Strings

String.prototype.*

None of the string methods modify this – they always return fresh strings.

  • charAt(pos: number): string ES1

    Returns the character at index pos, as a string (JavaScript does not have a datatype for characters). str[i] is equivalent to str.charAt(i) and more concise (caveat: may not work on old engines).

ViewSetException at /en/blog/
No view
Request Method: GET
Request URL: http://localhost:8000/en/blog/
Django Version: 1.11.6
Exception Type: ViewSetException
Exception Value:
No view
Exception Location: /Users/bzzz/projects/asgardia-default/space/project/contrib/views/view_set.py in get_redirect_url, line 124
Python Executable: /Users/bzzz/projects/asgardia-default/bin/python
{
"type":"FeatureCollection",
"features":[
{
"geometry":{
"type":"Point",
"coordinates":[
36.28844261169434,
55.397587753141366
]