This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
""" | |
Renames the filenames within the same directory to be Unix friendly | |
(1) Changes spaces to hyphens | |
(2) Makes lowercase (not a Unix requirement, just looks better ;) | |
Usage: | |
python rename.py | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// All values/comments are valid with ATmega8 running at Fosc = 4.000MHz | |
#include <avr/io.h> | |
#include <avr/interrupt.h> | |
// TIMER0 with prescaler clkI/O/1024 | |
#define TIMER0_PRESCALER (1 << CS02) | (1 << CS00) | |
void main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Adapted from: http://bateru.com/news/2011/11/improved-code-for-javascript-decimal-to-fraction/ | |
function gcd(a, b) { | |
return (b) ? gcd(b, a % b) : a; | |
} | |
var decimalToFraction = function (_decimal) { | |
var top = _decimal.toString().replace(/\d+[.]/, ''); | |
var bottom = Math.pow(10, top.length); | |
if (_decimal > 1) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Converts Decimals to Fractions | |
* | |
*/ | |
package simpleai; | |
/** | |
* | |
* @author sarabeth | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var Octokat = require('octokat'); | |
var extend = require('lodash/object/assign'); | |
var defaults = { | |
branchName: 'master', | |
token: '', | |
username: '', | |
reponame: '' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//source: http://electronics.stackexchange.com/q/59615 | |
int AC_LOAD = 3; // Output to Opto Triac pin | |
int dimming = 128; // Dimming level (0-128) 0 = ON, 128 = OFF | |
void setup() | |
{ | |
pinMode(AC_LOAD, OUTPUT); // Set the AC Load as output | |
attachInterrupt(0, zero_crosss_int, RISING); // Choose the zero cross interrupt # from the table above | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Default Item Styles - Schema One (dark)] | |
Alert=ffc7626b,ffc7626b,1,,,,fffae9eb,-,,--- | |
Annotation=ff7f8c8d,ff7f8c8d,,,,,-,-,,--- | |
Attribute=ffe5c17c,ffe5c17c,,,,,-,-,,--- | |
Base-N Integer=ffe5c17c,ffe5c17c,,,,,-,-,,--- | |
Built-in=ffabb2c0,ffabb2c0,,,,,-,-,,--- | |
Character=ff97c378,ff97c378,,,,,-,-,,--- | |
Comment=ff4f5562,ff4f5562,,,,,-,-,,--- | |
Comment Variable=ff7f8c8d,ff7f8c8d,,,,,-,-,,--- | |
Constant=ffabb2c0,ffabb2c0,1,,,,-,-,,--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.os.Bundle; | |
import android.support.design.widget.AppBarLayout; | |
import android.support.design.widget.TabLayout; | |
import android.support.v4.widget.SwipeRefreshLayout; | |
import android.support.v7.app.AppCompatActivity; | |
import android.support.v7.widget.GridLayoutManager; | |
import android.support.v7.widget.RecyclerView; | |
import android.util.Log; | |
import com.blackcj.designsupportexample.adapters.RecyclerViewAdapter; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TextViewDrawableSize extends TextView { | |
private static final int DEFAULT_COMPOUND_DRAWABLE_SIZE = -1; | |
private int compoundDrawableWidth; | |
private int compoundDrawableHeight; | |
public TextViewDrawableSize(Context context) { | |
this(context, null); | |
} | |
public TextViewDrawableSize(Context context, AttributeSet attrs) { |
OlderNewer