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
package me.henrytao.smoothappbarlayoutdemo.fragment; | |
import android.os.Bundle; | |
import android.support.v4.app.Fragment; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import me.henrytao.smoothappbarlayoutdemo.R; | |
public class ExHeaderFragment extends Fragment { |
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
function copyToClipboard( text ){ | |
var copyDiv = document.createElement('div'); | |
copyDiv.contentEditable = true; | |
document.body.appendChild(copyDiv); | |
copyDiv.innerText = text; | |
copyDiv.unselectable = "off"; | |
copyDiv.focus(); | |
document.execCommand('SelectAll'); | |
document.execCommand("Copy", false, null); | |
document.body.removeChild(copyDiv); |
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
var gulp = require('gulp'), | |
browserify = require('browserify'), | |
babelify = require('babelify'), | |
source = require('vinyl-source-stream'), | |
reactify = require('reactify'), | |
browserSync = require('browser-sync').create(), | |
uglify = require('gulp-uglify'), | |
htmlreplace = require('gulp-html-replace'), | |
watchify = require('watchify'), | |
streamify = require('gulp-streamify'); |
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
{ | |
"name": "sample-server", | |
"version": "0.0.0", | |
"description": "Code from the React tutorial.", | |
"main": "server.js", | |
"dependencies": { | |
"body-parser": "^1.4.3", | |
"express": "^4.4.5" | |
}, | |
"devDependencies": {}, |
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
# aText as "shell script" => ruby /path/to/this/script.rb <optional query> | |
# Returns random giphy gif from top 100 trending or by query | |
require 'net/http' | |
require 'json' | |
class GiphySearch | |
def initialize | |
@defaults = { |
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
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/ | |
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating | |
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel | |
// MIT license | |
(function() { | |
var lastTime = 0; | |
var vendors = ['ms', 'moz', 'webkit', 'o']; |
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
/* | |
Autoloading is very nifty, and is used in a lot of large frameworks - it allows you to load the file that a class is written in automatically when you try to instantiate it. The advantage of this is that only classes that you want to instantiate & use will be included in your page and will keep memory usage down. | |
*/ | |
// Using an anonymous function | |
spl_autoload_register(function($class){ | |
include_once('includes/' . $class . '.class.php') | |
}); | |
// Using a named function |
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
class DemoSingleton { | |
private static $instance = NULL; | |
public static function getInstance(){ | |
if(is_null(self::$instance)){ | |
self::$instance = new self(); | |
} | |
return self::$instance; | |
} | |
} |
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
var gulp = require('gulp'); | |
var plugins = require("gulp-load-plugins")({ | |
pattern: ['gulp-*', 'gulp.*', 'main-bower-files'], | |
replaceString: /\bgulp[\-.]/ | |
}); | |
var dest = "./public/"; | |
var src = './src/'; | |
var clientJS = src + 'js/*.js'; | |
var clientSCSS = src + 'css/*.scss'; |
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
{ | |
"name": "app", | |
"version": "1.0.0", | |
"description": "do all development work here", | |
"main": "gulpfile.js", | |
"directories": { | |
"test": "test" | |
}, | |
"devDependencies": { | |
"browserify": "^9.0.4", |
NewerOlder