Skip to content

Instantly share code, notes, and snippets.

View webmaxru's full-sized avatar
😀
Progressive Web Max

Maxim Salnikov webmaxru

😀
Progressive Web Max
View GitHub Profile
@zachleat
zachleat / gist:2008932
Created March 9, 2012 21:56
Prevent zoom on focus
// * iOS zooms on form element focus. This script prevents that behavior.
// * <meta name="viewport" content="width=device-width,initial-scale=1">
// If you dynamically add a maximum-scale where no default exists,
// the value persists on the page even after removed from viewport.content.
// So if no maximum-scale is set, adds maximum-scale=10 on blur.
// If maximum-scale is set, reuses that original value.
// * <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=2.0,maximum-scale=1.0">
// second maximum-scale declaration will take precedence.
// * Will respect original maximum-scale, if set.
// * Works with int or float scale values.
/**
* ================== angular-ios9-uiwebview.patch.js v1.1.1 ==================
*
* This patch works around iOS9 UIWebView regression that causes infinite digest
* errors in Angular.
*
* The patch can be applied to Angular 1.2.0 – 1.4.5. Newer versions of Angular
* have the workaround baked in.
*
* To apply this patch load/bundle this file with your application and add a
@jhannes
jhannes / GoogleForms-to-Trello.gs
Last active May 23, 2023 14:45
Google Forms to Trello
var authentication = "key=a...&token=9...";
var idBoard = "592....";
var inboxList = "592...";
var updatedLabel = "592....";
function getField(itemResponses, fieldName) {
var titles = [];
for (var i in itemResponses) {
if (itemResponses[i].getItem().getTitle() === fieldName && itemResponses[i].getResponse().length > 0) {
@alxhub
alxhub / ngsw-doc-draft.md
Last active April 24, 2020 07:26
NGSW Documentation Draft (full)

What are Service Workers (and why might you want one)?

Service Workers are a new technology in modern web browsers. They augment the normal web deployment model and empower applications to deliver reliability and performance on par with natively installed code.

Service Workers have many different capabilities, but the most important is their function as a network proxy. They intercept all outgoing HTTP requests made by the application and can choose how to respond to them. For example, they can query a local cache and deliver a cached response if one is available. Proxying isn't limited to requests made through programmatic APIs (such as fetch), but includes resources referenced in HTML and even the initial request to index.html itself. Service Worker-based caching is thus completely programmable, and doesn't rely on server-specified caching headers.

Unlike the other scripts which make up an application (such as the Angular app bundle), the Service Worker is preserved after the user closes the tab. T

@obenjiro
obenjiro / angular.md
Last active July 2, 2018 16:22
Angular - что новенького?

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).

@igogrek
igogrek / Cookbook.md
Last active May 29, 2024 02:00
Cookbook

This cookbook is similar to Vue cookbook but contains our custom recipes for some specific cases.

Form validation

For form validation we use Vuelidate

export default Vue.extend({
  ...
 validations: {
@tobiasbueschel
tobiasbueschel / gd-and-gds.md
Last active March 31, 2022 11:52
Alias: ignore package-lock.json and yarn.lock in git diff

Don't want to see package-lock.json and yarn.lock in your git diff? Here are two nifty aliases that hide these files from your diff.

alias gd="git diff -- :!package-lock.json :!yarn.lock"
alias gds="git diff --staged -- :!package-lock.json :!yarn.lock"
@tkrotoff
tkrotoff / FrontendFrameworksPopularity.md
Last active May 30, 2024 02:25
Front-end frameworks popularity (React, Vue, Angular and Svelte)
@philhawksworth
philhawksworth / conference-mc-tips.md
Last active February 13, 2023 21:52
Conference MC-ing tips

👀📎 It looks like you're preparing to MC a conference...

🚨 GIANT DISCLAIMER: This stuff is far from authoritative. But it's what I think works for me, and what I enjoy in an MC when I'm attending a conference.


Biggest tip - enjoy yourself.