Skip to content

Instantly share code, notes, and snippets.

View gadfly361's full-sized avatar

Matthew Jaoudi gadfly361

View GitHub Profile
@brianegan
brianegan / main.dart
Created June 19, 2019 17:22
Animations with Redux (or Streams or ChangeNotifiers, etc)
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_redux/flutter_redux.dart';
import 'package:redux/redux.dart';
void main() {
runApp(
MyApp(
store: Store<AppState>(
reducer,
@sma
sma / example.dart
Last active July 12, 2023 03:00
A flutter example demonstrating a custom painter drawing selectable rects
// run in DartPad: <https://dartpad.dev/c6a9111d58c3deb83711106cec6152ee>
import 'package:flutter/material.dart';
void main() {
runApp(MaterialApp(home: RectsExample()));
}
class RectsExample extends StatefulWidget {
@override
@MariaMelnik
MariaMelnik / main.dart
Created October 31, 2018 20:21
Flutter: show snackbar once after navigation
import 'package:flutter/material.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: 'Flutter Demo',
theme: new ThemeData(
@jmlsf
jmlsf / js-in-cljs.md
Last active January 25, 2024 23:15
Using JavaScript modules in ClojureScript

Using JavaScript Libraries from ClojureScript

Using JavaScript libraries from ClojureScript involves two distinct concerns:

  1. Packaging the code and delivering it to the browser
  2. Making ClojureScript code that accesses JavaScript libraries safe for advanced optimization

Right now, the only single tool that solves these probems reliably, optimally, and with minimal configuration is shadow-cljs, and so that is what I favor. In paricular, shadow-cljs lets you install npm modules using npm or yarn and uses the resulting package.json to bundle external dependencies. Below I describe why, what alternatives there are, and what solutions I disfavor at this time.

Packaging and Delivering Code

@reborg
reborg / rich-already-answered-that.md
Last active May 8, 2024 14:20
A curated collection of answers that Rich gave throughout the history of Clojure

Rich Already Answered That!

A list of commonly asked questions, design decisions, reasons why Clojure is the way it is as they were answered directly by Rich (even when from many years ago, those answers are pretty much valid today!). Feel free to point friends and colleagues here next time they ask (again). Answers are pasted verbatim (I've made small adjustments for readibility, but never changed a sentence) from mailing lists, articles, chats.

How to use:

  • The link in the table of content jumps at the copy of the answer on this page.
  • The link on the answer itself points back at the original post.

Table of Content

@andresvia
andresvia / tunnelme.md
Last active January 5, 2017 23:46
tunnelme - Split tunnel connections to a specific host or IP over a certain gateway

Situation:

Your VPN does not automatically set split tunnel for your connection to some host, maybe the ipaddress of the host changes over time, like an AWS ELB, and network admins can't set split tunnel rules on changing addresses.

Requirements:

User must be able to run:

sudo route add -host "$dst" "$tunnel"
@zentrope
zentrope / number-format.cljs
Created December 22, 2016 03:07
A comma for thousands separator in Clojurescript using goog closure libs.
(ns client.ui
(:require
[goog.i18n.NumberFormat.Format])
(:import
(goog.i18n NumberFormat)
(goog.i18n.NumberFormat Format)))
(def nff
(NumberFormat. Format/DECIMAL))
@samrocketman
samrocketman / libimobiledevice_ifuse_Ubuntu.md
Last active January 11, 2024 22:47
On Ubuntu 16.04, since iOS 10 update, libimobiledevice can't connect to my iPhone. This is my attempt to document a fix.

Why this document?

I upgraded my iPhone 5s to iOS 10 and could no longer retrieve photos from it. This was unacceptable for me so I worked at achieving retrieving my photos. This document is my story (on Ubuntu 16.04).

The solution is to compile libimobiledevice and ifuse from source.

Audience

Who is this guide intended for?

@Whoaa512
Whoaa512 / gulfile.js
Created October 15, 2015 04:01
Gulpfile for simple elm project
var concat = require('gulp-concat')
var concatCss = require('gulp-concat-css')
var csso = require('gulp-csso')
var del = require('del')
var elmBins = require('elm')
var glob = require('glob')
var gulp = require('gulp')
var jade = require('gulp-jade')
var jadeConcat = require('gulp-jade-template-concat')
var simpleSpawner = require('simple-spawner')
@scttnlsn
scttnlsn / core.cljs
Created July 1, 2015 17:58
Reagent/Secretary nested routing
(ns nested-routing.core
(:require [goog.events :as events]
[goog.history.EventType :as EventType]
[reagent.core :as reagent]
[reagent.ratom :refer-macros [reaction]]
[re-frame.core :refer [dispatch dispatch-sync register-handler register-sub subscribe]]
[secretary.core :as secretary :refer-macros [defroute]])
(:import goog.History))
(declare route-components