Skip to content

Instantly share code, notes, and snippets.

View SergioCrisostomo's full-sized avatar

Sergio Crisostomo SergioCrisostomo

View GitHub Profile
// only tested with 1 channel wav file
const { OpusEncoder } = require('@discordjs/opus');
let fs = require('fs');
wav_file = fs.readFileSync('somefile.wav');
const WaveFile = require('wavefile').WaveFile;
let wav = new WaveFile(wav_file);
@SergioCrisostomo
SergioCrisostomo / writeInGithub.js
Last active May 28, 2020 07:19 — forked from WebReflection/writeInGithub.js
a silly script to write in your github timeline
function write(text, colors, start) {
const AGFont = {
"0": "40123478bcfgjknopqr",
"32": "4",
"33": "1012346",
"34": "3023568",
"35": "568abcdegiklmnoqs",
"36": "5123579acghimoprtvwx",
"37": "514579bdhlnprtux",
"38": "5157bfhjknopsvwy",
function makeBody(to, from, subject, message) {
var btoa = require('btoa');
var str = ["Content-Type: text/plain; charset=\"UTF-8\"\n",
"MIME-Version: 1.0\n",
"Content-Transfer-Encoding: 7bit\n",
"to: ", to, "\n",
"from: ", from, "\n",
"subject: ", subject, "\n\n",
message
].join('');
@SergioCrisostomo
SergioCrisostomo / transform.js
Last active September 7, 2015 20:06 — forked from kentaromiura/transform.js
MooTools Class to ES 2015
module.exports = function(file, api) {
var j = api.jscodeshift;
var root = j(file.source);
root.find(j.Identifier).forEach(function(p) {
if(p.value.name === 'Class') {
if(p.parentPath.name === 'init'){
var classDefinition = p.parentPath.value.arguments[0];
var varname = p.parentPath.parentPath;
var name = varname.value.id;
var target = varname.parentPath.parentPath
/*
---
name: Slick.Finder
description: The new, superfast css selector engine.
provides: Slick.Finder
requires: Slick.Parser
...
*/
(function(){
/*
---
name: Slick.Finder
description: The new, superfast css selector engine.
provides: Slick.Finder
requires: Slick.Parser
...
*/
(function(){
<?php
success: function (resposta) {
resposta = JSON.parse(resposta);
console.log(resposta);
if (resposta[0]) paraRemover.each(function(){
this.tr.remove();
}
alert(resposta[1]);
}

saw this artcile quoting 10 reasons why jquery is better than mootools. source: http://www.jquery4u.com/articles/jquery-mootools/

jQuery has better mobile support than Mootools – the latest release of jQuery Mobile Alpha 3 has been a breakthrough in how easy it can be to get your website “mobile efficient”. Mootools has mobile support including touch events but it’s not as widely available as jQuery options. (#1 was Previously jQuery vs Mootools filesizes).

not true. see http://moobilejs.com/

jQuery is less confusing than Mootools! – It has less native extensions (including element) – jQuery has about a dozen for Array, Object, and String and Mootools has about six dozen for Array, Object, String, Function, and Number.

how is less power and methods a good thing? the reason why mootools has more native methods is because it also shims browsers that lack ES5 functionality for all the natives that it extends. if anything, this goes against jquery.

define(['jquery', 'text!some_template.html'], function($, html) {
// this will not work: window.__html__ will be undefined!
// var html = window.__html__['/base/some_template.html'];
/**
* Test case:
* Let requirejs-text load the assets.
*/
describe('It', function() {
/**
* Sinon.JS 1.8.3, 2014/03/04
*
* @author Christian Johansen (christian@cjohansen.no)
* @author Contributors: https://github.com/cjohansen/Sinon.JS/blob/master/AUTHORS
*
* (The BSD License)
*
* Copyright (c) 2010-2014, Christian Johansen, christian@cjohansen.no
* All rights reserved.