Skip to content

Instantly share code, notes, and snippets.

View arvi's full-sized avatar
🎯
Focusing

arvi

🎯
Focusing
View GitHub Profile
/* EFFECT 1 */
.effect1
{
-webkit-box-shadow: 0 10px 6px -6px #777;
-moz-box-shadow: 0 10px 6px -6px #777;
box-shadow: 0 10px 6px -6px #777;
}
/* EFFECT 2 */
.effect2
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function(position){
var latitude = position.coords.latitude;
var longitude = position.coords.longitude;
var accuracy = position.coords.accuracy; console.log(latitude, longitude, accuracy); /*
var coords = new google.maps.LatLng(latitude, longitude);
var mapOptions = {
zoom: 15,
center: coords,
mapTypeControl: true,
@arvi
arvi / sublime-installation-update.md
Created September 27, 2016 03:23
How to install/update Sublime Text (Elementary OS Freya / Ubuntu)
  1. Remove existing sublime text editor
  • sudo apt-get remove sublime-text-installer

Download the package and drag the file to the terminal

  • sudo dpkg -i '/home/usernamehere/Downloads/sublime-text_build-3126_amd64.deb'

OR Direct

@arvi
arvi / SimpleStore.js
Created September 8, 2016 05:37 — forked from ksafranski/SimpleStore.js
Simple localStorage function with Cookie fallback for older browsers.
/**
* Simple localStorage with Cookie Fallback
* v.1.0.0
*
* USAGE:
* ----------------------------------------
* Set New / Modify:
* store('my_key', 'some_value');
*
* Retrieve:
@arvi
arvi / i18next-vanilla.js
Created September 6, 2016 10:29
jQuery's i18next counterpart on vanilla js
//translates text to user's preferred language
for (i = 0; i < document.querySelectorAll('[data-i18n]').length; i++) {
document.querySelectorAll('[data-i18n]')[i].innerHTML = i18next.t(document.querySelectorAll('[data-i18n]')[i].getAttribute("data-i18n"));
}
//source: https://github.com/i18next/i18next/issues/398#issuecomment-241671697
  • check if openssl is installed
which openssl
  • generate private key and certificate signing request
openssl genrsa -des3 -passout pass:x -out server.pass.key 2048
openssl rsa -passin pass:x -in server.pass.key -out server.key
myApp.onPageInit('conversations-chat', function (page) {
var myMessages = myApp.messages('.messages', {
autoLayout: true //adds all required additional classes (like "message-pic", "message-with-avatar", "message-with-tail", etc)
});
//initialize message bar
var myMessagebar = myApp.messagebar('.messagebar');
var conversationStarted = false;
@arvi
arvi / sublime-ui-theme-font-face.js
Created August 5, 2016 02:18
Custom Sublime font face settings (tabs, labels, and sidebar)
//------------------------------------------------------------------------------
// THEME FONT FACE
//------------------------------------------------------------------------------
//Tabs
{
"class": "tab_label",
"font.face" : ""
},
//Labels
@arvi
arvi / server.js
Last active July 20, 2016 10:49
Quick node server spin-up
var fs = require("fs");
var host = "127.0.0.1";
var port = 3000;
var express = require("express");
var app = express();
app.use(express.static(__dirname + "/")); //use static files in ROOT/public folder
app.get("/", function(request, response){ //root dir
response.send("Hello There");
@arvi
arvi / kurento-cheatsheet.md
Last active July 11, 2016 11:03
Kurento Development Cheatsheet

Start / Stop

sudo service kurento-media-server-6.0 start
sudo service kurento-media-server-6.0 stop

Run NodeJs tutorial app: