Skip to content

Instantly share code, notes, and snippets.

@Grom-S
Grom-S / run.js
Created October 28, 2014 09:25
Google analytics in Angular SPA
angular.module('main').run(function ($rootScope, $location, $window) {
$rootScope.$on('$routeChangeSuccess', function () {
var path = $location.path();
$window.ga('send', 'pageview', {page: path});
});
});
@Grom-S
Grom-S / index.html
Created October 22, 2014 08:16
Simple sticky footer CSS solution
<!doctype html>
<html>
<head>
<title>VidRoaster</title>
</head>
<body>
<div class="page-wrap">
<!-- Content of the various size here -->
</div>
@Grom-S
Grom-S / script.sh
Last active August 29, 2015 14:03
Fix permissions
find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;
{
"layouts": [
{
"element": "slide",
"elementId": 1,
"properties": {
"identifier": {
"type": "string",
"attributes": {
"label": "ID",
<?php
class TestsRunner
{
private $jsonFilePath;
public function setJsonFileLocation($path)
$posts = get_posts(array(
'numberposts' => -1,
'post_type' => 'link',
'meta_query' => array(
array(
'key' => 'related_to',
'value' => get_the_ID(),
'compare' => 'LIKE'
)
)
<?php
$products = array(
'Media Player',
'Video Converter'
);
$file_data = file_get_contents("template.json");
$main_json = json_decode($file_data);
@Grom-S
Grom-S / post-install.sh
Created October 7, 2013 07:30
Ubuntu post install script
#!/bin/bash
# Enable all repositories
sudo sed 's/# deb/deb/' -i /etc/apt/sources.list
# Add repos
sudo add-apt-repository ppa:webupd8team/sublime-text-2
# refresh the software list
sudo apt-get update
@Grom-S
Grom-S / grid.css
Last active September 26, 2015 23:27
CSS: simple fluid grid system
/* @group Columns
------------------------------------------------------------ */
.one-half { width: 48%; }
.one-third { width: 30.66%; }
.two-third { width: 65.33%; }
.one-fourth { width: 22%; }
.three-fourth { width: 74%; }
.one-fifth { width: 16.8%; }
.two-fifth { width: 37.6%; }