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 os, os.path, time, urllib, urllib2, json, datetime | |
base = os.getcwd() + '/packages/' | |
apiUrl = 'https://atmospherejs.com/a/packages/findByNames' | |
for dirname in os.listdir(base): | |
max_mtime = 0 | |
if os.path.isdir(base + dirname): | |
packageName = dirname.replace('-', ':', 1) | |
for fname in os.listdir(base + dirname): | |
full_path = base + dirname + '/' + fname |
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
#!/usr/bin/env ruby | |
# Merge Audiobook MP3s | |
# This script will iterate through directories of audiobooks, | |
# combine the MP3 files and output the new file to a destination directory. | |
# | |
# Usage: ruby audiobook_merge.rb [SRC] [DEST] | |
# Example: ruby audiobook_merge.rb /audiobooks /audiobooks/combined | |
abort "Could not locate the 'cat' binary on your computer." if `which cat`.empty? |
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
downloadArquivo("./video.ogv", function(progresso, total, perc) { | |
document.querySelector("progress").value = perc; | |
}).then(function(arrayBuffer) { | |
//cria um Blob a partir do arrayBuffer | |
var blob = new Blob([arrayBuffer], { | |
type: "video/ogg" | |
}); | |
//cria o elemento video | |
var video = document.createElement("video"); | |
video.autoplay = true; |
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
if (Meteor.isServer) { | |
Meteor.startup(function () { | |
process.env.MAIL_URL = 'smtp://username:password@smtp.sendgrid.net'; | |
Accounts.emailTemplates.siteName = "My Website Name"; | |
Accounts.emailTemplates.from = "My Website Name <noreply@mywebsite.com>"; | |
Accounts.emailTemplates.resetPassword.subject = function(user) { | |
return "How to reset your password for My Website Name"; |
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
server { | |
server_name ipfs.my-domain-name.com; | |
listen [::]:4002 ssl ipv6only=on; | |
listen 4002 ssl; | |
ssl_certificate /etc/letsencrypt/live/ipfs.my-domain-name.com/fullchain.pem; # managed by Certbot | |
ssl_certificate_key /etc/letsencrypt/live/ipfs.my-domain-name.com/privkey.pem; # managed by Certbot | |
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot | |
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot | |
location / { | |
proxy_pass http://127.0.0.1:8081; |
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 React, { Component } from "react"; | |
import { AppRegistry, StyleSheet, Dimensions, Image, View, StatusBar, TouchableOpacity } from "react-native"; | |
import { Container, Text } from "native-base"; | |
import MapView from 'react-native-maps'; | |
import Polyline from '@mapbox/polyline'; | |
class LocationA extends Component { | |
constructor(props) { |
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
/* | |
- Go to the group chat settings and email yourself the chat log | |
(no attachments), use that txt here. | |
(You'll need an android phone or some tweaking of the regex on | |
line 11 to make this work.) | |
- You might also need to create a /us folder for the --export | |
option to work but let's not get ahead of ourselves here. | |
You still havent even sent yourself the log, have you? | |
*/ |
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
// Note this only shows the function being called in the parent component. The child component | |
// passes the event and contract address to the parent... I can make this more complete if requested... | |
uploadFile = async (event, contractAddress) => { | |
event.stopPropagation(); | |
event.preventDefault(); | |
const { web3, accounts } = this.state; |
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
// this allows to send arbitrary messages. The chat conversation you want to send messages to has to be open. | |
// just run this in the JS console | |
// http://stackoverflow.com/a/39165137/1249001 | |
function findChatComponent(dom) { | |
var result = null | |
for (var key in dom) { | |
if (key.startsWith("__reactInternalInstance$")) { | |
try { | |
result = dom[key].child.child.memoizedProps.children._owner.stateNode.props.chat |
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
// this allows to send arbitrary messages. The chat conversation you want to send messages to has to be open. | |
// just run this in the JS console | |
// http://stackoverflow.com/a/39165137/1249001 | |
function findReactComponent(dom) { | |
for (var key in dom) | |
if (key.startsWith("__reactInternalInstance$")) { | |
var compInternals = dom[key]._currentElement; | |
var compWrapper = compInternals._owner; | |
var comp = compWrapper._instance; |
OlderNewer