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
/* | |
* Copyright (C) 2017 The Android Open Source Project | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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.graphics.Bitmap; | |
import android.graphics.drawable.BitmapDrawable; | |
import android.graphics.drawable.Drawable; | |
import java.io.ByteArrayOutputStream; | |
/** | |
* Sketch Project Studio | |
* Created by Angga on 12/04/2016 14.27. | |
*/ | |
public class AppHelper { |
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
<!-- Include jQuery from somewhere, must use version 1.8 or above --> | |
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> | |
<!-- Include latest jquery.scrollTo, can download from https://github.com/flesler/jquery.scrollTo/releases --> | |
<script type="text/javascript" src="//cdn.jsdelivr.net/jquery.scrollto/2.1.2/jquery.scrollTo.min.js"></script> | |
<!-- Initialize the plugin, the contents of the script can be inlined here, of course --> | |
<script type="text/javascript" src="js/init.js"></script> |
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
/* | |
* Content-Type:text/javascript | |
* | |
* A bridge between iPad and iPhone touch events and jquery draggable, | |
* sortable etc. mouse interactions. | |
* @author Oleg Slobodskoi | |
* | |
* modified by John Hardy to use with any touch device | |
* fixed breakage caused by jquery.ui so that mouseHandled internal flag is reset | |
* before each touchStart event |
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
# from https://github.com/ruby-china/ruby-china/blob/master/app/helpers/application_helper.rb | |
MOBILE_USER_AGENTS = 'palm|blackberry|nokia|phone|midp|mobi|symbian|chtml|ericsson|minimo|' + | |
'audiovox|motorola|samsung|telit|upg1|windows ce|ucweb|astel|plucker|' + | |
'x320|x240|j2me|sgh|portable|sprint|docomo|kddi|softbank|android|mmp|' + | |
'pdxgw|netfront|xiino|vodafone|portalmmm|sagem|mot-|sie-|ipod|up\\.b|' + | |
'webos|amoi|novarra|cdm|alcatel|pocket|iphone|mobileexplorer|mobile' | |
def mobile? | |
agent_str = request.user_agent.to_s.downcase | |
return false if agent_str =~ /ipad/ |
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
<?php | |
/* | |
Localizations: | |
- [Spanish](https://gist.github.com/MatthewEppelsheimer/1498955#gistcomment-3317461) props @chdgp | |
UPDATED: 2020-03-09 |
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
Copyright (C) 2011 by Colin MacKenzie IV | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in |