Skip to content

Instantly share code, notes, and snippets.

View attilagyorffy's full-sized avatar
🦜
A UDP packet bar walks a into...

Attila Györffy attilagyorffy

🦜
A UDP packet bar walks a into...
View GitHub Profile
@attilagyorffy
attilagyorffy / Step 1: Patching qt5-formula-el-capitan.diff
Last active August 28, 2015 09:33
Patches to successfully build Qt5 on OS X 10.11 El Capitan until official support from Homebrew
diff --git a/Library/Formula/qt5.rb b/Library/Formula/qt5.rb
index ff54df3..62010ae 100644
--- a/Library/Formula/qt5.rb
+++ b/Library/Formula/qt5.rb
@@ -14,7 +14,7 @@ end
class Qt5 < Formula
desc "Version 5 of the Qt framework"
homepage "https://www.qt.io/"
- head "https://code.qt.io/qt/qt5.git", :branch => "5.5", :shallow => false
+ head "https://code.qt.io/qt/qt5.git", :branch => "dev", :shallow => false
@attilagyorffy
attilagyorffy / gist:5f19a5f91732ddcf6787
Created January 22, 2016 01:32
How to parse man pages on FreeBSD by fish shell
$ python2.7 /usr/local/share/fish/tools/create_manpage_completions.py --manpath --progress --cleanup-in '~/.config/fish/completions' --cleanup-in '~/.config/fish/generated_completions'
@attilagyorffy
attilagyorffy / custom-livereload-injection.html.erb
Last active January 27, 2016 10:31
LiveReload using Rails 4
<% if Rails.env.development? %>
<script>document.write('<script src="http://' + (location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1"></' + 'script>')</script>
<% end %>
@attilagyorffy
attilagyorffy / be_valid_asset.rb
Last active January 24, 2016 12:24
Configuring BeValidAsset to use a local HTML5 validator
# in spec/support/be_valid_asset.rb
BeValidAsset::Configuration.markup_validator_host = 'http://192.168.99.100:32770'
@attilagyorffy
attilagyorffy / REWIREMIN
Last active July 3, 2016 18:02
Latest working FreeBSD kernel on Vultr
# /usr/src/sys/amd64/conf/REWIREMIN
ident GENERIC
cpu HAMMER
makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols
makeoptions WITH_CTF=1 # Run ctfconvert(1) for DTrace support
device acpi
device adv # Advansys SCSI adapters
@attilagyorffy
attilagyorffy / gist:d80e03c7089bc03530e6
Created February 18, 2016 11:42
Docker container total memory consumption
$ for line in `docker ps | awk '{print $1}' | grep -v CONTAINER`; do docker ps | grep $line | awk '{printf $NF" "}' && echo $(( `cat /sys/fs/cgroup/memory/docker/$line*/memory.usage_in_bytes` / 1024 / 1024 ))MB ; done
services_gitlab_1 912MB
services_redis_1 14MB
services_postgresql_1 58MB
services_ghost_1 165MB
@attilagyorffy
attilagyorffy / Vagrantfile
Last active March 19, 2016 12:46
Server provisioning in Vagrant using Rails' secrets
require 'yaml'
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.network "forwarded_port", guest: 80, host: 8080
# Parse secrets from Rails' config file (ignored in the repo)
secrets_file = File.expand_path(File.join(File.dirname(__FILE__), 'config', 'secrets.yml'))
secrets = YAML::load_file secrets_file
@attilagyorffy
attilagyorffy / config.fish
Last active March 16, 2016 22:57
Systemwide rbenv initialisation for fish shell
# Add these to /usr/share/fish/config.fish
# System-wide rbenv support for fish
if test -f /usr/local/rbenv/bin/rbenv
set -gx RBENV_ROOT /usr/local/rbenv
if not contains /usr/local/rbenv/bin $PATH
set PATH $PATH /usr/local/rbenv/bin
end
. (rbenv init - | psub)
end
@attilagyorffy
attilagyorffy / .npmrc
Created June 5, 2016 14:20
My npm configuration
progress=false
spin=false
loglevel=error
init.author.name=Attila Györffy
init.author.email=attila@does.not.share.his.email.com
init.author.url=https://attilagyorffy.com
//registry.npmjs.org/:_password=thisissecret
//registry.npmjs.org/:username=attilagyorffy
//registry.npmjs.org/:email=attila@does.not.share.his.email.com
//registry.npmjs.org/:always-auth=true
@attilagyorffy
attilagyorffy / external_jquery_using_sri.html
Created June 5, 2016 18:58
Load external jQuery using Subresource Integrity for better security
<!-- Referencing jQuery using SRI: -->
<script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha384-rY/jv8mMhqDabXSo+UCggqKtdmBfd3qC2/KvyTDNQ6PcUJXaxK1tMepoQda4g5vB" crossorigin="anonymous"></script>
<!--
- But Attila, you say SRI. What the hell is that?
- Good Question! SRI stands for Subresource Integrity. It's a new way of telling your browser to
verify the checksum of the file you reference from a domain that is not under your control.
Pretty much the same way shell scripts and package managers ensure a matching checksum of files
when they are downloaded. It's the same idea, except in the context of web browser security.