Skip to content

Instantly share code, notes, and snippets.

@import 'https://fonts.googleapis.com/css?family=Open+Sans+Condensed:300';
html,
body {
width: 100%;
height: 100%;
overflow: hidden;
margin: 0;
display: flex;
flex-direction: column;
@magnucki
magnucki / LocalObjectStorage.js
Created May 9, 2017 15:02
Store objects in local storage
Storage.prototype.setObject = function(key, value) {
this.setItem(key, JSON.stringify(value));
}
Storage.prototype.getObject = function(key) {
return JSON.parse(this.getItem(key));
}
@magnucki
magnucki / CircularReveal
Last active September 8, 2015 14:46
Create a circular reveal from the center of a fragment
@Override public void onResume() {
super.onResume();
View rootView = getActivity().findViewById(R.id.ratingLayout);
View shape = rootView.findViewById(R.id.ratingLayout);
Display display = getActivity().getWindowManager().getDefaultDisplay();
Point size = new Point();
display.getSize(size);
int width = size.x;

Keybase proof

I hereby claim:

  • I am magnucki on github.
  • I am magnucki (https://keybase.io/magnucki) on keybase.
  • I have a public key whose fingerprint is ADA0 362F EA29 2C81 D013 A59C CA04 7B73 3599 4AF8

To claim this, I am signing this object:

@magnucki
magnucki / activity_main.xml
Created August 7, 2015 12:19
CoordinatorLayout with animated Toolbar and RecyclerView ready Framelayout for Fragment (with Navigation Drawer)
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/MainDrawer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:elevation="@dimen/navigation_elevation"
android:fitsSystemWindows="true"
@magnucki
magnucki / build.gradle
Created July 22, 2015 07:14
Standard Android + Kotlin + Anko
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:0.12.613'
classpath 'com.android.tools.build:gradle:1.2.3'
#!/bin/sh
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite
#!/bin/sh
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
@magnucki
magnucki / qsort.hs
Created October 13, 2014 16:56
simple quicksort
qsort:: [Int] -> [Int]
qsort [] = []
qsort [a] = [a]
qsort (x:xs) = (qsort [b | b <- xs , b < x]) ++ [x] ++ (qsort [b | b <- xs, b > x])
@magnucki
magnucki / .gitignore
Created October 13, 2014 11:42
Android Studio .gitignore
# Mac OS X
*.DS_Store
# Windows
Thumbs.db
# Built application files
*.apk
*.ap_