Skip to content

Instantly share code, notes, and snippets.

View x5engine's full-sized avatar
🎉
Winning

X5 Engine x5engine

🎉
Winning
View GitHub Profile
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
@ziadoz
ziadoz / audiobook_merge.rb
Last active September 21, 2017 13:38
Audiobook MP3 Merger
#!/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?
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;
@aaronthorp
aaronthorp / mail-sendgrid.js
Last active November 9, 2017 03:23
SMTP via SendGrid using Email package with Meteor
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";
@carsonfarmer
carsonfarmer / default
Created June 18, 2018 22:59
Nginx config
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;
@princessjanf
princessjanf / locationA.js
Last active October 26, 2019 08:06
Final Code For React Native's Geolocation
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) {
@walaura
walaura / gist:5752f1d36d0707b431d3
Last active March 18, 2020 17:10
Get the most used words from whatsapp chat logs by person/global
/*
- 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?
*/
@0xCourtney
0xCourtney / App.js
Created August 13, 2018 01:51
Uploads file to IPFS via Infura
// 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;
@hamrammi
hamrammi / whatsapp-send-in-current-chat.js
Last active March 22, 2020 13:47 — forked from EyMaddis/whatsapp-send-in-current-chat.js
Sending messages programmatically on web.whatsapp.com
// 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
@EyMaddis
EyMaddis / whatsapp-send-in-current-chat.js
Created November 4, 2016 12:50
Sending messages programmatically on web.whatsapp.com
// 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;