Skip to content

Instantly share code, notes, and snippets.

View grampelberg's full-sized avatar

Thomas Rampelberg grampelberg

View GitHub Profile
var articles = document.getElementsByTagName('article');
for (var i in articles) {
articles[i].appendChild();
}
(function() {
module.exports.foo = function() {};
module.exports.bar = "asdf";
module.exports.baz = 1;
module.exports.oof = {
a: function() { }
}
})();
;;; starter-kit-js.el --- Some helpful Javascript helpers
;;
;; Part of the Emacs Starter Kit
(autoload 'espresso-mode "espresso" "Start espresso-mode" t)
(add-to-list 'auto-mode-alist '("\\.js$" . espresso-mode))
(add-to-list 'auto-mode-alist '("\\.json$" . espresso-mode))
(add-hook 'espresso-mode-hook 'moz-minor-mode)
;; (add-hook 'espresso-mode-hook 'esk-paredit-nonlisp)
(add-hook 'espresso-mode-hook 'run-coding-hook)
@grampelberg
grampelberg / gist:940845
Created April 25, 2011 17:15
Nginx couchdb filter
server {
listen 80;
server_name foo.saunter.org;
location /mydb/_changes {
if ($arg_filter !~ 'mydb/myfilter') {
return 404;
}
proxy_buffering off;
proxy_set_header X-Real-IP $remote_addr;
Provider -----
action :install do
git "/opt/tumult/src" do
repository "[email protected]:pyronicide/foo.git"
revision "#{node["branch"]}"
ssh_wrapper "/opt/glue/bin/deploy_user.sh"
depth 5
action :sync
end
repo_sync = Chef::Resource::Git.new(new_resource.path, run_context)
repo_sync.repository( new_resource.repository )
repo_sync.revision( new_resource.revision )
repo_sync.ssh_wrapper( "/opt/glue/bin/#{new_resource.user}.sh" )
repo_sync.depth( 5 )
repo_sync.run_action(:sync)
@new_resource.updated_by_last_action(true) if repo_sync.updated?
action :install do
git "/opt/tumult/src" do
notifies :parent
end
end
(function($) {
var view_tmpl = "\
<a id='<%= id %>' href='/rules/<%= id %>'><%= title %> (<%= count %>)</a>\
"
var handle_view = function(view) {
$.get("/rules/" + view.id + ".xml", function(resp) {
view.count = $(resp).find("tickets").attr("count");
console.log(_.template(view_tmpl, view));
@grampelberg
grampelberg / html.html
Created December 8, 2012 00:18
Widget
<div id="view_links">
-- <a href="http://support.mybasis.com/rules/28017138">All Open Issues</a><br>
<br>
-- <a href="http://support.mybasis.com/rules/32271828">My Open Issues</a><br>
<br>
-- <a href="http://support.mybasis.com/rules/32220346">VIP</a><br>
<br>
-- <a href="http://support.mybasis.com/rules/28479406">Uncategorized </a><br>
<br>
-- <a href="http://support.mybasis.com/rules/24698416">Known Issues Reference</a><br>
@grampelberg
grampelberg / gist:4601476
Created January 23, 2013 02:59
No more proxy for me zendesk!
(function() {
var scope = {};
with(scope) {
return {
events: {
'app.activated':'doSomething',
'click header': 'check'