Skip to content

Instantly share code, notes, and snippets.

View JaisonBrooks's full-sized avatar

Jaison Brooks JaisonBrooks

  • Enphase Energy
  • Boise, ID
View GitHub Profile
/**
* A mixin which helps you to add depth to elements according to the Google Material Design spec:
* http://www.google.com/design/spec/layout/layout-principles.html#layout-principles-dimensionality
*
* Please note that the values given in the specification cannot be used as is. To create the same visual experience
* the blur parameter has to be doubled.
*
* Author: Florian Kutschera (@gefangenimnetz), Conceptboard GmbH (@conceptboardapp)
*
* Example usage:
package your_package;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.app.Activity;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
@JaisonBrooks
JaisonBrooks / designer.html
Last active August 29, 2015 14:08
designer
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-scroll-header-panel/core-scroll-header-panel.html">
<link rel="import" href="../paper-tabs/paper-tabs.html">
<link rel="import" href="../paper-tabs/paper-tab.html">
<polymer-element name="my-element">
<template>
<style>
@JaisonBrooks
JaisonBrooks / launch_firefox_from_terminal.sh
Last active August 29, 2015 14:10
Launch firefox from a command line terminal in Mac os and load a URL
cd /Applications/Firefox.app/Contents/MacOS/ && ./firefox www.purple.com
@JaisonBrooks
JaisonBrooks / create_array_of_dates.php
Last active August 29, 2015 14:10
Create array of dates between a start date and end date | php
<?php
function get_lastweek_start_date($revered) {
$previous_week = strtotime("-1 week +1 day");
$start_week = strtotime("last monday midnight",$previous_week);
$end_week = strtotime("next sunday",$start_week);
$start_week = date("Y-m-d",$start_week);
return $start_week;
}
t = 236 # seconds
Time.at(t).utc.strftime("%H:%M:%S")
=> "00:03:56"
# Reference
# http://stackoverflow.com/questions/3963930/ruby-rails-how-to-convert-seconds-to-time
@JaisonBrooks
JaisonBrooks / change_already_printed_line.rb
Created December 4, 2014 21:48
change_already_printed_line.rb
require 'time'
loop do
time = Time.now.to_s + "\r"
print time
$stdout.flush
sleep 1
end
public static void main(String[] args) {
String inputStr;
String charInput;
int totalCount = 0;
int index = 0;
Scanner scanner = new Scanner(System.in);
System.out.println("Enter text to be searched: ");
inputStr = scanner.nextLine();
# Built application files
/*/build/
# Crashlytics configuations
com_crashlytics_export_strings.xml
# Local configuration file (sdk path, etc)
local.properties
# Gradle generated files