Skip to content

Instantly share code, notes, and snippets.

View markrickert's full-sized avatar

Mark Rickert markrickert

View GitHub Profile
@BalogunofAfrica
BalogunofAfrica / list-renderer.tsx
Created March 31, 2023 10:37
Simple API for using FlashList as Scrollview
import { FlashList, FlashListProps } from "@shopify/flash-list";
import React, { forwardRef, ReactElement } from "react";
type ListProps<T> = Omit<FlashListProps<T>, "children"> & { as?: "list" };
type ScrollViewProps<T> = Omit<
FlashListProps<T>,
"children" | "data" | "renderItem"
> & {
as?: "scroll-view";
children: React.ReactNode | React.ReactNode[];
import React from "react";
import { StyleSheet, Text, View } from "react-native";
import SphericalMercator from "@mapbox/sphericalmercator";
import { MapView, Constants } from "expo";
const merc = new SphericalMercator();
const getZoomLevelFromRegion = (region, viewport) => {
const { longitudeDelta } = region;
const { width } = viewport;
@CricketofLocusts
CricketofLocusts / RemoveFBSponsoredPosts.user.js
Last active July 19, 2022 03:20
A Tampermonkey script to remove Sponsored posts from your newsfeed on Facebook.
// ==UserScript==
// @name Remove FB Sponsored Posts
// @namespace https://gist.github.com/CricketofLocusts/6109689af6c78b5e2ee23258970eaffa.js
// @description A Tampermonkey script to remove Sponsored posts from your newsfeed on Facebook.
// @version 1.21
// @author Cricket
// @include https://www.facebook.com/?ref=tn_tnmn
// @include https://www.facebook.com
// @require http://code.jquery.com/jquery-latest.min.js
// ==/UserScript==
@forrestgrant
forrestgrant / foo.rb
Created June 3, 2014 12:41
Swift - RubyMotion
numbers = [20, 19, 7, 12]
numbers.map { |n| 3 * n }
@alexrothenberg
alexrothenberg / ui_view.rb
Created November 21, 2013 16:23
Convenience methods for dealing with coordinates in RubyMotion
class UIView
def top
frame.origin.y
end
def left
frame.origin.x
end
def height
frame.size.height
end
@tristanoneil
tristanoneil / harvest
Created October 24, 2013 13:37
How to override Harvest for Mac time settings.
For AppStore apps:
defaults write com.getharvest.harvestxapp TimeFormat hours_minutes
defaults write com.getharvest.harvestxapp TimeFormat decimal
defaults write com.getharvest.harvestxapp TimeFormat server
For apps downloaded directly from GetHarvest:
defaults write ~/Library/Preferences/com.getharvest.harvestx.plist TimeFormat hours_minutes
defaults write ~/Library/Preferences/com.getharvest.harvestx.plist TimeFormat decimal
@orta
orta / gist:7117853
Created October 23, 2013 12:36
HTML -> NSAttributedString using only UIKit
+ (NSAttributedString *)artsyBodyTextAttributedStringFromHTML:(NSString *)HTML withFont:(UIFont *)font
{
NSMutableParagraphStyle *style = [[NSMutableParagraphStyle alloc] init];
style.lineHeightMultiple = 1.2;
style.paragraphSpacing = font.pointSize * .5;
NSDictionary *textParams = @{
NSFontAttributeName : font,
NSParagraphStyleAttributeName : style,
@iwarshak
iwarshak / Gemfile
Last active May 12, 2018 21:54
Here is what you need to get your Rubymotion application logs sent to papertrailapp.com. I am using Cocoalumberjack (CLJ) which seems to be the logging framework of choice for Cocoa, motion-logger which is a thin RM wrapper around Cocoalumberjack. CLJ allows you to write your own loggers, which is what PapertrailLogger is. It simply fires off lo…
source :rubygems
gem "rake"
gem 'motion-logger' #cocoalumberjack wrapper

RubyMotion #inspect 2013 Traveling Guide

Overview

This document is a travel guide to RubyMotion's first conference, #inspect 2013.

http://www.rubymotion.com/conference

If you are attending or considering attending the conference, you might find here some handy tips that will answer questions you might have. If you have a question that isn't answered here, feel free to contact us and we will update this document accordingly.

@asmallteapot
asmallteapot / rbm_singleton.rb
Created September 20, 2012 18:00
Singletons in RubyMotion 1.4
# http://blog.rubymotion.com/post/31917526853/rubymotion-gets-ios-6-iphone-5-debugger
class STSomeAPIClient
def self.sharedClient
Dispatch.once { @instance ||= new }
@instance
end
end