Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
That worked!

Dominik dommmel

💭
That worked!
View GitHub Profile
@dommmel
dommmel / import_into_couchdb.sh
Created Dec 16, 2011
import json files into mongo/couch
View import_into_couchdb.sh
#!/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 Sep 18, 2012
Localize your greeting message with javascript
View localize_greeting.coffee
##################################################################
# #
# 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 Nov 5, 2019
craftcms preview with nextjs graphql apollo-client
View apollo.js
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'
View juggernaut_heroku.md

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