Skip to content

Instantly share code, notes, and snippets.

View pajtai's full-sized avatar

Peter Ajtai pajtai

  • https://www.soliddigital.com/
  • Portland, Oregon
View GitHub Profile

1️⃣

🐦🍐🌳

2️⃣

🐢🐦 🐢🐦

🐦🍐🌳

@cowboy
cowboy / deps.js
Created March 1, 2013 19:52
Grunt: Test that package.json dependencies were installed correctly.
grunt.registerTask('deps', 'Test that package.json dependencies were installed correctly.', function() {
var pkg = grunt.file.readJSON('package.json');
var total = 0;
['dependencies', 'devDependencies'].forEach(function(key) {
var deps = pkg[key];
if (!deps) { return; }
grunt.verbose.subhead(key);
Object.keys(deps).forEach(function(name) {
total++;
@mshwery
mshwery / app.js
Last active January 22, 2018 21:41
Gulp + Browserify + requiring .html templates + Knockout web components
var ko = require('knockout');
ko.components.register('simple-name', require('./components/simple-name/simple-name.js'));
ko.applyBindings({ userName: ko.observable() });
@nodesocket
nodesocket / kibana
Created July 7, 2013 01:49
Kibana init.d service script.
#!/bin/bash
### BEGIN INIT INFO
# Provides: kibana
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Make sense of a mountain of logs.
### END INIT INFO
@drewwells
drewwells / core.test.js
Created April 14, 2011 20:21
RequireJS and QUnit sitting in a tree
//Wait for relevant code bits to load before starting any tests
define(['core.js'], function( core ) {
module("Core Tests");
test("Test core methods", function(){
expect(2);
equals( 1, 1, "A trivial test");
ok( true, "Another trivial test");
});
@flatanimals
flatanimals / nginx.conf
Created January 13, 2015 14:56
Nginx server config for Laravel 4 and SimpleSamlphp
#
# Nginx host conf
#
# Allows Laravel 4 and SimpleSamlphp to exist together peacefully
#
# Laravel 4 -
# https://github.com/laravel/laravel
# SimpleSamlphp -
# https://github.com/simplesamlphp/simplesamlphp
#
@Holek
Holek / bash-autocomplete-script
Created November 25, 2011 09:16
Git autocomplete for bash on a Mac script
curl https://raw.github.com/git/git/master/contrib/completion/git-completion.bash -o ~/.git-completion.bash
echo "source ~/.git-completion.bash" >> ~/.bash_profile
@rmoff
rmoff / gist:379e6ce46eb128110f38
Last active August 14, 2020 18:39
Kibana 3 and Elasticsearch 1.4 - CORS problem

Kibana 3 against ElasticSearch 1.4 throws an Connection Failed screen. The error text says to set http.cors.allow-origin, but it misses out the important http.cors.enabled: true

Working config:

$ grep cors elasticsearch-1.4.0.Beta1/config/elasticsearch.yml
http.cors.allow-origin: "/.*/"
http.cors.enabled: true
@cibulka
cibulka / Wordpress: Remove hwstring from images (and keep srcset)
Last active August 31, 2020 18:34
Hardcoded `width` and `height` to Wordpress image functions is INSANE! This is my current sollution to the problem, that removes `hwstring` and keeps `srcset`, `sizes` and other responsive image attributes.
<?php
class Picture {
public function init_remove_hwstring() {
add_filter('image_downsize', array($this, 'remove_hw_from_downsize'), 10, 3);
add_filter('wp_get_attachment_image_attributes', array($this, 'add_srcset_sizes'), 10, 3);
}
public function add_srcset_sizes($attrs, $attachment, $size) {
@PGBI
PGBI / .profile
Last active November 25, 2020 20:43
`vagrant halt all` command to halt all running vagrant VMs
# To be pasted in ~/.profile
vagrant() {
if [[ $@ == "halt all" ]]; then
command vagrant global-status | grep running | colrm 8 | xargs -L 1 -t vagrant halt
else
command vagrant "$@"
fi
}