Skip to content

Instantly share code, notes, and snippets.

View x5engine's full-sized avatar
🎉
Winning

X5 Engine x5engine

🎉
Winning
View GitHub Profile
/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
@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?
@yask123
yask123 / whatsapp_sendMSG.js
Created January 24, 2015 17:08
Send messages on whatsapp by Javascript
document.getElementsByClassName("input")[1].innerHTML="This message was written via JS script! "; // Fills the text box message
var input = document.getElementsByClassName("icon btn-icon icon-send");//Grabs the send button
input[0].click();// Clicks the send button
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;
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
@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?
*/
@fliedonion
fliedonion / !javascript in bat file.md
Last active June 10, 2023 14:49
How to Embed Javascript code in Windows Bat File.
Summary One example for embed javascript into windows bat file without any external tools or files.
Env windows node.js jscript
var Col = require('react-bootstrap/lib/Col')
var PageHeader = require('react-bootstrap/lib/PageHeader')
var React = require('react')
var Row = require('react-bootstrap/lib/Row')
var {connect} = require('react-redux')
var {reduxForm} = require('redux-form')
var DateInput = require('./DateInput')
var FormField = require('./FormField')
var LoadingButton = require('./LoadingButton')

Why I hate TypeScript

Warning: These views are highly oppinated and might have some slightly incorrect facts. My experience with typescript was about 2 weeks in Node and a week in angular2.

Not Standard

TypeScript is implementing their own take on JavaScript. Some of the things they are writing will likely never make it in an official ES* spec either.

Technologies that have competing spec / community driven development have a history of failing; take: Flash, SilverLight, CoffeeScript, the list goes on. If you have a large code base, picking TypeScript is something your going to be living with for a long time. I can take a bet in 3 years JavaScript will still be around without a doubt.

Its also worth noting that they have built some things like module system and as soon as the spec came out they ditched it and started using that. Have fun updating!

@rcugut
rcugut / node-npm-install.md
Last active February 2, 2024 11:51 — forked from DanHerbert/fix-homebrew-npm.md
Install node & npm on Mac OS X with Homebrew

DEPRECATED as of macOS 10.13 (High Sierra). See the new GUIDE to install nvm and yarn for macOS (updated July 2019)

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

Solution

This solution fixes the error caused by trying to run npm update npm -g. Once you're finished, you also won't need to use sudo to install npm modules globally.