Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Ryan Collins RyanCCollins

🎯
Focusing
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am ryanccollins on github.
  • I am rcc_hpe (https://keybase.io/rcc_hpe) on keybase.
  • I have a public key ASBBVTJE18ko6qa6ET0yDAzk9KMf1bnjIBWHikCUIaaeZQo

To claim this, I am signing this object:

View proxima-nova.css
@font-face {
font-family: "Proxima Nova";
src: url(data:font/opentype;base64,d09GRgABAAAAAEywABIAAAAAg3QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABEWU5BAAAGbAAAALgAAAGJNI0oHkZGVE0AAAGUAAAAHAAAABxdnq2WR0RFRgAAByQAAAA4AAAAQgSqBTxHUE9TAAAHXAAABCIAABH0zI0AF09TLzIAAAXUAAAAVwAAAGCAz3p9Y21hcAAASvgAAAG2AAAC5lCJVL9jdnQgAAABsAAAAB4AAAAeCkcLCmZwZ20AAAHQAAABsgAAAmUjtC+nZ2FzcAAAA4QAAAAIAAAACAAAABBnbHlmAAALgAAAO4sAAF8I3FzIU2hlYWQAAAOMAAAANQAAADb9TDtqaGhlYQAABiwAAAAgAAAAJA9PBsBobXR4AABHDAAAAh8AAANsqw8hfGxvY2EAAEksAAABuAAAAbhtqYQ8bWF4cAAABkwAAAAgAAAAIAIDAhpuYW1lAAADxAAAAawAAANRLIw+gnBvc3QAAErkAAAAEwAAACD/DQAocHJlcAAABXAAAABjAAAAdNUcAaMAAAABAAAAAMmJbzEAAAAAyRrF1wAAAADK+niN/pAAAAPGBTYBYADCANABNgE+AWgBmQDkAZIBkAFYAAB42l1Ru05bQRDdDQ+TBBJjg+RoU8xmQhrvhYYCJBBXF8XIdmM5QtqNXORiXMAHUCBRg/ZrBmgoKdKmQcgFUj6BT0BiZk2iKM3Ozuycc+bMknKk6l1a73nqnARSuNOg2abfDql2FuCedH21kZF28EDzzYxeuW7ff8VgM5pyRw2gvOct5SGjaSdQi/bU/za/guE+/2Qeg0FLM01PrZOQHkJgvhm3MPie0ay7/KQvWB0uBgNDimkq7vJzKuV/S3Outgibaxm9dnAmIj+ZBmhqpY1A0186pHo+jmIJctkw1gYTU9afZCL4ZjJd1VQtM751cJfszDt
@RyanCCollins
RyanCCollins / condaenv.txt
Created Dec 24, 2018 — forked from pratos/condaenv.txt
To package a conda environment (Requirement.txt and virtual environment)
View condaenv.txt
# For Windows users# Note: <> denotes changes to be made
#Create a conda environment
conda create --name <environment-name> python=<version:2.7/3.5>
#To create a requirements.txt file:
conda list #Gives you list of packages used for the environment
conda list -e > requirements.txt #Save all the info about packages to your folder
@RyanCCollins
RyanCCollins / student.py
Created Dec 15, 2018
Just a code example
View student.py
class Student:
def __init__(self, name, student_id=332):
self.name = name
self.student_id = student_id
def __str__(self):
return "Student: " + self.name
def get_name_capitalized(self):
return self.name.capitalize()
@RyanCCollins
RyanCCollins / emoji_slots.js
Last active Sep 16, 2017
Having some fun on webpackbin
View emoji_slots.js
// From https://www.webpackbin.com/bins/-Ku7fYF911w0Y-YUxqVa
import React from 'react'
import { compose, lifecycle, withHandlers, withState, withProps } from 'recompose'
import styled, { css } from 'styled-components'
import { range, sample } from 'lodash'
const Screen = styled.main`
height: 200vh;
`
@RyanCCollins
RyanCCollins / gist:7ca4062a270514d8d2080633a066e60b
Last active Sep 14, 2017
Translate react-desc types to typescript definitions
View gist:7ca4062a270514d8d2080633a066e60b
// Start of a utility for translating react-desc types to TypeScript definitions
// https://www.webpackbin.com/bins/-Ktxj9FtGKCYnA9o_C1_
import * as fp from 'lodash/fp';
const PropTypes = {
string: 'string',
func: 'Function',
oneOf: x => x.join('" | "'),
shape: x => JSON.stringify(x),
oneOfType: x => x.join(' | '),
View keys.js
// this is no good because other lists in your app could have the same index
{items.map((item, index) =>
<div key={index}>
// ...
</div>
)}
// This is much better since it will most likely be unique
{items.map((item, index) =>
<div key={`${item.title}-${index}`}>
View currying.swift
func curried(_ f: @escaping (_: Int, _: Int) -> Int) -> (_: Int) -> (_: Int) -> Int {
return { a in { b in f(a, b) }}
}
View iife.js
function IconPicker({ type }) {
<div>
{(() => {
switch(type) {
case 'Foo':
return <Foo />;
case 'Bar':
return <Bar />;
}
})()}
@RyanCCollins
RyanCCollins / object-destructuring.js
Created Jun 27, 2017
Object destructuring example:
View object-destructuring.js
// Using object de-structuring
// See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment
const albumSalesStrings = musicData.map(
({ album, artist, sales }) => `${album} by ${artist} sold ${sales} copies`
);