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 random | |
rows = [ 1, 2, 3, ... ] # your list | |
print([ random.choice(rows) for i in range(5) ]) |
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
Gmail Account | Google Drive Space | |
---|---|---|
Main | Small | |
Secondary | Very Large |
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
# https://stackoverflow.com/a/43185606 | |
def cv2_imread_win(img_filepath, np): | |
stream = open(img_filepath, "rb") | |
bytes = bytearray(stream.read()) | |
numpyarray = np.asarray(bytes, dtype=np.uint8) | |
return cv2.imdecode(numpyarray, cv2.IMREAD_UNCHANGED) |
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
var political_party_th = [ | |
'พรรคประชาธิปัตย์', | |
'พรรคประชากรไทย', | |
'พรรคมหาชน', | |
'พรรคกสิกรไทย', | |
'พรรคเพื่อฟ้าดิน', | |
'พรรคความหวังใหม่', | |
'พรรคเครือข่ายชาวนาแห่งประเทศไทย', | |
'พรรคเพื่อไทย', | |
'พรรคเพื่อแผ่นดิน', |
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
from PIL import Image | |
def to_grayscale(source, dest): | |
img = Image.open(source) | |
img = img.convert('L') # grayscale | |
img.save(dest, quality=100) |
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
var months_th = [ "มกราคม", "กุมภาพันธ์", "มีนาคม", "เมษายน", "พฤษภาคม", "มิถุนายน", "กรกฎาคม", "สิงหาคม", "กันยายน", "ตุลาคม", "พฤศจิกายน", "ธันวาคม", ]; | |
var months_th_mini = [ "ม.ค.", "ก.พ.", "มี.ค.", "เม.ย.", "พ.ค.", "มิ.ย.", "ก.ค.", "ส.ค.", "ก.ย.", "ต.ค.", "พ.ย.", "ธ.ค.", ]; | |
// done |
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
:: use this file to run your own startup commands | |
:: use in front of the command to prevent printing the command | |
:: uncomment this to have the ssh agent load when cmder starts | |
:: call "%GIT_INSTALL_ROOT%/cmd/start-ssh-agent.cmd" /k exit | |
:: uncomment the next two lines to use pageant as the ssh authentication agent | |
:: SET SSH_AUTH_SOCK=/tmp/.ssh-pageant-auth-sock | |
:: call "%GIT_INSTALL_ROOT%/cmd/start-ssh-pageant.cmd" |
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
// https://stackoverflow.com/a/52501856/466693 | |
Array.prototype.myForEach = function(callback){ | |
this.forEach(function(r, i){ | |
console.log('>>>', arguments); | |
callback(r, i); | |
}); | |
}; |
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 80; | |
server_name YOUR_SERVERS_IP_ADDRESS; | |
location ~ ^/(js/|img/|css/) { | |
root /path/to/public/static/; | |
access_log off; | |
expires 24h; | |
} | |
location / { |
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
/* | |
https://github.com/adriancretu/beacons-android | |
*/ | |
package com.diewland.fake_beacons; | |
import android.app.Activity; | |
import android.os.Bundle; | |
import com.uriio.beacons.Beacons; | |
import com.uriio.beacons.model.EddystoneURL; | |
public class MainActivity extends Activity { |