Skip to content

Instantly share code, notes, and snippets.

View neolite's full-sized avatar
💭
I may be slow to respond.

Rafkat Galiullin neolite

💭
I may be slow to respond.
View GitHub Profile
@neolite
neolite / print.js
Created July 24, 2017 15:40 — forked from cchitsiang/print.js
JavaScript Print: Bypass Printer Dialog in IE and Firefox
var OLECMDID = 6;
/* OLECMDID values: * 6 - print * 7 - print preview * 1 - open window * 4 - Save As */
if (navigator.appName == "Microsoft Internet Explorer")
{
var PrintCommand = '<object ID="PrintCommandObject" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></object>';
document.body.insertAdjacentHTML('beforeEnd', PrintCommand);
if(PrintCommandObject)
{
try
{
@neolite
neolite / webpack.base.conf.js
Created February 2, 2017 09:59 — forked from vedovelli/webpack.base.conf.js
webpack base config for vue cli with support for Bootstrap and Font-awesome
var path = require('path')
module.exports = {
entry: {
app: './src/main.js'
},
output: {
path: path.resolve(__dirname, '../dist/static'),
publicPath: '/static/',
filename: '[name].js'
@neolite
neolite / Capistrano 3.md
Created January 28, 2017 15:19 — forked from stevenyap/Capistrano 3.md
Capistrano 3 Setup

This guide explains the way to setup a production server using Capistrano.

Setup Capistrano on LOCAL

  • Capistrano is a development gem which assist the developer to run commands on the production server (something like a Heroku toolbelt)
  • Hence, it is installed and configured on developer's computer
# Gemfile

# Use Capistrano for deployment
@neolite
neolite / README.md
Created March 18, 2016 10:14 — forked from segphault/README.md
Pipe data from a RethinkDB changefeed into Plotti

RethinkDB Changfeeds and Plottico

This example shows how to take the output of a RethinkDB changefeed and send it to Plottico, a microservice that generates embeddable streaming graphs. This example uses Plottico's hosted infrastructure, but you can also self-host your own Plottico server using the code from Plottico's GitHub repository.

@neolite
neolite / put_method.js
Created November 10, 2015 12:28 — forked from Unitech/put_method.js
Timeseries spec proposal / RethinkDB
var timeseries = require('timeseries');
var incoming_data = {
client : 2,
events_1sec : 10,
events_1min : 65
};
/**
* The timeseries module must be state-less
down = document.createEvent("MouseEvents");
down.initMouseEvent("mousedown", true, true, window, 0, 0, 0, 80, 20, false, false, false, false, 0, null);
document.getElementById('clbh_phone_div').dispatchEvent(down)
up = document.createEvent("MouseEvents");
up.initMouseEvent("mouseup", true, true, window, 0, 0, 0, 80, 20, false, false, false, false, 0, null);
document.getElementById('clbh_phone_div').dispatchEvent(up)
@neolite
neolite / create-swap
Last active August 29, 2015 14:12 — forked from li9ht/create-swap
#!/bin/sh
cd /var
touch swap.img
chmod 600 swap.img
dd if=/dev/zero of=/var/swap.img bs=1024k count=1000
mkswap /var/swap.img
swapon /var/swap.img
echo "/var/swap.img none swap sw 0 0" >> /etc/fstab
sysctl -w vm.swappiness=30
free