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 main | |
import ( | |
"fmt" | |
"sync" | |
) | |
func main() { | |
// My opinions on people. | |
peopleOpinions := map[string]string{ |
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
#! /bin/bash | |
lspci -knn | grep Net -A2 |
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
socket.on('file', function (arrayBuffer) { | |
// Build a Blob from an ArrayBuffer | |
var blob = new Blob([arrayBuffer]) | |
doSomethingMagicWithBlobs(blob) | |
// Voilà | |
}) |
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
// called when a sound was encoded successfully. | |
function doneEncoding (blob) { | |
// do some stuff... | |
socket.emit('file', blob) | |
// do more stuff... | |
} |
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
// Let's assume io was initialized, like var io = require('socket.io')(app) | |
io.on('connection', function (socket) { | |
socket.on('file', function (file) { | |
socket.emit('file', file) | |
}) | |
}) |
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 com.mycompany.myfirstapp.activity.weather; | |
import android.content.Intent; | |
import android.support.v7.app.AppCompatActivity; | |
import android.os.Bundle; | |
import java.io.IOException; | |
import com.mycompany.myfirstapp.service.WeatherInfoService; | |
import com.mycompany.myfirstapp.model.weather.WeatherInfo; |
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 com.mycompany.myfirstapp.service; | |
import com.mycompany.myfirstapp.api.WeatherInfoApi; | |
import java.io.IOException; | |
import retrofit.Callback; | |
import retrofit.GsonConverterFactory; | |
import retrofit.Retrofit; |
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 com.mycompany.myfirstapp.api; | |
import com.mycompany.myfirstapp.model.weather.WeatherInfo; | |
import retrofit.Call; | |
import retrofit.http.GET; | |
import retrofit.http.Query; | |
public interface WeatherInfoApi { | |
@GET("/data/2.5/weather") |
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 com.mycompany.myfirstapp.model.weather; | |
public class Weather { | |
private String description; | |
public String getDescription() { | |
return description; | |
} |
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 com.mycompany.myfirstapp.model.weather; | |
public class WeatherInfo { | |
private Weather[] weather; | |
private String name; | |
public Weather[] getWeather() { | |
return weather; | |
} |