Skip to content

Instantly share code, notes, and snippets.

View anis-campos's full-sized avatar
🎯
Focusing

Anis anis-campos

🎯
Focusing
View GitHub Profile
@anis-campos
anis-campos / nuspec.md
Created May 23, 2017 10:04 — forked from sharwell/nuspec.md
A schema definition for NuGet specifications suitable for use with Visual Studio's IntelliSense.

A schema definition for NuGet specifications suitable for use with Visual Studio's IntelliSense.

Installation

To use this file:

  1. Download the file to your Visual Studio XML schemas folder. For example:
    • Visual Studio 2010: C:\Program Files (x86)\Microsoft Visual Studio 10.0\Xml\Schemas
    • Visual Studio 2012: C:\Program Files (x86)\Microsoft Visual Studio 11.0\Xml\Schemas
  2. Make sure to specify the XML namespace in your .nuspec file. If you previously used , change it to
@anis-campos
anis-campos / docker-update-images.sh
Created June 4, 2017 10:53
Update all docker images on DSM
for v in `docker images | tail -n +2 |grep -v -e "none\|syncer"|awk '{print $1}'` ; do docker pull $v; done;
@anis-campos
anis-campos / update-images.sh
Last active June 4, 2017 11:00 — forked from ColinLeverger/update-images.sh
Update all Docker images
for image in `docker images | grep -v "REPOSITORY\|none" | awk '{print $1}'` ; do docker pull $image; done;
@anis-campos
anis-campos / cross-compile_filebeat_arm.sh
Last active December 15, 2018 22:25
Cross-compile Elastic Filebeat for ARM with docker. Works Raspberry Pi 2
#----- Create a Docker for cross-compilation -----#
mkdir build && cd $_
docker run -it --rm -v `pwd`:/build golang:1.8.3 /bin/bash
#----- Inside docker -----#
go get github.com/elastic/beats
cd /go/src/github.com/elastic/beats/filebeat/
git checkout v5.6.3
GOARCH=arm go build
cp filebeat /build
exit
@anis-campos
anis-campos / busybox.yaml
Last active September 21, 2018 20:11 — forked from mosuka/busybox.yaml
apiVersion: v1
kind: Pod
metadata:
name: busybox
spec:
containers:
- image: busybox
command:
- sleep
- "3600"
@anis-campos
anis-campos / Dockerfile
Last active October 17, 2018 19:30 — forked from renzok/Dockerfile
docker: mapping host uid and gid to user inisde container
FROM debian:jessie
ENV USER=boatswain USER_ID=1000 USER_GID=1000
# now creating user
RUN groupadd --gid "${USER_GID}" "${USER}" && \
useradd \
--uid ${USER_ID} \
--gid ${USER_GID} \
--create-home \
@anis-campos
anis-campos / NetworkUtils.kt
Created June 19, 2019 14:24
Checking network connectivity on Android before API Level 29
class NetworkUtils(private val context: Context) {
fun isConnected(): Boolean {
val cm = context.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager
val activeNetwork: NetworkInfo? = cm.activeNetworkInfo
var result = false
if (activeNetwork != null) {
result = activeNetwork.isConnectedOrConnecting
}
return result
}
@anis-campos
anis-campos / proguard-rules.pro
Created September 13, 2019 15:51 — forked from jemshit/proguard-rules.pro
Proguard rules for common Android libraries
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
-keepclassmembers class fqcn.of.javascript.interface.for.webview {
public *;
}
### RxJava, RxAndroid (https://gist.github.com/kosiara/487868792fbd3214f9c9)
-keep class rx.schedulers.Schedulers {
public static <methods>;