Recommendations of unit types per media type:
| Media | Recommended | Occasional use | Infrequent use | Not recommended |
|---|---|---|---|---|
| Screen | em, rem, % | px | ch, ex, vw, vh, vmin, vmax | cm, mm, in, pt, pc |
| em, rem, % | cm, mm, in, pt, pc | ch, ex | px, vw, vh, vmin, vmax |
| import fs from 'fs'; | |
| import * as path from 'path'; | |
| import * as z from 'zod'; | |
| //---------------------------------------------------------------- | |
| // | |
| // Outputs all xcassets-format colors into hex format, with separate light and dark mode values. | |
| // IMPORTANT: this only covers a couple of the color formats Xcode uses, and may not properly handle color spaces etc. | |
| // | |
| // Usage: |
| /* | |
| Promises are fun by Olly Shaw | |
| https://twitter.com/olly_shaw | |
| https://github.com/ollyjshaw | |
| To run this download the file and do something like | |
| node promises.js | |
| logging will be out of order (Promises are asychronous). But hopefully you can find your way. | |
| */ |
| find . -maxdepth 1 -type d \( ! -name . \) -exec bash -c "cd '{}' && npm install" \; |
| #!/bin/bash | |
| # I made this script to convert SVG icons for an iOS app into PNG. | |
| # The script will create icons in 3 sizes for different screen DPIs. | |
| find . -type f -name "*.svg" | while read f | |
| do | |
| echo '---' | |
| FILENAME="${f%.*}" | |
| echo $FILENAME |
| // File: .storybook/config.js | |
| import { configure, addDecorator } from '@kadira/storybook'; | |
| import Theme from './../src/ui/theme'; | |
| import React from 'react'; | |
| import { ThemeProvider } from 'styled-components' | |
| function loadStories() { | |
| require('../stories'); | |
| } |
| flex-flow:column-reverse wrap-reverse; | |
| justify-content:center; | |
| align-content:space-between; |
Recommendations of unit types per media type:
| Media | Recommended | Occasional use | Infrequent use | Not recommended |
|---|---|---|---|---|
| Screen | em, rem, % | px | ch, ex, vw, vh, vmin, vmax | cm, mm, in, pt, pc |
| em, rem, % | cm, mm, in, pt, pc | ch, ex | px, vw, vh, vmin, vmax |
| <?xml version="1.0" encoding="utf-8"?> | |
| <resources> | |
| <!-- google's material design colours from | |
| http://www.google.com/design/spec/style/color.html#color-ui-color-palette --> | |
| <!--reds--> | |
| <color name="md_red_50">#FFEBEE</color> | |
| <color name="md_red_100">#FFCDD2</color> | |
| <color name="md_red_200">#EF9A9A</color> |
| # Built application files | |
| /*/build/ | |
| # Crashlytics configuations | |
| com_crashlytics_export_strings.xml | |
| # Local configuration file (sdk path, etc) | |
| local.properties | |
| # Gradle generated files |
| + (NSArray*)allEntriesInContext:(NSManagedObjectContext*)context fromDate:(NSDate*)fromDate toDate:(NSDate*)toDate{ | |
| // Create the request | |
| NSFetchRequest *request = [[NSFetchRequest alloc]initWithEntityName:@"Entry"]; | |
| // Build the predicate | |
| NSPredicate *predicate = [NSPredicate predicateWithFormat: @"date >= %@ && date <= %@ ", fromDate, toDate]; | |
| request.predicate = predicate; | |
| // Define sorting | |
| NSSortDescriptor *sortDesc = [NSSortDescriptor sortDescriptorWithKey:@"date" ascending:YES]; | |
| request.sortDescriptors = @[sortDesc]; |