Skip to content

Instantly share code, notes, and snippets.

View psyanite's full-sized avatar
🍝
Chartered Spaghetti Engineer

psyanite

🍝
Chartered Spaghetti Engineer
View GitHub Profile
@yjbanov
yjbanov / .travis.yml
Created May 26, 2017 04:05
Continuously build Flutter APKs and IPAs using Travis build matrix
matrix:
include:
- os: linux
language: android
licenses:
- 'android-sdk-preview-license-.+'
- 'android-sdk-license-.+'
- 'google-gdk-license-.+'
android:
components:
@fokusferit
fokusferit / enzyme_render_diffs.md
Last active April 15, 2024 09:41
Difference between Shallow, Mount and render of Enzyme

Shallow

Real unit test (isolation, no children render)

Simple shallow

Calls:

  • constructor
  • render
import monix.eval.Task
import java.util.concurrent.TimeUnit
import scala.concurrent.duration._
/** Request limiter for APIs that have quotas per second, minute, hour, etc.
*
* {{{
* // Rate-limits to 100 requests per second
* val limiter = TaskLimiter(TimeUnit.SECONDS, limit = 100)
*
@bufordtaylor
bufordtaylor / upgrade_to_mysql57.sh
Created October 27, 2016 16:50 — forked from ericboehs/upgrade_to_mysql57.sh
Upgrading from MySQL 5.6 to 5.7 on OS X
mysql.server stop # kill the process if it fails
brew uninstall mysql56
brew update
brew install mysql
cp /usr/local/Cellar/mysql/5.7.12/support-files/my-default.cnf /usr/local/etc/my.cnf
brew services start mysql # don't run via tmux
mysql_upgrade -u root --force
brew services restart mysql # don't run via tmux
cd ~/Code/17hats/17hats
bundle exec gem uninstall -a mysql2; bundle install
@dalegaspi
dalegaspi / Dependencies.scala
Last active October 9, 2019 16:17
Using Postgesql with TypeSafe Slick 3.1.1
// for use with your build.sbt
object Dependencies {
// ... all your other dependencies
val typesafeSlick = "com.typesafe.slick" %% "slick" % "3.1.1"
val postgreSql = "org.postgresql" % "postgresql" % "9.4.1209"
val hikariCP = "com.typesafe.slick" %% "slick-hikaricp" % "3.1.0" // you need really need this or you get ClassNotFoundException
}
@dabit3
dabit3 / React Native Easings
Created August 1, 2016 03:38
React Native Easing animations
'use strict';
var React = require('react-native');
var {
AppRegistry,
StyleSheet,
Text,
View,
Easing,
Animated,
@andrewjmead
andrewjmead / app.js
Last active January 5, 2020 20:54
Sequelize One-To-One Relationship
var Sequelize = require('sequelize');
var sequelize = new Sequelize(undefined, undefined, undefined, {
'dialect': 'sqlite',
'storage': __dirname + '/basic-sqlite-database.sqlite'
});
var Profile = sequelize.define('profile', {
someData: Sequelize.STRING
});
@popravich
popravich / PostgreSQL_index_naming.rst
Last active March 25, 2024 12:42
PostgreSQL index naming convention to remember

The standard names for indexes in PostgreSQL are:

{tablename}_{columnname(s)}_{suffix}

where the suffix is one of the following:

  • pkey for a Primary Key constraint;
  • key for a Unique constraint;
  • excl for an Exclusion constraint;
  • idx for any other kind of index;
@iest
iest / README.md
Last active August 11, 2022 09:20
Setting up environment variables with various shells

What the hell are environment variables?

They're just variables you set on your system that various programs/processes can read. A fairly standard example in javascript circles would be setting your NODE_ENV variable to "production" or "development", altering how node code is executed on your system (for example showing more debug messaging when in development).

With most shells there's a way to set them for the current session, and a way to set them for all sessions. The following is meant to be a guide on how to set env vars in the various shells.

Bash (The default shell on OSX)

Setting for the session:

@mobilemind
mobilemind / git-tag-delete-local-and-remote.sh
Last active April 30, 2024 23:36
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName