Skip to content

Instantly share code, notes, and snippets.

xpol xpol

Block or report user

Report or block xpol

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@xpol
xpol / install.sh
Last active May 15, 2019
Enable audio video tag in Visual Studio Code on macOS
View install.sh
#!/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"
@xpol
xpol / graphql-go-mongodb-example.go
Created Sep 22, 2018 — forked from trunet/graphql-go-mongodb-example.go
Minimal example of GraphQL Golang and MongoDB playing nicely together. Edit
View graphql-go-mongodb-example.go
// Embedded in this article https://medium.com/p/c98e491015b6
package main
import (
"context"
"fmt"
"log"
"net/http"
"time"
@xpol
xpol / tcomb-react Cheat Sheet.md
Created Jul 13, 2018
Tcomb React Cheat Sheet
View tcomb-react Cheat Sheet.md

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 / PinchZoomPan.js
Created May 5, 2017 — forked from iammerrick/PinchZoomPan.js
React Pinch + Zoom + Pan
View PinchZoomPan.js
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 / rename-photos-by-exif-date-time.sh
Last active May 13, 2016
Rename photos by exif date
View rename-photos-by-exif-date-time.sh
for fil in *.jpg; do datepath="$(identify -verbose $fil | grep DateTimeOri | awk '{print $2"-"$3 }' | sed s%:%%g)"; mv -v $fil $datepath.jpg; done
View luaenv-rocks.sh
#!/usr/bin/env bash
# Install luarocks for luaenv.
function install() {
printf "install luarocks for $1..."
local ROOT=`luaenv root`
if [[ $1 == luajit* ]]; then
./configure --prefix=$ROOT/versions/$1 \
--with-lua=$ROOT/versions/$1 \
--rocks-tree=$ROOT/versions/$1 \
@xpol
xpol / ProFi.lua
Created Jan 14, 2016 — forked from perky/ProFi.lua
ProFi, a simple lua profiler that works with LuaJIT and prints a pretty report file in columns.
View ProFi.lua
--[[
ProFi v1.3, by Luke Perkin 2012. MIT Licence http://www.opensource.org/licenses/mit-license.php.
Example:
ProFi = require 'ProFi'
ProFi:start()
some_function()
another_function()
coroutine.resume( some_coroutine )
ProFi:stop()
View .bash_probile
function proxy {
case $1 in
[1-9]*)
export http_proxy=socks5://127.0.0.1:$1
export https_proxy=$http_proxy
git config --global http.proxy $http_proxy
git config --global https.proxy $https_proxy
;;
off)
@xpol
xpol / 00_ha_dnscrypt_proxy_client_setup.markdown
Created Dec 25, 2015 — forked from steakknife/00_ha_dnscrypt_proxy_client_setup.markdown
Highly-available dnscrypt-proxy client setup on OSX with DNSSEC.
View 00_ha_dnscrypt_proxy_client_setup.markdown

Tested, works!

Install

git clone https://gist.github.com/fccbf0f02355a31f7959 && cd fccbf0f02355a31f7959 && sh install.sh && cd .. && rm -rf fccbf0f02355a31f7959

Uninstall

git clone https://gist.github.com/fccbf0f02355a31f7959 && cd fccbf0f02355a31f7959 && sh uninstall.sh && cd .. && rm -rf fccbf0f02355a31f7959
You can’t perform that action at this time.