This file contains hidden or 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 getId() { | |
/** | |
* Imported from https://github.com/kyo-ago/UUID | |
* Robbie Mitchell, @superstrong | |
*/ | |
/** | |
* UUID.core.js: The minimal subset of the RFC-compliant UUID generator UUID.js. | |
* | |
* @fileOverview |
This file contains hidden or 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 pymongo import Connection | |
from bson import ObjectId | |
from itertools import imap | |
class Model(dict): | |
""" | |
A simple model that wraps mongodb document | |
""" | |
__getattr__ = dict.get |
This file contains hidden or 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 myFunction() { | |
var ss = SpreadsheetApp.getActive(); | |
var sheet = ss.getSheetByName("orange"); | |
var range = sheet.getRange("1:1").getValues(); | |
var titles = range[0]; | |
var a1range = "A1:A"; | |
var a1array = []; | |
a1range = a1range +titles.length*titles.length; | |
var b1range = "B1:B"; |
This file contains hidden or 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://stackoverflow.com/questions/11273268/script-import-local-csv-in-google-spreadsheet | |
function onOpen() { | |
var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
var csvMenuEntries = [{name: "Upload CSV file", functionName: "doGet"}]; | |
ss.addMenu("CSV", csvMenuEntries); | |
} | |
function doGet(e) { | |
var app = UiApp.createApplication().setTitle("Upload CSV to Sheet"); |
This file contains hidden or 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
/** | |
* immersiveMode | |
* set onPostResume, onSystemUiVisibilityChange | |
*/ | |
fun immersiveMode(activity: Activity) { | |
activity.window.clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN) | |
activity.window | |
.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN) | |
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { |
This file contains hidden or 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
Object.defineProperty(Date.prototype,"diff",{ | |
writable: false, configurable: false, enumerable: true, | |
/** | |
* Returns the difference between two Date objects. | |
* @param {Date} The date to compare to. | |
* @return {Object} | |
* @throws {TypeError} | |
*/ | |
value: function(date) { |
This file contains hidden or 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 SomeFragment extends Fragment { | |
MapView mapView; | |
GoogleMap map; | |
@Override | |
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { | |
View v = inflater.inflate(R.layout.some_layout, container, false); | |
This file contains hidden or 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 NonSwipeableViewPager extends ViewPager { | |
public NonSwipeableViewPager(Context context) { | |
super(context); | |
} | |
public NonSwipeableViewPager(Context context, AttributeSet attrs) { | |
super(context, attrs); | |
} |
This file contains hidden or 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
#!/usr/bin/env bash | |
# https://docs.docker.com/install/linux/docker-ce/ubuntu/ | |
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable" | |
sudo apt-get update | |
sudo apt-get install docker.io | |
# https://docs.docker.com/compose/install/ |
This file contains hidden or 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
// | |
// UIImage+Resize.swift | |
// | |
// Created by Marcos Griselli on 6/9/17. | |
// Copyright © 2017 Marcos Griselli. All rights reserved. | |
// | |
import Foundation | |
import UIKit |
NewerOlder