Skip to content

Instantly share code, notes, and snippets.

@ideadapt
ideadapt / gist:1611420
Created January 14, 2012 13:29
no more google adwords in gmail
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document domain("mail.google.com") {
.mq table{ display: none; }
.nH.adC>.nH>.nH{ display: none; }
.nH.PS>.Zs{ display: none; }
}
@ideadapt
ideadapt / standar_layout.htm.twig
Created January 17, 2012 13:40
trying to extend the sonataadminbundle standard layout in my own bundle
{% extends 'SonataAdminBundle::standard_layout.html.twig' %}
{% block footer %}
{{ tinymce_init() }}
{% endblock %}
@ideadapt
ideadapt / my_standard_layout.html.twig
Created January 17, 2012 14:48
extending the sonataadminbundle standard layout
{% extends 'SonataAdminBundle::my_standard_layout.html.twig' %}
{% block footer %}
{{ tinymce_init() }}
{% endblock %}
@ideadapt
ideadapt / formmapper_snippet.php
Created January 17, 2012 14:50
add tinymce to form field in symfony2
$formMapper
->with('General')
->add('title')
->add('blog', 'textarea', array('attr' => array('class' => 'tinymce', 'tinymce'=>'{"theme":"simple"}')))
@ideadapt
ideadapt / config.yml
Created January 17, 2012 14:52
customize sonataadminbundle using the config.yml
sonata_admin:
templates:
layout: SonataAdminBundle::my_standard_layout.html.twig
set theStartingValue to "6710" -- this is the year to get data for
set theEndingValue to "7777" -- this is now the beginning date
set outputFolder to POSIX path of (choose folder) -- the folder to save the output files to
repeat with theIncrementValue from theStartingValue to theEndingValue by 1
set theURL to "http://polentajam.ch/Bildergallerie/galleries/PJam10-2012/IMG_" & theIncrementValue & ".jpg"
@ideadapt
ideadapt / capistrano deploy:update_code git error
Last active December 18, 2015 14:18
capistrano deploy:update_code git error
# sometims capistranos fails executing update_code goal:
* 2013-06-17 08:08:34 executing `deploy:update_code'
executing locally: "git ls-remote . HEAD"
command finished in 9ms
* refreshing local cache to revision f4db at /var/folders/nc/pl0c_dnd43bb6xl5ljdfh5zh0012gn/T/proj
executing locally: cd /var/folders/nc/pl0c_dnd43bb6xl5ljdfh5zh0012gn/T/proj && git fetch -q origin && git fetch --tags -q origin && git reset -q --hard f4db8ab10f23ddd2864ebfeee7486bdf3bd8e423 && git clean -q -d -x -f
fatal: Not a git repository (or any of the parent directories): .git
# to reset your local cache folder execute following commands:
rm -rf /var/folders/*
@ideadapt
ideadapt / gist:5845347
Last active December 18, 2015 21:09
coffeescript class, instance (variables/methods) and this context issues.
class Animal
@classVar = 'class var'
constructor: (@options) ->
@memberVar = 'the member'
_privateMethod: (param) ->
console.log('private instance method ' + param)
instanceMethod: ->
Index: lib/rails_admin/adapters/active_record.rb
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP
<+>require 'active_record'\nrequire 'rails_admin/adapters/active_record/abstract_object'\n\nmodule RailsAdmin\n module Adapters\n module ActiveRecord\n DISABLED_COLUMN_TYPES = [:tsvector, :blob, :binary, :spatial, :hstore, :geometry]\n DISABLED_COLUMN_MATCHERS = [/_array$/]\n\n def new(params = {})\n AbstractObject.new(model.new(params))\n end\n\n def get(id)\n if object = model.where(primary_key => id).first\n AbstractObject.new object\n end\n end\n\n def scoped\n model.all\n end\n\n def first(options = {}, scope = nil)\n all(options, scope).first\n end\n\n def all(options = {}, scope = nil)\n scope ||= self.scoped\n scope = scope.includes(options[:include]) if options[:include]\n
@ideadapt
ideadapt / install-osquery-osx
Last active August 29, 2015 14:08
Install Facebook OSQuery on OSX Mavericks
# prerequisites: python, git, brew, cmake
git clone --resursive https://github.com/facebook/osquery.git
cd osquery
sudo easy_install pip
brew install doxygen
make deps
make
chmod -R o+w build/darwin // if make fails with permission error
sudo make install