Skip to content

Instantly share code, notes, and snippets.

View DawnPaladin's full-sized avatar

James Harris DawnPaladin

View GitHub Profile
#atom-perspective() {
@viewing-distance: 12in;
@rotation: 20deg;
.tree-view-scroller {
transform: translateY(-10vh) perspective(@viewing-distance) rotateY(@rotation);
padding-top: 12vh;
padding-bottom: 12vh;
transform-origin: left;
@arjunvenkat
arjunvenkat / gist:1115bc41bf395a162084
Last active January 12, 2024 05:04
Seeding a Rails database with a CSV file

How to seed a Rails database with a CSV file

1. Setup

First, Create a folder inside of lib called seeds

Put your CSV file example.csv into the lib/seeds folder. In the example below, the file is called real_estate_transactions.csv

Make sure you've created a resource with the appropriate columns to match your seed data. The names don't have to match up.

@DawnPaladin
DawnPaladin / .gitignore
Created January 28, 2015 20:32
Personal gitignore file
Thumbs.db
*.sublime-workspace
AdobeFnt16.lst
*.idlk
dwsync.xml
node_modules/
@msrose
msrose / combining-git-repositories.md
Last active October 5, 2024 10:03
How to combine two git repositories.

Combining two git repositories

Use case: You have repository A with remote location rA, and repository B (which may or may not have remote location rB). You want to do one of two things:

  • preserve all commits of both repositories, but replace everything from A with the contents of B, and use rA as your remote location
  • actually combine the two repositories, as if they are two branches that you want to merge, using rA as the remote location

NB: Check out git subtree/git submodule and this Stack Overflow question before going through the steps below. This gist is just a record of how I solved this problem on my own one day.

Before starting, make sure your local and remote repositories are up-to-date with all changes you need. The following steps use the general idea of changing the remote origin and renaming the local master branch of one of the repos in order to combine the two master branches.

@gefangenimnetz
gefangenimnetz / materialDesignShadowHelper.less
Last active December 17, 2022 17:21
Less css box-shadow helper for cards & modals according to Googles Material Design spec.
/**
* A mixin which helps you to add depth to elements according to the Google Material Design spec:
* http://www.google.com/design/spec/layout/layout-principles.html#layout-principles-dimensionality
*
* Please note that the values given in the specification cannot be used as is. To create the same visual experience
* the blur parameter has to be doubled.
*
* Author: Florian Kutschera (@gefangenimnetz), Conceptboard GmbH (@conceptboardapp)
*
* Example usage:
@zhusee2
zhusee2 / jquery-deferred-example.js
Created April 26, 2013 15:13
An example for how you might possibly use jQuery Deferred Object.
function doHeavyWork() {
var deferred = $.Deferred(),
meaningOfLife = new Array();
setTimeout(function() {
for (var i = 0; i < 65536; i++) {
meaningOfLife[i] = new Array();
for (var j = 0; j < 65536; j++) {
meaningOfLife[i][j] = new Array();
for (var k = 0; k < 65536; k++) {
@mshafrir
mshafrir / states_hash.json
Created May 9, 2012 17:05
US states in JSON form
{
"AL": "Alabama",
"AK": "Alaska",
"AS": "American Samoa",
"AZ": "Arizona",
"AR": "Arkansas",
"CA": "California",
"CO": "Colorado",
"CT": "Connecticut",
"DE": "Delaware",
@gre
gre / easing.js
Last active October 6, 2024 13:14
Simple Easing Functions in Javascript - see https://github.com/gre/bezier-easing
/*
* This work is free. You can redistribute it and/or modify it under the
* terms of the Do What The Fuck You Want To Public License, Version 2,
* as published by Sam Hocevar. See the COPYING file for more details.
*/
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {