This file contains 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
takePicture = async () => { | |
let result = await ImagePicker.launchCameraAsync({ | |
allowsEditing: true, | |
aspect: [4, 3], | |
}); | |
if (!result.cancelled) { | |
// Probably not all necessary, but good to have to do stuff with | |
const context = this; | |
const file = result.uri; |
This file contains 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
/* | |
* Using Request to generate Facebook messenger codes | |
*/ | |
const request = require('request'); | |
const token = 'FB_TOKEN'; | |
// Request options (pretty standard) | |
const options = { | |
url: 'https://graph.facebook.com/v2.6/me/messenger_codes?access_token='+token, | |
method: 'POST', |
This file contains 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
/* | |
* Calculates the distance between 2 lat/lng points provided as decimals. | |
* Can be used with copy & pasted values in Google Maps. | |
*/ | |
calculateDistance(lat1, lon1, lat2, lon2) { | |
const theta = lon1 - lon2; | |
const unit = "K"; // kilometer | |
// Do the sin/cos calculation | |
let dist = Math.sin(this.deg2rad(lat1)) * Math.sin(this.deg2rad(lat2)) + Math.cos(this.deg2rad(lat1)) * Math.cos(this.deg2rad(lat2)) * Math.cos(this.deg2rad(theta)); |
This file contains 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
/* | |
* Getting the distance between 2 lat/lng position in Java | |
*/ | |
private double distance(double lat1, double lon1, double lat2, double lon2, char unit) { | |
double theta = lon1 - lon2; | |
double dist = Math.sin(deg2rad(lat1)) * Math.sin(deg2rad(lat2)) + Math.cos(deg2rad(lat1)) * Math.cos(deg2rad(lat2)) * Math.cos(deg2rad(theta)); | |
dist = Math.acos(dist); | |
dist = rad2deg(dist); | |
dist = dist * 60 * 1.1515; |
This file contains 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 random import randint | |
import math | |
numbers = [] | |
start = 111111111 | |
end = 999999999 | |
amount = 4000000 | |
ticker = 0 | |
step = math.floor((end - start) / amount) | |
thefile = open('newnumbers.csv', 'w') |
This file contains 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 string | |
svgFile = 'pattern.svg' | |
svgFileNew = 'pattern1.svg' | |
with open(svgFile) as f: | |
thefile = open(svgFileNew, 'w') |
This file contains 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
const fs = require('fs'); | |
const PDFDocument = require('pdfkit'); | |
const SVGtoPDF = require('svg-to-pdfkit'); | |
const express = require('express'); | |
const promise = require('bluebird'); | |
const formidable = require('formidable'); | |
const http = require('http'); | |
const https = require('https'); | |
const util = require('util'); | |
const app = express(); |
This file contains 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
image: node:7.10.1 | |
pipelines: | |
default: | |
- step: | |
script: | |
- node -v | |
- npm install | |
- apt-get update | |
- apt-get install -y lftp | |
- lftp -u USERNAME,PASSWORD FTPDOMAIN -e "mirror -e -R -p ./dist/ public_html ; quit" |
This file contains 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
image: node:7 | |
before_script: | |
- npm install | |
- apt-get update | |
- apt-get install -y lftp | |
cache: | |
paths: | |
- node_modules/ |
This file contains 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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>items</key> | |
<array> | |
<dict> | |
<key>assets</key> | |
<array> | |
<dict> |