Skip to content

Instantly share code, notes, and snippets.

View junkycoder's full-sized avatar

Dan Hromada junkycoder

  • Česká republika
View GitHub Profile
@kiding
kiding / NoScrollOnInputFocusiOSSafari.html
Last active April 25, 2024 08:14
Preventing iOS Safari scrolling when focusing on input elements
<!--
When an input element gets focused, iOS Safari tries to put it in the center by scrolling (and zooming.)
Zooming can be easily disabled using a meta tag, but the scrolling hasn't been quite easy.
The main quirk (I think) is that iOS Safari changes viewport when scrolling; i.e., toolbars shrink.
Since the viewport _should_ change, it thinks the input _will_ move, so it _should_ scroll, always.
Even times when it doesn't need to scroll—the input is fixed, all we need is the keyboard—
the window always scrolls _up and down_ resulting in some janky animation.
However, iOS Safari doesn't scroll when the input **has opacity of 0 or is completely clipped.**
@MichaelSolati
MichaelSolati / upgrade-geofirestore.js
Last active October 25, 2020 18:48
Node script to upgrade GeoFirestore v3 (and older) docs to GeoFirestore v4
const admin = require("firebase-admin");
const { GeoFirestore, GeoCollectionReference } = require("geofirestore");
/**
* Generate new private key by selecting a project from below:
* https://console.firebase.google.com/u/0/project/_/settings/serviceaccounts/adminsdk
*/
const SERVICE_ACCOUNT = require("./serviceAccountKey.json");
/**
* Set the collection to update here.
@imhafeez
imhafeez / xCodeServerCI-BuildUpload.sh
Created October 10, 2019 05:13
xCode Server CI Build Upload Trigger
#!/bin/sh
# For Build upload.
/Applications/Xcode.app/Contents/Applications/Application\ Loader.app/Contents/Frameworks/ITunesSoftwareService.framework/Support/altool --upload-app -f $XCS_PRODUCT -u $TESTFLIGHT_USERNAME -p $TESTFLIGHT_PASSWORD
@qutek
qutek / clear-node-modules.sh
Last active March 11, 2021 09:46
[Clear Node Modules] Delete all node_modules directory #bash
#!/bin/bash
#
# This script will remove all node modules
#
# Author: Lafif Astahdziq
# https://lafif.me
#
FOLDER_ROOT=${1:-.} # default to current directory
watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf $TMPDIR/npm-* && rm -rf $TMPDIR/haste-* && rm -rf $TMPDIR/metro-* && rm -rf node_modules && npm install && rm -rf ios/Pods && cd ios && pod cache clean --all && pod repo update && pod install && ./android/gradlew clean -p ./android/ && rm -rf ios/build && rm -rf ~/Library/Developer/Xcode/DerivedData && npm start -- --reset-cache
@carry0987
carry0987 / RPi3-Auto-WiFi.md
Last active May 7, 2024 09:55
Raspberry Pi 3B+ Auto reconnect to wifi when lost connect

Auto reconnect to wifi when lost connection

Before you start, make sure ip command is available on your system. In modern Linux distributions, ip replaces older ifconfig command. If net-tools package (that includes ifconfig) is not installed and you prefer using it, you can install it via sudo apt-get install net-tools.

Create script file

Use touch /home/pi/wifi-reconnect.sh to create a shell script file, with the following content:

#!/bin/bash
@arcao
arcao / dns-list.txt
Created April 2, 2018 10:10
DNS ping test
# Google DNS
8.8.8.8
8.8.4.4
# CloudFlare DNS
1.1.1.1
# Quad 9 DNS
9.9.9.9
@maciejkorsan
maciejkorsan / deploy.js
Created January 24, 2018 13:21
deploy.js script for CircleCI GitHub - FTP upload
var FtpDeploy = require('ftp-deploy');
var ftpDeploy = new FtpDeploy();
var config = {
username: process.env.FTPUSERNAME,
password: process.env.FTPPASS,
host: process.env.FTPHOST,
port: 21,
localRoot: __dirname + "/../dist/",
remoteRoot: "/",
@maciejkorsan
maciejkorsan / config.yml
Last active February 8, 2019 21:58
CircleCI GitHub - FTP deploy config
version: 2
jobs:
build:
docker:
- image: circleci/node:latest
steps:
- checkout
- run: npm install
- run: npx gulp build
- run: node .circleci/deploy.js
@habemus-papadum
habemus-papadum / main.swift
Last active April 21, 2022 18:12
Single File Swift 3 Gui Sample
// A reminder to myself on how to quickly create a throw away gui app on OSX (i.e. a single file,
// w/o relying on XCode project templates
//Notes: In general it is hard to know how to create a Cocoa based gui without using XCode.
//This issue has existed for both Objective-C and now Swift
//Furthermore, Swift<-->Cocoa syntax has changed dramatically over various Swift versions,
//making stackoverflow posts unreliable
//This file provides a template for creating a throw away gui app