no Homebrew required
$ cd /usr/local/src
$ curl -OL http://nginx.org/download/nginx-1.12.2.tar.gz
$ tar -xvzf nginx-1.12.2.tar.gz && rm nginx-1.12.2.tar.gz| #!/bin/bash | |
| TABLE_NAME=TableName | |
| KEY=id | |
| aws dynamodb scan --table-name $TABLE_NAME --attributes-to-get "$KEY" --query "Items[].id.S" --output text | tr "\t" "\n" | xargs -t -I keyvalue aws dynamodb delete-item --table-name $TABLE_NAME --key '{"id": {"S": "keyvalue"}}' |
| GATEWAY_FLAGS := -I. -I/usr/local/include -I$(GOPATH)/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis -I/usr/local/include | |
| GRPC_FLAGS := --python_out=. --grpc_python_out=. | |
| code: | |
| python -m grpc_tools.protoc $(GRPC_FLAGS) $(GATEWAY_FLAGS) *.proto | |
| gw: | |
| protoc $(GATEWAY_FLAGS) \ | |
| --go_out=Mgoogle/api/annotations.proto=github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis/google/api,plugins=grpc:. \ |
| using System; | |
| using System.Net; | |
| using System.Net.Sockets; | |
| using System.Text; | |
| namespace UDP | |
| { | |
| public class UDPSocket | |
| { | |
| private Socket _socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); |
| version: 0.0 | |
| os: linux | |
| files: | |
| - source: / | |
| destination: /home/ec2-user/node | |
| permissions: | |
| - object: /home/ec2-user | |
| owner: ec2-user | |
| group: ec2-user | |
| type: |
I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).
Use ssh keys and define host aliases in ssh config file (each alias for an account).
| using UnityEditor; | |
| using System; | |
| using System.Collections.Generic; | |
| class BuildScript { | |
| static string[] SCENES = FindEnabledEditorScenes(); | |
| static string APP_NAME = "AngryBots"; | |
| static string TARGET_DIR = "target"; |
| //int vesioncode = context().getPackageManager().getPackageInfo(context().getPackageName(), 0).versionCode; | |
| public static int GetVersionCode() { | |
| AndroidJavaClass contextCls = new AndroidJavaClass("com.unity3d.player.UnityPlayer"); | |
| AndroidJavaObject context = contextCls.GetStatic<AndroidJavaObject>("currentActivity"); | |
| AndroidJavaObject packageMngr = context.Call<AndroidJavaObject>("getPackageManager"); | |
| string packageName = context.Call<string>("getPackageName"); | |
| AndroidJavaObject packageInfo = packageMngr.Call<AndroidJavaObject>("getPackageInfo", packageName, 0); | |
| return packageInfo.Get<int>("versionCode"); | |
| } | |
| module.exports = { | |
| /** | |
| * | |
| * Using raw socket.io functionality from a Sails.js controller | |
| * | |
| */ | |
| index: function (req,res) { |
| // Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible). | |
| // Tweak the makePrettyJSON_ function to customize what kind of JSON to export. | |
| var FORMAT_ONELINE = 'One-line'; | |
| var FORMAT_MULTILINE = 'Multi-line'; | |
| var FORMAT_PRETTY = 'Pretty'; | |
| var LANGUAGE_JS = 'JavaScript'; | |
| var LANGUAGE_PYTHON = 'Python'; |