Skip to content

Instantly share code, notes, and snippets.

View solarsailer's full-sized avatar

Matthieu Oger solarsailer

View GitHub Profile
import Breakpoints from './Breakpoints';
import { css, cx } from '@emotion/css';
import { HTMLAttributes, forwardRef } from 'react';
export type StackProps = {
adaptive?: true;
alignCenter?: true;
center?: true;
children?: React.ReactNode;
className?: string;
@mxcl
mxcl / detweet.swift
Last active December 23, 2023 23:22
Delete all tweets and favorites older than two months ago. Instructions in comment.
#!/usr/bin/swift sh
import Foundation
import PromiseKit // @mxcl ~> 6.5
import Swifter // @mattdonnelly == b27a89
let swifter = Swifter(
consumerKey: "FILL",
consumerSecret: "ME",
oauthToken: "IN",
oauthTokenSecret: "https://developer.twitter.com/en/docs/basics/apps/overview.html"

Motivation

  • expression-oriented programming one of the great advances of FP
  • expressions plug together like legos, making more malleable programming experience in-the-small

Examples

Write in an expression-oriented style, scoping variables as locally as possible:

Common game localizations https://docs.google.com/spreadsheets/d/135HgMYcRDt6vnJN0d-xFMEZUeWjVbc61ETf8uVwHERE/edit#gid=339250473

Polyglot Gamedev Project : Master Sheet 0.9.0 https://docs.google.com/spreadsheets/d/17f0dQawb-s_Fd7DHgmVvJoEGDMH_yoSd8EYigrb0zmM/edit#gid=310116733

Game UI common translation https://docs.google.com/spreadsheets/d/197GYEhPpk0DQTEO0r80v_k_bkGVtUgBB08PP--hqCIA/edit#gid=0

Raw text files containing characters used in different languages such as English, French, German, Chinese, Japanese, Korean.

@joecritch
joecritch / MyComponent.js
Last active September 29, 2021 15:16
Passing specific props in React / JSX
class MyComponent extends React.Component {
render() {
const {location, todos, users} = this.props;
//
// ... do things with your variables!
//
return (
<MyChild {...{location, todos, user}} />
// equivalent to:
// <MyChild location={location} todos={todos} user={user} />
@jbinto
jbinto / index.jsx
Created November 28, 2015 22:15
Egghead tutorial - Getting Started with Redux - JSBin implementation
/* global ReactRedux, Redux, ReactDOM */
// "Getting Started with Redux" (by Dan Abramov)
// https://egghead.io/series/getting-started-with-redux
// This file on JSBin (by Jesse Buchanan):
// http://jsbin.com/wuwezo/74/edit?js,console,output
////////////////////////////////////////////////
//
@breiter
breiter / Markdown.mdimporter.patch
Last active October 30, 2023 10:24
Enable Spotlight indexing of Markdown in ~~El Capitan~~ Monterey without disabling SIP
--- /System/Library/Spotlight/RichText.mdimporter/Contents/Info.plist 2022-02-26 09:05:07.000000000 +0200
+++ /Library/Spotlight/Markdown.mdimporter/Contents/Info.plist 2022-03-22 21:01:30.000000000 +0200
@@ -13,27 +13,20 @@
<string>MDImporter</string>
<key>LSItemContentTypes</key>
<array>
- <string>public.rtf</string>
- <string>public.html</string>
- <string>public.xml</string>
- <string>public.plain-text</string>
@ccurtin
ccurtin / Detect-if-IE.js
Created November 23, 2015 06:41
Detect if IE and add class to html/body..
/**
* detect IE
* returns version of IE or false, if browser is not Internet Explorer
*/
(function detectIE() {
var ua = window.navigator.userAgent;
var msie = ua.indexOf('MSIE ');
if (msie > 0) {
@mackuba
mackuba / wwdc15.md
Last active August 6, 2022 17:28
New stuff from WWDC 2015

Here's my own list of the interesting stuff announced during this year's WWDC, collected from the keynotes, various Apple docs, blog posts and tweets.

If you're planning to watch the videos, I really recommend this Mac app that helps you download and watch them: https://github.com/insidegui/WWDC.

OS X El Capitan

http://www.apple.com/osx/elcapitan-preview/

  • split view - two apps side by side on full screen
@chrismdp
chrismdp / s3.sh
Last active March 5, 2024 12:57
Uploading to S3 in 18 lines of Shell (used to upload builds for http://soltrader.net)
# You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine
# This is how I upload my new Sol Trader builds (http://soltrader.net)
# Based on a modified script from here: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash
S3KEY="my aws key"
S3SECRET="my aws secret" # pass these in
function putS3
{
path=$1