Skip to content

Instantly share code, notes, and snippets.

View dommmel's full-sized avatar
💭
That worked!

Dominik dommmel

💭
That worked!
View GitHub Profile
@dommmel
dommmel / import_into_couchdb.sh
Created December 16, 2011 10:07
import json files into mongo/couch
#!/bin/bash
COUCH_DB="http://127.0.0.1:5984/what_ever"
JSON_FOLDER="./jsonFiles/*"
TMP_FILE="/tmp/_couchdb_import.json"
for file in $JSON_FOLDER
do
echo '{"docs":' > $TMP_FILE
cat $file >> $TMP_FILE
@dommmel
dommmel / localize_greeting.coffee
Created September 18, 2012 13:43
Localize your greeting message with javascript
##################################################################
# #
# Copyright (C) 2012 Dommmel <dommmel@gmail.com> #
# This code is released under WTFPL, version 2.0. #
# #
##################################################################
# Usage:
# <span id="sayhi">привет</span>
# <script>
@toyflish
toyflish / apollo.js
Created November 5, 2019 11:54
craftcms preview with nextjs graphql apollo-client
import React from 'react'
import Head from 'next/head'
import { ApolloProvider } from '@apollo/react-hooks'
import { ApolloClient } from 'apollo-client'
import { InMemoryCache, IntrospectionFragmentMatcher } from 'apollo-cache-inmemory'
import { createHttpLink } from 'apollo-link-http';
import { setContext } from 'apollo-link-context';
import fetch from 'isomorphic-unfetch'
import introspectionQueryResultData from '../fragmentTypes.json'
import querystring from 'querystring'
@maccman
maccman / juggernaut_heroku.md
Created June 2, 2011 01:26
Juggernaut on Heroku

Clone repo:

git clone git://github.com/maccman/juggernaut.git
cd juggernaut

Create Heroku app:

heroku create myapp --stack cedar
heroku addons:add redistogo:nano

git push heroku master

@dommmel
dommmel / blob_authenticatable.rb
Last active July 12, 2023 01:01
Devise authentication for Rails' ActiveStorage
# Rails controller concern to enable Devise authentication for ActiveStorage.
# Put it in +app/controllers/concerns/blob_authenticatable.rb+ and include it when overriding
# +ActiveStorage::BlobsController+ and +ActiveStorage::RepresentationsController+.
#
# Optional configuration:
#
# Set the model that includes devise's database_authenticatable.
# Defaults to Devise.default_scope which defaults to the first
# devise role declared in your routes (usually :user)
#