Skip to content

Instantly share code, notes, and snippets.

View JosefJezek's full-sized avatar

Josef Ježek JosefJezek

  • Heart of Europe
View GitHub Profile
@datenimperator
datenimperator / README.md
Last active September 7, 2016 09:47
Temporary fix for Gitlab sockets not working inside a LXC container on Proxmox 4.1

This is a temporary fix for a problem running Gitlab on Proxmox 4.1 inside a LXC container. Symptom: UNIX sockets created inside containers get wrong permissions. This seems to be related to AppArmor and the Debian kernel used by Proxmox. See this thread on the Proxmox forum for details.

Run apt-get install inotify-tools if you haven't installed inotifywait yet.

Place the first file in /usr/local/sbin/fix_gitlab.sh and make it executable: chmod 755 /usr/local/sbin/fix_gitlab.sh. Edit etc/rc.local to include it during boot.

@leifoolsen
leifoolsen / polymer-1.0-create-custom-element.md
Last active March 9, 2018 19:53
Polymer 1.0 : Custom elements

Polymer 1.0 : Custom elements

Simplest possible workflow

Minimal steps required to create a custom elemenet in Polymer 1.0, without any aid from tools like Yeoman and Gulp.

I have used the Quick tour of Polymer as a reference.

Prerequisites

@thetrickster
thetrickster / Remove Open Sans from Wordpress 3.8 .md
Last active March 8, 2022 12:26
Remove Open Sans from Wordpress >= 3.8 front-end

The reason you might not be able to remove the Open Sans font that Wordpress >= 3.8 adds to the frontend is that quite a few WP styles and scripts list 'open-sans' as a dependancy when being registered and enqueued. When you remove the 'open-sans' style the other plugins dependant on it will not load. So you just need to deregister WP's open sans style and register your own, with a false value for the src like below.

Credit to seventhsteel from http://wordpress.org/support/topic/turning-off-open-sans-for-the-38-dashboard

@WilHall
WilHall / PlunkerInstallationGuide.md
Last active March 19, 2024 07:50
Plunker Installation Guide
var SHAKE_THRESHOLD = xxx;
var last_update = 0;
var x, y, z, last_x, last_y, last_z;
function deviceMotionHandler(eventData) {
var acceleration =eventData.accelerationIncludingGravity;
var curTime = newDate().getTime();
if ((curTime - lastUpdate)> 100) {
@ProLoser
ProLoser / AngularJS-Cachebusting.js
Last active September 10, 2020 12:54
Elegant cache-busting for AngularJS HTML assets
anglar.module('myApp',['ui']).config(["$provide", function($provide) {
return $provide.decorator("$http", ["$delegate", function($delegate) {
var get = $delegate.get;
$delegate.get = function(url, config) {
// Check is to avoid breaking AngularUI ui-bootstrap-tpls.js: "template/accordion/accordion-group.html"
if (!~url.indexOf('template/')) {
// Append ?v=[cacheBustVersion] to url
url += (url.indexOf("?") === -1 ? "?" : "&");
url += "v=" + cacheBustVersion;
}
@thmsobrmlr
thmsobrmlr / restful_curl.sh
Created July 10, 2013 10:08
RESTFul Request with Curl.
# Set request method:
curl -X DELETE http://localhost:3000/books/1
# Set request parameters:
curl -d "book[title]=Test" -d "book[copyright]=1998" http://localhost:3000/books
# Set header:
curl -H "Accept: text/xml" http://localhost:3000/books/sections/1
@bsdlp
bsdlp / gist:5964937
Created July 10, 2013 09:42
owncloud nginx config
server {
listen 80;
server_name cloud.sjchen.net;
return 301 https://$server_name$request_uri; # enforce https
}
server {
server_name cloud.sjchen.net;
root /srv/owncloud;
@makotot
makotot / Gruntfile.js
Last active December 19, 2015 13:49
grunt-contrib-watchでlivereload
module.exports = function (grunt) {
'use strict';
// grunt-contrib-watchのlivereloadオプションでlivereload
grunt.initConfig({
watch: {
html: {
files: '**/*.html',
tasks: [],
@cluther
cluther / snmpindex_dct.py
Created March 7, 2013 18:11
snmpindex_dct example usage
from Products.DataCollector.plugins.CollectorPlugin import SnmpPlugin
from Products.DataCollector.plugins.CollectorPlugin import GetTableMap
class MyPlugin(SnmpPlugin):
relname = 'myrelation'
modname = 'ZenPacks.example.MyStuff'
snmpGetTableMaps = (
GetTableMap('sometable',