Skip to content

Instantly share code, notes, and snippets.

View ampersanda's full-sized avatar
❤️
.clj

Lucky Pradana ampersanda

❤️
.clj
View GitHub Profile
@ampersanda
ampersanda / deps.edn
Created May 1, 2020 04:58
Vouch.io Krell Project - deps.edn
{:deps {io.vouch/krell {:git/url "https://github.com/vouch-opensource/krell.git"
:sha "ac75bdc0e41c7e061aaf4453921c272549b7b511"}
io.vouch/reagent-react-native {:git/url "https://github.com/vouch-opensource/reagent-react-native.git"
:sha "54bf52788ab051920ed7641f386177374419e847"}
reagent {:mvn/version "0.10.0"
:exclusions [cljsjs/react cljsjs/react-dom]}}}
@ampersanda
ampersanda / AppDelegate.swift
Last active April 22, 2020 07:29
Flutter Release configuraton for ios
import UIKit
import Flutter
import GoogleMaps
@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
@ampersanda
ampersanda / setup-ios-flavor.sh
Created April 21, 2020 07:08
Flutter iOS Setup change flavor
#!/bin/bash
sed -i .bak 's/main_production.dart/main_staging.dart/g' ios/Flutter/Generated.xcconfig
sed -i .bak 's/Production App Name/Staging App Name/g' ios/Runner/Info.plist
sed -i .bak 's/"com.app.production"/"com.app.staging"/g' ios/Runner.xcodeproj/project.pbxproj
# Do something to replace profiles or API Keys
# For ease to switch between plists profile
cp GoogleService-Info-staging.plist GoogleService-Info.plist
mv GoogleService-Info.plist ios/Runner/GoogleService-Info.plist
@ampersanda
ampersanda / media_query_extension.dart
Created April 20, 2020 17:19 — forked from slightfoot/media_query_extension.dart
Media Query Extension - by Simon Lightfoot
// MIT License
//
// Copyright (c) 2020 Simon Lightfoot
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@ampersanda
ampersanda / setup-pre-push.sh
Created April 20, 2020 14:37
Dart analysis_options.yaml pre-push guard
#!/bin/bash
# Run to initialze pre-push configuration
rm -f .git/hooks/pre-push
cat >.git/hooks/pre-push <<EOL
# stash any unstaged changes
git stash -q --keep-index
# run Flutter analyze
@ampersanda
ampersanda / gridview_extent.dart
Created February 27, 2020 07:22
GridView with extent height example
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
@ampersanda
ampersanda / .vimrc
Created February 13, 2020 09:52
My personal Clojure and Flutter vim configuration
call plug#begin('~/.vim/plugged')
Plug 'junegunn/vim-easy-align'
Plug 'https://github.com/junegunn/vim-github-dashboard.git'
Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets'
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
Plug 'tpope/vim-fireplace', { 'for': 'clojure' }
@ampersanda
ampersanda / how_to_use_in_sliver.dart
Last active January 20, 2020 09:47
delegate of SliverPersistentHeader
SliverPersistentHeader(
delegate: SliverAppBarDelegate((context, _, __, progress) => HistoryPersistentHeaderTile(),
collapsedHeight: Dimensions.fixedHeaderHeight,
expandedHeight: Dimensions.fixedHeaderHeight),
pinned: true),
@ampersanda
ampersanda / collision-pi.cljs
Created December 6, 2019 16:16
Count digit of PI using block collisions
(ns my.core
(:require [quil.core :as q :include-macros true]
[quil.middleware :as m]))
;; x is horizontal position of the block
;; y is vertical position of the block
;; w is width of the block
;; m is mass/weight of the block
;; v is velocity of the block
(defn block [x w v m color]