Skip to content

Instantly share code, notes, and snippets.

View levchenkod's full-sized avatar
🏄‍♂️

Dmytro Levchenko levchenkod

🏄‍♂️
View GitHub Profile
@mikeybob
mikeybob / 3-body-problem-countdown-animation.markdown
Created April 21, 2024 01:51
3 body problem - countdown animation

3 body problem - countdown animation

I absolutely fell in love with the screen version of a novel by Cixin Liu - 3 Body Problem. Particularly eye-catching was Sophon's countdown. I had to create my version of it. With SVG and a noise function for each path point, I got a simplified version of the clock. But the main question is - what will happen when it hits zero?

A Pen by Dmytro Levchenko on CodePen.

License.

@jagdeepsingh
jagdeepsingh / README.md
Created January 8, 2018 05:35
Browser name and version details in JavaScript
navigator.browserInfo = (function() {
  var output, tem, ua;
  ua = navigator.userAgent;
  tem = void 0;

  output = ua.match(/(android)\s([0-9\.]*)/i) || ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [];

  if (/android/i.test(output[1])) {
 return {
@alexathylane
alexathylane / iOS Universal Links Support Checklist.md
Last active August 8, 2024 09:35
iOS Universal Links Support Checklist
@eladnava
eladnava / mongodb-s3-backup.sh
Last active September 13, 2024 11:42
Automatically backup a MongoDB database to S3 using mongodump, tar, and awscli (Ubuntu 14.04 LTS)
#!/bin/sh
# Make sure to:
# 1) Name this file `backup.sh` and place it in /home/ubuntu
# 2) Run sudo apt-get install awscli to install the AWSCLI
# 3) Run aws configure (enter s3-authorized IAM user and specify region)
# 4) Fill in DB host + name
# 5) Create S3 bucket for the backups and fill it in below (set a lifecycle rule to expire files older than X days in the bucket)
# 6) Run chmod +x backup.sh
# 7) Test it out via ./backup.sh
@jondot
jondot / keybez.md
Created January 14, 2016 16:49
ios keyboard bezier
  onKeyboardWillHide(e) {
    Animated.timing(this.state.height, {
      toValue: this.listViewMaxHeight,
      duration: e.duration,
      easing: Easing.bezier(0.1, 0.76, 0.55, 0.9)
    }).start();
  },

 onKeyboardWillShow(e) {
@mlvea
mlvea / currencies.json
Created March 17, 2015 16:07
Common currencies as an array
[
{
"symbol": "$",
"name": "US Dollar",
"symbol_native": "$",
"decimal_digits": 2,
"rounding": 0,
"code": "USD",
"name_plural": "US dollars"
},
@ksafranski
ksafranski / Common-Currency.json
Last active April 23, 2025 09:47
Common Currency Codes in JSON
{
"USD": {
"symbol": "$",
"name": "US Dollar",
"symbol_native": "$",
"decimal_digits": 2,
"rounding": 0,
"code": "USD",
"name_plural": "US dollars"
},
@kujon
kujon / clamp.js
Created May 24, 2012 13:13
JavaScript: Clamp a number.
/**
* Clamps a number. Based on Zevan's idea: http://actionsnippet.com/?p=475
* params: val, min, max
* Author: Jakub Korzeniowski
* Agency: Softhis
* http://www.softhis.com
*/
(function(){Math.clamp=function(a,b,c){return Math.max(b,Math.min(c,a));}})();