Skip to content

Instantly share code, notes, and snippets.

@eldorplus
eldorplus / backup.sh
Last active August 29, 2015 14:22 — forked from omichelsen/backup.sh
#!/bin/sh
PATH=/usr/local/bin:/usr/local/sbin:~/bin:/usr/bin:/bin:/usr/sbin:/sbin
#----------------------------------------------------
# a simple mysql database backup script.
# version 2, updated March 26, 2011.
# copyright 2011 alvin alexander, http://devdaily.com
#----------------------------------------------------
# This work is licensed under a Creative Commons
# Attribution-ShareAlike 3.0 Unported License;
@eldorplus
eldorplus / json.getSru.php
Created June 4, 2016 10:23 — forked from jsicot/json.getSru.php
json.getSru.php
<?php
//error_reporting(E_ALL);
//ini_set('display_errors', '0');
include('QuiteSimpleXMLElement.php');
$amazonRemplacementImg = file_get_contents('http://www.bu.fr/images/defaultcover.jpg', false);
if (isset( $_GET['q'])) {
$q = $_GET['q'];
@eldorplus
eldorplus / pqf.properties
Created June 4, 2016 10:26 — forked from jsicot/pqf.properties
pqf.properties
#
# Propeties file to drive org.z3950.zing.cql.CQLNode's toPQF()
# back-end and the YAZ CQL-to-PQF converter. This specifies the
# interpretation of various CQL indexes, relations, etc. in terms
# of Type-1 query attributes.
#
# This configuration file generates queries using BIB-1 attributes.
# See http://www.loc.gov/z3950/agency/zing/cql/dc-indexes.html
# for the Maintenance Agency's work-in-progress mapping of Dublin Core
# indexes to Attribute Architecture (util, XD and BIB-2)
@eldorplus
eldorplus / gist:aed69c7472624c1d8a0c18b106e9fab8
Created August 21, 2016 17:53 — forked from francoishill/gist:6483997
Media queries for mobile devices - Requires at least requires the meta viewport tag with content 'width=device-width'
/*http://i-skool.co.uk/mobile-development/web-design-for-mobiles-and-tablets-viewport-sizes/*/
/*At least requires the meta viewport tag with content 'width=device-width'*/
@media only screen and (max-width: 1080px) and (orientation : portrait) {
/* PORTRAIT:
Windows Surface Pro*/
}
@media only screen and (max-width: 800px) and (orientation : portrait) {
/* PORTRAIT:
Acer Iconia Tab A100
@eldorplus
eldorplus / cors-nginx.conf
Created November 12, 2016 16:50 — forked from michiel/cors-nginx.conf
Wide-open CORS config for nginx
#
# Wide-open CORS config for nginx
#
location / {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
#
@eldorplus
eldorplus / cdn.conf
Created November 12, 2016 16:50 — forked from tx2z/cdn.conf
Configure subdomain as "CDN" in NGINX (+ Wordpress & W3 Total Cache configuration) - http://jesus.perezpaz.es/2014/02/configure-subdomain-as-cdn-in-nginx-wordpress-w3-total-cache-configurations
# -------------------------------------------------
# CDN CONFIGURATION
# -------------------------------------------------
# Show "Not Found" 404 errors in place of other NGINX errors
error_page 403 /404;
error_page 404 /404;
error_page 405 /404;
error_page 500 501 502 503 504 /404;
location /404 {
@eldorplus
eldorplus / vagrant-box-update-all.sh
Created January 15, 2017 05:02 — forked from thom8/vagrant-box-update-all.sh
Update all your vagrant base boxes
#!/bin/bash
# Find all boxes which have updates
AVAILABLE_UPDATES=`vagrant box outdated --global | grep outdated | tr -d "*'" | cut -d ' ' -f 2`
if [ ! ${#AVAILABLE_UPDATES[@]} -eq 0 ]; then
for box in $AVAILABLE_UPDATES ; do
echo "Found an update for $box"
@eldorplus
eldorplus / Mock.spec
Created March 28, 2017 23:20 — forked from tbuschto/Mock.spec
Examples for using mocks in Jasmine Tests
describe( "Mock examples:", function() {
var version = jasmine.version_ ? jasmine.version_.major : parseInt( jasmine.version, 10 );
var spyName = function( spy ) {
if( version === 1 ) {
return spy.identity;
} else {
return spy.and.identity()
}
@eldorplus
eldorplus / colors.xml
Created August 12, 2017 18:56 — forked from mpost/colors.xml
This gist demonstrates how to create an animated pause/resume media playback button for Android. It uses animated vector drawables and state transitions to orchestrate the effect. Some background: https://plus.google.com/u/0/+MoritzPost/posts/3EFF8uC7jXv
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="action_pause">#FF8F00</color>
<color name="action_resume">#43A047</color>
</resources>
@eldorplus
eldorplus / lxc-lamp.sh
Created September 26, 2017 21:53 — forked from ralt/lxc-lamp.sh
LAMP template for lxc
#!/bin/bash
# Fork of lxc-debian
# Highly opinionated. Updates libvirt's default network.
# The --ip argument is the last number of the IP
# The --mac argument is the last number of the MAC
# Detect use under userns (unsupported)
for arg in "$@"; do
[ "$arg" = "--" ] && break