Skip to content

Instantly share code, notes, and snippets.

🇮🇷

Navid yaa110

🇮🇷
Block or report user

Report or block yaa110

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@asukakenji
asukakenji / go-os-arch.md
Last active Sep 22, 2019
Go (Golang) GOOS and GOARCH
View go-os-arch.md

Go (Golang) GOOS and GOARCH

All of the following information is based on go version go1.8.3 darwin/amd64.

A list of valid GOOS values

(Bold = supported by go out of the box, ie. without the help of a C compiler, etc.)

  • android
  • darwin
@application2000
application2000 / how-to-install-latest-gcc-on-ubuntu-lts.txt
Last active Sep 13, 2019
How to install latest gcc on Ubuntu LTS (12.04, 14.04, 16.04)
View how-to-install-latest-gcc-on-ubuntu-lts.txt
These commands are based on a askubuntu answer http://askubuntu.com/a/581497
To install gcc-6 (gcc-6.1.1), I had to do more stuff as shown below.
USE THOSE COMMANDS AT YOUR OWN RISK. I SHALL NOT BE RESPONSIBLE FOR ANYTHING.
ABSOLUTELY NO WARRANTY.
If you are still reading let's carry on with the code.
sudo apt-get update && \
sudo apt-get install build-essential software-properties-common -y && \
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
@sindbach
sindbach / mongodb_lookup.go
Created Apr 15, 2016
A simple example of how to use $lookup in Golang using mgo.
View mongodb_lookup.go
package main
import (
"fmt"
"gopkg.in/mgo.v2"
"gopkg.in/mgo.v2/bson"
)
func main() {
session, err := mgo.Dial("localhost")
if err != nil {
@oleksiiBobko
oleksiiBobko / tcp_server.c
Last active Sep 16, 2019
Simple socket server in C using threads (pthread library) Compiles on linux
View tcp_server.c
/*
C socket server example, handles multiple clients using threads
Compile
gcc server.c -lpthread -o server
*/
#include<stdio.h>
#include<string.h> //strlen
#include<stdlib.h> //strlen
#include<sys/socket.h>
@passsy
passsy / ArrayAdapter.java
Last active Jun 30, 2019
ArrayAdapter for RecyclerView
View ArrayAdapter.java
package com.pascalwelsch.utils;
import android.support.annotation.Nullable;
import android.support.v7.util.DiffUtil;
import android.support.v7.widget.RecyclerView;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
@congjf
congjf / .Title
Last active Aug 16, 2019 — forked from border/mgoExample.go
Using MongoDB in golang with mgo
View .Title
Using MongoDB in golang with mgo
View AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="8"/>
<uses-permission android:name="android.permission.READ_CONTACTS" />
<application android:label="@string/app_name">
@andelf
andelf / sighup.go
Created Jun 29, 2013
golang process SIGHUP, HUP signal to reload configuration
View sighup.go
// program
package main
import "os/signal"
import "os"
import "fmt"
import "syscall"
import "time"
@granoeste
granoeste / EachDirectoryPath.md
Last active Sep 18, 2019
[Android] How to get the each directory path.
View EachDirectoryPath.md

System directories

Method Result
Environment.getDataDirectory() /data
Environment.getDownloadCacheDirectory() /cache
Environment.getRootDirectory() /system

External storage directories

@drewolson
drewolson / reflection.go
Last active Sep 16, 2019
Golang Reflection Example
View reflection.go
package main
import (
"fmt"
"reflect"
)
type Foo struct {
FirstName string `tag_name:"tag 1"`
LastName string `tag_name:"tag 2"`
You can’t perform that action at this time.