Based on this: http://blennd.com/post/the-pains-of-installing-tmux-on-a-shared-server/ Script forked from https://gist.github.com/shime/5706655/
- gcc
- wget
package main | |
import ( | |
"encoding/base64" | |
"net/http" | |
"strings" | |
) | |
type handler func(w http.ResponseWriter, r *http.Request) |
(function addXhrProgressEvent($) { | |
var originalXhr = $.ajaxSettings.xhr; | |
$.ajaxSetup({ | |
progress: function() { console.log("standard progress callback"); }, | |
xhr: function() { | |
var req = originalXhr(), that = this; | |
if (req) { | |
if (typeof req.addEventListener == "function") { | |
req.addEventListener("progress", function(evt) { | |
that.progress(evt); |
app.filter('bytes', function() { | |
return function(bytes, precision) { | |
if (isNaN(parseFloat(bytes)) || !isFinite(bytes)) return '-'; | |
if (typeof precision === 'undefined') precision = 1; | |
var units = ['bytes', 'kB', 'MB', 'GB', 'TB', 'PB'], | |
number = Math.floor(Math.log(bytes) / Math.log(1024)); | |
return (bytes / Math.pow(1024, Math.floor(number))).toFixed(precision) + ' ' + units[number]; | |
} | |
}); |
Based on this: http://blennd.com/post/the-pains-of-installing-tmux-on-a-shared-server/ Script forked from https://gist.github.com/shime/5706655/
#!/bin/zsh | |
echo 'Press any key to continue...'; read -k1 -s |
(ns express_sample | |
(:require [cljs.nodejs :as node])) | |
(def express (node/require "express")) | |
(def app (. express (createServer))) | |
(defn -main [& args] | |
(doto app | |
(.use (. express (logger))) | |
(.get "/" (fn [req res] |
// add the filter to your application module | |
angular.module('myApp', ['filters']); | |
/** | |
* Filesize Filter | |
* @Param length, default is 0 | |
* @return string | |
*/ | |
angular.module('filters', []) | |
.filter('Filesize', function () { |
private static void installMultiple(Context context) { | |
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) { | |
PackageInstaller packageInstaller = context.getPackageManager().getPackageInstaller(); | |
PackageInstaller.SessionParams sessionParams = new PackageInstaller.SessionParams(PackageInstaller.SessionParams.MODE_FULL_INSTALL); | |
try { | |
final int sessionId = packageInstaller.createSession(sessionParams); | |
Log.d(TAG, "installMultiple: sessionId " + sessionId); |
// First, get the unit number. | |
const getUnitNumber = fetch('https://www.lds.org/mobiledirectory/services/ludrs/1.1/mem/mobile/current-user-unitNo', { | |
credentials: 'include', | |
}) | |
.then(response => response.json()) | |
.then(response => response.message); | |
// Then download all contacts. | |
const getContacts = getUnitNumber.then(unitNumber => fetch(`https://www.lds.org/mobiledirectory/services/v2/ldstools/member-detaillist-with-callings/${unitNumber}`, { | |
credentials: 'include', |
[ | |
// Use paste and indent as default paste mechanism, | |
// this conserves your indentation and it's overall better. | |
// original paste is now ctrl+shift+v | |
{ | |
"keys": ["ctrl+v"], | |
"command": "paste_and_indent" | |
}, { | |
"keys": ["ctrl+shift+v"], | |
"command": "paste" |