Skip to content

Instantly share code, notes, and snippets.

View saralilyb's full-sized avatar
🤷‍♀️

Sara Burke saralilyb

🤷‍♀️
View GitHub Profile
import { one, two, pipe } from './utils';
class Main {
public sentence() {
return pipe<string>('word',
addPeriod,
capitalize);
}
}
@anupkrbid
anupkrbid / drawing-board.component.ts
Last active August 29, 2023 15:10
A example canvas component for drawing in an angular 6 app using rxjs 6.
import {
AfterViewInit,
Component,
ElementRef,
Input,
OnDestroy,
ViewChild
} from '@angular/core';
import { fromEvent } from 'rxjs';
import { pairwise, switchMap, takeUntil } from 'rxjs/operators';
@ebidel
ebidel / coverage.js
Last active April 27, 2024 04:13
CSS/JS code coverage during lifecycle of page load
Moved to https://github.com/ebidel/puppeteer-examples
@leeper
leeper / stata_summary.R
Created February 21, 2018 10:53
Stata-style regression summaries
stata_summary <-
function(
x,
...
) {
# summarize
mod <- x
x <- summary(x)
# find outcome variable
@KelseyDH
KelseyDH / service_object.rb
Created January 27, 2018 08:26
How to write a Rails Service Object with logging
# # A Plain Old Ruby Object (poro) with Rails logger support:
class ServiceObject
def initialize(foo)
@logger = Logger.new(STDOUT)
@foo = foo
end
def call
do_something
end

How Clojure's documentation can leapfrog other languages

Summary

I made a documentation generator that cashes in on Clojure's dynamism. See the play-cljs docs (a ClojureScript game library) for an example of its output.

The Problem

Like many of you, I've often wondered what my final regret will be on my deathbed. My best guess came to me in a dream recently. I was walking across the charred earth of an apocalyptic future world, maneuvering around the remains of the less fortunate. I was startled to find a young girl, barely holding onto her life. She murmured something to me. I asked her to repeat it, and she said more loudly: "I...wish your Clojure projects didn't have such crappy documentation."

@robinsloan
robinsloan / shh.rb
Last active August 18, 2023 12:09
Disable RTs from all the people you follow on Twitter.
require "rubygems"
require "twitter"
# get these from apps.twitter.com
CONSUMER_KEY = "foo"
CONSUMER_SECRET = "bar"
OAUTH_TOKEN = "blee"
OAUTH_TOKEN_SECRET = "baz"
TWITTER_USER = "your_username" # needs to be the one associated with keys above
@rechl
rechl / ion-scroll-smooth.js
Last active January 15, 2019 20:24
Scroll an ion-scroll smooth
/**
HTML
<ion-scroll #mapScroll scrollX="true" zoom="true" scrollY="true" >
<img #image alt="loading.." src="https;//placehold.it/1000x1000">
</ion-scroll>
@cdesch
cdesch / rails_generator_cheat_sheet.md
Last active April 4, 2025 13:13
Rails Generator CheatSheet

Cheat Sheets are greate but they are not a substitute for learning the framework and reading the documentation as we most certainly have not covered every potential example here. Please refer to the Rails Command Line Docs for more information.

Command Line Generator Info

Reference

You can get all of this information on the command line.

rails generate with no generator name will output a list of all available generators and some information about global options. rails generate GENERATOR --help will list the options that can be passed to the specified generator.

@serradura
serradura / firebase_admin.rb
Last active August 22, 2024 02:52
FirebaseAdmin::Auth.verify_id_token | Ruby solution for https://firebase.google.com/docs/auth/admin/verify-id-tokens
# Usage:
# ========
# FirebaseAdmin::Auth.verify_id_token(your_id_token)
#
# The method call follows the same API of the Node.js, JAVA and Python SDKs.
# See https://firebase.google.com/docs/auth/admin/verify-id-tokens#verify_id_tokens_using_the_firebase_admin_sdk
# Dependencies:
# ---------------
# gem 'activesupport'