Skip to content

Instantly share code, notes, and snippets.

View davorpeic's full-sized avatar
🏠
Working from home

Davor Peic davorpeic

🏠
Working from home
View GitHub Profile
@trey
trey / rwd.css
Created January 26, 2012 20:14
Bootstrap's RWD breakpoints
/* http://twitter.github.com/bootstrap/scaffolding.html#responsive */
/* Landscape phones and down */
@media (max-width: 480px) { ... }
/* Landscape phone to portrait tablet */
@media (max-width: 768px) { ... }
/* Portrait tablet to landscape and desktop */
@media (min-width: 768px) and (max-width: 940px) { ... }
@ScottPhillips
ScottPhillips / .htaccess
Created February 2, 2012 04:30
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@davist11
davist11 / ext.php
Last active December 16, 2015 22:09
EE Entry previewing
<?php
public function sessions_end($session)
{
if ($session->userdata['can_access_cp'] === 'y') {
$new_global_vars['gv_can_preview'] = TRUE;
} else {
$new_global_vars['gv_can_preview'] = FALSE;
}
@gmilby
gmilby / createUUID.js
Created September 18, 2013 16:46
angular - create unique id
angular
.module('uuidApp', ['lvl.services'])
.controller('uuidCtl', ['$scope', 'uuid', function($scope, uuid){
$scope.generateUuid = function() {
$scope.new = uuid.new();
$scope.nInfo = new Date();
};
$scope.showEmpty = function() {
$scope.empty = uuid.empty();
@brandonkelly
brandonkelly / templating.md
Last active February 7, 2024 15:20
Templating in EE vs. Craft
@jgoux
jgoux / app.js
Created April 15, 2014 14:53
Ionic / AngularJS service wrapper for Web SQL API / SQLite-Cordova-Plugin
angular.module('myApp', ['ionic', 'myApp.services', 'myApp.controllers'])
.run(function(DB) {
DB.init();
});
@jimthedev
jimthedev / 010_resource_files.js
Last active April 2, 2018 06:55
Shell script to automatically copy icons and splash screens in Cordova 3.5 / Ionic Framework
#!/usr/bin/env node
// this file lives at hooks/after_prepare/010_resource_files.js
// It copies my icon and splash screens to the correct location
// so that they will be loaded by Cordova 3.5
//
// This hook copies various resource files
// from our version control system directories
// into the appropriate platform specific location
@bjornbjorn
bjornbjorn / https redirect
Last active August 29, 2015 14:11
secure http -> https redirect in master config (EE)
/**
* Force HTTPS on prod & staging. This functionality was previously in the .htaccess'es but we moved
* it here to ease multiple environment development.
*/
if(FORCE_HTTPS && (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == "")){
$redirect_url = filter_var("https://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'], FILTER_VALIDATE_URL);
if($redirect_url) {
header("HTTP/1.1 301 Moved Permanently");
header("Location: $redirect_url");
die();
@sean-hill
sean-hill / Hide Splashscreen in Ionic App
Last active April 16, 2017 17:25
Hide Splashscreen in Ionic App with ngCordova
Hide Splashscreen in Ionic App
@01-Scripts
01-Scripts / hook.php
Created August 18, 2015 19:34
Add Post Deploy-Hook as HTTP POST Notification for deployhq.com deploys. Put the following file in the root directory of your project or adjust the path in line 24.
<?PHP
$publicKey = "-----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDXJcP2N6NtcN26Q8nVaidXOA0w
RxWK2HQTblIaQdGRDjqTvhrSlFuV5N4jz7w/w8uskP20G7ZQ+CkHwIXrWk76KZJn
pdoOHPO6AqRmEFgV5Q6Y1CR77mvnT9O21hTnfzfyyiAdQC2oO8M9/jeLRPTAqmkG
xdQa8iepUz4BwrrHmwIDAQAB
-----END PUBLIC KEY-----";
// Verify integrity of Payload
$result = openssl_verify($_POST['payload'], base64_decode($_POST['signature']), $publicKey);