Skip to content

Instantly share code, notes, and snippets.

@WanderGink
WanderGink / HeaderAttribute.cs
Created December 2, 2021 15:36 — forked from CreatureSurvive/HeaderAttribute.cs
Better inspector headers in Unity
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
#endif
//using CS;
//[System.Serializable]
//public class HeaderExampleClass
//{
// [Header("My Fields", 3)]

SQL to MongoDB Mapping Chart

SQL to MongoDB Mapping Chart

In addition to the charts that follow, you might want to consider the Frequently Asked Questions section for a selection of common questions about MongoDB.

Executables

The following table presents the MySQL/Oracle executables and the corresponding MongoDB executables.

@WanderGink
WanderGink / how-to-install-latest-gcc-on-ubuntu-lts.txt
Created September 27, 2017 12:05 — forked from application2000/how-to-install-latest-gcc-on-ubuntu-lts.txt
How to install latest gcc on Ubuntu LTS (12.04, 14.04, 16.04)
These commands are based on a askubuntu answer http://askubuntu.com/a/581497
To install gcc-6 (gcc-6.1.1), I had to do more stuff as shown below.
USE THOSE COMMANDS AT YOUR OWN RISK. I SHALL NOT BE RESPONSIBLE FOR ANYTHING.
ABSOLUTELY NO WARRANTY.
If you are still reading let's carry on with the code.
sudo apt-get update && \
sudo apt-get install build-essential software-properties-common -y && \
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
@WanderGink
WanderGink / uniqueId.adoc
Created April 10, 2017 04:39 — forked from tekiegirl/uniqueId.adoc
Using the graph to control unique id generation.

Using the graph to control unique id generation

Introduction

This gist was prompted by Nigel Small’s tweet of a query to generate a unique id for a node (and is posted here with his agreement). It inspired me to think about how it could be used in a full example, unrestricted by Twitter’s 140 characters. I have also looked at how we could generate different sets of unique ids for different labels.

Auto-incrementing #Neo4j counter MERGE (x:Counter {name:'foo'}) ON CREATE SET x.count = 0 ON MATCH SET x.count = x.count + 1 RETURN x.count

— Nigel Small (@technige) December 16, 2013
@WanderGink
WanderGink / postgres-cheatsheet.md
Created March 12, 2017 09:04 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

If run with -E flag, it will describe the underlaying queries of the \ commands (cool for learning!).

Most \d commands support additional param of __schema__.name__ and accept wildcards like *.*

@WanderGink
WanderGink / ActiveRecord Cheat Sheet v1
Created March 4, 2017 10:51 — forked from jessieay/ActiveRecord Cheat Sheet v1
Active Record cheat sheet with examples of queries I've needed most so far
ActiveRecord cheat sheet / EXAMPLES
INSTALL
=======
$ gem install activerecord
in GEMFILE: gem ‘activerecord’
REQUIRE
=======
require ‘active_record’
@WanderGink
WanderGink / gist:d7e146ebbc610f365927a87eb01a75d4
Created February 25, 2017 08:25 — forked from cheerfulstoic/gist:3142ed2e15ad08ef6631
Script for "Neo4j.rb Screencast #1 - Create a Neo4j Rails Application"

Welcome to the first episode in a series of short screencasts for the Ruby neo4j gem. Each episode will describe a different aspect of the gem. In this first episode, we will start by discussing how to set up a new Ruby on Rails app using Neo4j. The neo4j gem is not Rails specific so you can use other frameworks like Sinatra or Lotus, but because of the popularity of Ruby on Rails we will be using it for this screencast series.

In this series we’re going to create an application to host digital assets which we’ll call "asset_portal". To create your Rails app you can run a rails new command as usual. To use Neo4j instead of ActiveRecord you can give arguments which will set up a new Rails app using Neo4j models.

rails new asset_portal -m http://neo4jrb.io/neo4j/neo4j.rb -O

The dash-m argument runs a script from the neo4j gem project and the dash-capital-O argument says to exclude ActiveRecord. There aren’t any restrictions on using Neo4j with other ORMs like ActiveRecord, but you will need to conf

@WanderGink
WanderGink / web-fonts-asset-pipeline.md
Created February 14, 2017 11:47 — forked from anotheruiguy/web-fonts-asset-pipeline.md
Custom Web Fonts and the Rails Asset Pipeline

Web fonts are pretty much all the rage. Using a CDN for font libraries, like TypeKit or Google Fonts, will be a great solution for many projects. For others, this is not an option. Especially when you are creating a custom icon library for your project.

Rails and the asset pipeline are great tools, but Rails has yet to get caught up in the custom web font craze.

As with all things Rails, there is more then one way to skin this cat. There is the recommended way, and then there are the other ways.

The recommended way

Here I will show how to update your Rails project so that you can use the asset pipeline appropriately and resource your files using the common Rails convention.

@WanderGink
WanderGink / Rake Database.md
Created January 7, 2017 14:45 — forked from stevenyap/Rake Database.md
List of rake commands to manage database

Create database

rake db:create

Create database table

This will creates a migration file in /db/migrate without table definition.

rails g migration create_<TABLE>
@WanderGink
WanderGink / zsh.md
Created December 22, 2016 07:49 — forked from tsabat/zsh.md
Getting oh-my-zsh to work in Ubuntu