Skip to content

Instantly share code, notes, and snippets.

View shavidzet's full-sized avatar
👀
Learning

Tornike Shavidze shavidzet

👀
Learning
  • Tbilisi, Georgia
View GitHub Profile
[
{
"id":"1",
"bundles":[
{
"id":"10",
"bundleCode":"B38666638011",
"name":"2m Planer with Operators, Banksman & Transport",
"assets":[
{
@shavidzet
shavidzet / socket-cheatsheet.js
Created December 15, 2017 03:08 — forked from alexpchin/socket-cheatsheet.js
A quick cheatsheet for socket.io
// sending to sender-client only
socket.emit('message', "this is a test");
// sending to all clients, include sender
io.emit('message', "this is a test");
// sending to all clients except sender
socket.broadcast.emit('message', "this is a test");
// sending to all clients in 'game' room(channel) except sender
@shavidzet
shavidzet / docker-destroy-all.sh
Created December 9, 2017 22:51 — forked from JeffBelback/docker-destroy-all.sh
Destroy all Docker Containers and Images
#!/bin/bash
# Stop all containers
docker stop $(docker ps -a -q)
# Delete all containers
docker rm $(docker ps -a -q)
# Delete all images
docker rmi $(docker images -q)
@shavidzet
shavidzet / harlem.js
Created May 17, 2017 21:07
Harlem JS
javascript:(function(){function c(){var e=document.createElement("link");e.setAttribute("type","text/css");e.setAttribute("rel","stylesheet");e.setAttribute("href",f);e.setAttribute("class",l);document.body.appendChild(e)}function h(){var e=document.getElementsByClassName(l);for(var t=0;t<e.length;t++){document.body.removeChild(e[t])}}function p(){var e=document.createElement("div");e.setAttribute("class",a);document.body.appendChild(e);setTimeout(function(){document.body.removeChild(e)},100)}function d(e){return{height:e.offsetHeight,width:e.offsetWidth}}function v(i){var s=d(i);return s.height>e&&s.height<n&&s.width>t&&s.width<r}function m(e){var t=e;var n=0;while(!!t){n+=t.offsetTop;t=t.offsetParent}return n}function g(){var e=document.documentElement;if(!!window.innerWidth){return window.innerHeight}else if(e&&!isNaN(e.clientHeight)){return e.clientHeight}return 0}function y(){if(window.pageYOffset){return window.pageYOffset}return Math.max(document.documentElement.scrollTop,document.body.scrollTop)}funct
@shavidzet
shavidzet / package.json
Created November 21, 2016 21:48
npm run dev command
"scripts": {
"dev": "npm i & suitcss src/suitcss.css public/dist/css/suitcss.css & gulp & webpack -w & browser-sync start --config bs-config.js & http-server -p 8080 -s -c-1"
},
@shavidzet
shavidzet / filters.json
Created October 11, 2016 13:55
Retrieve filters by category
{
"RAM": [{
"specNameId": 1,
"specNameValueId": 1,
"specNameValue": 8,
"unit": "GB",
"range": 0
},
{
"specNameId": 1,
@shavidzet
shavidzet / .htaccess
Last active October 24, 2016 10:21
Access website without public directory
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
RewriteCond %{REQUEST_URI} !(\.css|\.js|\.png|\.jpg|\.gif|robots\.txt)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
import facebookRepository from 'Repositories/facebookRepository'
class AuthRepository
{
async emailExists(email) {
return new Promise((resolve, reject) => {
$.post('http://api.gotrip.ge/api/user/check_email.php', {email}, response => resolve(response))
})
}
makeAuth(data) {
@shavidzet
shavidzet / migrateDB.sh
Created July 7, 2016 21:36
Phinx migration with bash
PHINX=vendor/bin/phinx
read -p "Enviroment: " phinx_enviroment
$PHINX rollback -e $phinx_enviroment -t 0
$PHINX migrate -e $phinx_enviroment
ls -l db/seeds
read -p "Seed filename: " phinx_seed
$PHINX seed:run -e $phinx_enviroment -s $phinx_seed -v

Apache Virtual Hosting (vhost)