Skip to content

Instantly share code, notes, and snippets.

View sharpfuryz's full-sized avatar
🥇

Dmytro sharpfuryz

🥇
View GitHub Profile
@sharpfuryz
sharpfuryz / gist:b30ec4b2ca0bdff670f2e6d61701cdaf
Last active March 9, 2017 09:01
Electron working entitlements
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
<key>com.apple.security.files.user-selected.read-write</key>
<true/>
@sharpfuryz
sharpfuryz / elasticseach.monitconf
Created November 11, 2015 09:06
Elasticsearch monit conf
check host elasticsearch_connection with address 127.0.0.1
start program = "/usr/bin/env service elasticsearch start"
stop program = "/usr/bin/env service elasticsearch stop"
if failed url http://127.0.0.1:9200/ with timeout 15 seconds then restart
group elasticsearch
@sharpfuryz
sharpfuryz / gist:b52e382307853bf99d6e
Created February 24, 2015 08:28
Left to Right swipe
rowView.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
final float density = context.getResources().getDisplayMetrics().density;
int initialX = 0;
switch (event.getAction()) {
case MotionEvent.ACTION_MOVE: {
int currentX = (int) event.getX();
final int offset = currentX - initialX;
if (Math.abs(offset) > 128) {
@sharpfuryz
sharpfuryz / gist:4b8daa74ce126c65cae3
Last active August 29, 2015 14:11
Иконки для браузеров мобильных устройств
Привет!
Если ты используешь haml, то вот какой код для подключения:
// MS Surface, IE 11
%meta{name:'msapplication-TileColor',content:'#00afff'} # цвет подложки сайта
%meta{name:'msapplication-square150x150logo', content: '/icons_150.png'}
// iOS icons
%link{href:'/icon_16.png', rel: 'icon', type: 'image/png'}
%link{href:'/icon_32.png', rel: 'icon', type: 'image/png', sizes: '32x32'}
%link{href:'/apple-touch-icon.png', rel: 'apple-touch-icon'}
%link{href:'/apple-touch-icon-76x76.png', rel: 'apple-touch-icon', sizes: '76x76'}
@sharpfuryz
sharpfuryz / gist:14a6b128b70b7fb4fb13
Created July 18, 2014 06:21
Chrome windows font fix
Initial:
@font-face {
font-family: 'MyFont';
src: url('fonts/myfont.eot');
src: url('fonts/myfont.eot?#iefix') format('embedded-opentype'),
url('fonts/myfont.woff') format('woff'),
url('fonts/myfont.ttf') format('truetype'),
url('fonts/myfont.svg#myfont') format('svg');
font-weight: normal;
font-style: normal;
@sharpfuryz
sharpfuryz / gist:8368395
Created January 11, 2014 08:20
Opengraph simplest lib
module OpenGraph
# Rails implementation of OpenGraph generator
# Author: sharpfuryz@gmail.com
# Based on http://ogp.me and http://developers.facebook.com
class << self
# Magic
def parse_options(options)
output = ''
options.each_key do |key|
output += ActionView::Helpers::TagHelper.tag(:meta, {:property => "og:#{key}", :content => options[key]})
$.ajax({
url: 'http://structor.io/api/v1/users/sign_in',
type: "POST",
data: {
'user[email]': 'login',
'user[password]': 'password'
}
})
@sharpfuryz
sharpfuryz / gist:7300242
Created November 4, 2013 09:35
iOS icons for webpage
<link rel="apple-touch-icon-precomposed" sizes="57x57" href="apple-touch-icon-114-precomposed.png" />
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="apple-touch-icon-114-precomposed.png" />
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="apple-touch-icon-144-precomposed.png " />
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="apple-touch-icon-144-precomposed.png" />
@sharpfuryz
sharpfuryz / gist:7231781
Created October 30, 2013 12:24
Nginx bestperfomance from habr for linux
# This number should be, at maximum, the number of CPU cores on your system.
worker_processes 8;
# Number of file descriptors used for Nginx.
worker_rlimit_nofile 200000;
# Only log critical errors.
error_log /var/log/nginx/error.log crit
events {
# Determines how many clients will be served by each worker process.
worker_connections 4000;
@sharpfuryz
sharpfuryz / gist:6312622
Created August 22, 2013 20:50
CentOS httpd script
[furyz@one ~]$ cat /etc/init.d/httpd
#!/bin/bash
#
# httpd Startup script for the Apache HTTP Server
#
# chkconfig: - 85 15
# description: The Apache HTTP Server is an efficient and extensible \
# server implementing the current HTTP standards.
# processname: httpd
# config: /etc/httpd/conf/httpd.conf