This file contains hidden or 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
rails g scaffold Book title:string description:text | |
rails g scaffold Pubhouse title:string address:text | |
rails g model BookPubhouse book_id:integer pubhouse_id:integer | |
rake db:migrate |
This file contains hidden or 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
rails g scaffold Book title:string description:text | |
rails g scaffold Pubhouse title:string address:text | |
rails g model BookPubhouse book_id:integer pubhouse_id:integer | |
rake db:migrate |
This file contains hidden or 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.sadaptor; | |
import java.util.ArrayList; | |
import java.util.HashMap; | |
import java.util.List; | |
import java.util.Map; | |
import android.os.Bundle; | |
import android.os.Environment; | |
import android.app.Activity; |
This file contains hidden or 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
#UPLOAD ON AWS S3 | |
create a file named aws.yml in config folder (config/aws.yml) | |
and insert your aws data bucket. | |
``` | |
#!yaml | |
production: |
This file contains hidden or 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
try { | |
RequestQueue requestQueue = Volley.newRequestQueue(this); | |
String URL = "http://..."; | |
// Prepares POST data... | |
JSONObject jsonBody = new JSONObject(); | |
jsonBody.put("TakeoffID", "2"); | |
jsonBody.put("ViewPhoto1", "image base64 content"); | |
jsonBody.put("ViewPhoto2", "image base64 content"); | |
// "OrderLineid": "964"... |
This file contains hidden or 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
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> | |
public class ExampleApp extends Activity { | |
/** Called when the activity is first created. */ | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.main); | |
LocationManager locationManager = (LocationManager) getSystemService(LOCATION_SERVICE); | |
if (locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)){ |
This file contains hidden or 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
#!/usr/bin/env python | |
# | |
# Extracts email addresses from one or more plain text files. | |
# | |
# Notes: | |
# - Does not save to file (pipe the output to a file if you want it saved). | |
# - Does not check for duplicates (which can easily be done in the terminal). | |
# | |
# (c) 2013 Dennis Ideler <[email protected]> |
This file contains hidden or 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
import java.text.ParseException; | |
import java.text.SimpleDateFormat; | |
import java.util.Date; | |
import java.util.TimeZone; | |
import android.util.Log; | |
/** | |
* Utility class for parsing and formatting dates and times. | |
* |
This file contains hidden or 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
server { | |
listen 443; | |
server_name mydomain.com www.mydomain.com; | |
ssl on; | |
ssl_certificate /home/xxxxx/certificati/letsencrypt/live/mydomain.com/fullchain.pem; | |
ssl_certificate_key /home/xxxx/certificati/letsencrypt/live/mydomain.com/privkey.pem; | |
# Proxying the connections connections |
This file contains hidden or 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 | |
# a script that create a docker container | |
MYPATH=$1 | |
echo "USAGE: script.sh [local_path]" | |
# check input parameters | |
if [ -z "$MYPATH" ]; then | |
echo "Error: local path is not set" | |
exit |
OlderNewer