Skip to content

Instantly share code, notes, and snippets.

@xpol
xpol / rename-photos-by-exif-date-time.sh
Last active May 13, 2016 06:27
Rename photos by exif date
for fil in *.jpg; do datepath="$(identify -verbose $fil | grep DateTimeOri | awk '{print $2"-"$3 }' | sed s%:%%g)"; mv -v $fil $datepath.jpg; done
@xpol
xpol / PinchZoomPan.js
Created May 5, 2017 04:37 — forked from iammerrick/PinchZoomPan.js
React Pinch + Zoom + Pan
import React from 'react';
const MIN_SCALE = 1;
const MAX_SCALE = 4;
const SETTLE_RANGE = 0.001;
const ADDITIONAL_LIMIT = 0.2;
const DOUBLE_TAP_THRESHOLD = 300;
const ANIMATION_SPEED = 0.04;
const RESET_ANIMATION_SPEED = 0.08;
const INITIAL_X = 0;
@xpol
xpol / build.sh
Created October 14, 2014 14:25
iOS build script
# Unlock keychain
security unlock-keychain -p jenkins /Users/jenkins/Library/Keychains/login.keychain
# Build and sign app
xcodebuild -configuration Distribution clean build
# Set variables
APP_PATH="$PWD/build/Distribution-iphoneos/iPadApp.app"
VERSION=`defaults read $APP_PATH/Info CFBundleShortVersionString`
REVISION=`defaults read $APP_PATH/Info CFBundleVersion`
@xpol
xpol / tcomb-react Cheat Sheet.md
Created July 13, 2018 03:07
Tcomb React Cheat Sheet

Tcomb React Cheat Sheet

Type React tcomb-react
array array Array
boolean bool Boolean
functions func Function
numbers number Number
objects object Object
strings string String
@xpol
xpol / graphql-go-mongodb-example.go
Created September 22, 2018 07:22 — forked from trunet/graphql-go-mongodb-example.go
Minimal example of GraphQL Golang and MongoDB playing nicely together. Edit
// Embedded in this article https://medium.com/p/c98e491015b6
package main
import (
"context"
"fmt"
"log"
"net/http"
"time"
@xpol
xpol / Cheatsheet.md
Created August 25, 2013 09:30
Markdown files that send to convert via Github API with python 3 urllib. The `gfm.py Sample.md` got fine result. The `gfm.py Cheatseet.md` would get 'BadStatusLine'.

Sample Markdown Cheat Sheet

This is a sample markdown file to help you write Markdown quickly :)

If you use the fabulous [Sublime Text 2/3 editor][ST] along with the [Markdown Preview plugin][MarkdownPreview], open your ST2 Palette with CMD+P then choose Markdown Preview in browser to see the result in your browser.

Text basics

this is italic and this is bold . another italic and another bold

@xpol
xpol / FL_WinSDK_SetEnv_Cmd
Created November 1, 2015 06:47
setenv.cmd
@ECHO OFF
:: --------------------------------------------------------------------------------------------
:: File : SetEnv.cmd
::
:: Abstract: This batch file sets the appropriate environment variables for the Windows SDK
:: build environment with respect to OS and platform type.
::
:: Usage : Setenv [/Debug | /Release][/x86 | /x64 | /ia64 ][/vista | /xp | /2003 | /2008 | /win7][-h | /?]
::
:: /Debug - Create a Debug configuration build environment
@xpol
xpol / install.sh
Last active August 10, 2022 16:31
Enable audio video tag in Visual Studio Code on macOS
#!/usr/bin/env bash
curl -sL -o libffmpeg.zip https://github.com/iteufel/nwjs-ffmpeg-prebuilt/releases/download/0.38.1/0.38.1-osx-x64.zip
unzip libffmpeg.zip
mv ./libffmpeg.dylib "/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libffmpeg.dylib"