Skip to content

Instantly share code, notes, and snippets.

@renesugar
renesugar / main.go
Created March 26, 2018 20:04 — forked from erans/main.go
Go Example: Google CloudSQL with CloudSQL Proxy and GORM
package main
import (
"github.com/jinzhu/gorm"
_ "database/sql"
_ "github.com/GoogleCloudPlatform/cloudsql-proxy/proxy/dialers/mysql"
)
// You can read more in this post: http://forecastcloudy.net/2016/06/28/using-google-cloud-sql-from-go-with-gorm-in-google-container-engine-and-google-compute-engine/
func main() {
@renesugar
renesugar / caldav.js
Created March 29, 2018 00:21 — forked from enterstudio/caldav.js
Make CalDAV request to Google Calendar
// Mostly came from https://developers.google.com/google-apps/calendar/quickstart/nodejs
var fs = require('fs');
var readline = require('readline');
var google = require('googleapis');
var googleAuth = require('google-auth-library');
// If modifying these scopes, delete your previously saved credentials
// at ~/.credentials/calendar-nodejs-quickstart.json
var SCOPES = ['https://www.googleapis.com/auth/calendar'];
import React from 'react';
import { Grid, Input, Select } from 'react-spreadsheet-grid';
import set from 'lodash.set';
import users from './users.json';
const positions = [{
id: 1,
name: 'System Architect'
},{
id: 2,
@renesugar
renesugar / GitHub-Forking.md
Created April 4, 2018 01:43 — forked from Chaser324/GitHub-Forking.md
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j

@renesugar
renesugar / FindMYSQL.cmake
Created April 5, 2018 22:32 — forked from RenatoUtsch/FindMYSQL.cmake
Find MySQL with CMake.
# - Try to find MySQL.
# Once done this will define:
# MYSQL_FOUND - If false, do not try to use MySQL.
# MYSQL_INCLUDE_DIRS - Where to find mysql.h, etc.
# MYSQL_LIBRARIES - The libraries to link against.
# MYSQL_VERSION_STRING - Version in a string of MySQL.
#
# Created by RenatoUtsch based on eAthena implementation.
#
# Please note that this module only supports Windows and Linux officially, but
@renesugar
renesugar / valgrind_macos.txt
Created April 10, 2018 20:50
Compiling valgrind on Mac OS 10.13.4 (High Sierra)
Valgrind compile error on Mac OS 10.13.4:
m_syswrap/syswrap-generic.c:1797:26: error: variable has incomplete type 'struct vki_semid64_ds'
struct vki_semid64_ds buf;
^
m_syswrap/syswrap-generic.c:1797:11: note: forward declaration of 'struct vki_semid64_ds'
struct vki_semid64_ds buf;
^
m_syswrap/syswrap-generic.c:1798:8: error: no member named 'buf64' in 'union semun'
arg.buf64 = &buf;
@renesugar
renesugar / git-gpg.md
Created April 18, 2018 19:28 — forked from bcomnes/git-gpg.md
my version of gpg on the mac
  1. brew install gnupg21, pinentry-mac (this includes gpg-agent and pinentry)

  2. Generate a key: $ gpg2 --gen-key

  3. Take the defaults. Whatevs

  4. Tell gpg-agent to use pinentry-mac:

    $ vim ~/.gnupg/gpg-agent.conf 
    
CREATE TEXT SEARCH CONFIGURATION fr ( COPY = french );
ALTER TEXT SEARCH CONFIGURATION fr ALTER MAPPING
FOR hword, hword_part, word WITH unaccent, french_stem;
CREATE TEXT SEARCH CONFIGURATION en ( COPY = english );
ALTER TEXT SEARCH CONFIGURATION en ALTER MAPPING
FOR hword, hword_part, word WITH unaccent, english_stem;
CREATE TEXT SEARCH CONFIGURATION de ( COPY = german );
ALTER TEXT SEARCH CONFIGURATION de ALTER MAPPING
@renesugar
renesugar / toy-bleve-example.go
Created June 1, 2018 20:11 — forked from indraniel/toy-bleve-example.go
This is a toy search example using bleve. It also highlights how to retrieve the orignal input document(s) from the KV store.
package main
// mentioned in bleve google group
// https://groups.google.com/forum/#!topic/bleve/-5Q6W3oBizY
import (
"encoding/json"
"fmt"
"github.com/blevesearch/bleve"
"github.com/blevesearch/bleve/document"
@renesugar
renesugar / truffle-material.md
Created June 8, 2018 20:58 — forked from smarr/truffle-material.md
Truffle: Languages and Material