This file contains hidden or 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
function extractFirstThreeTitles(html) { | |
const regex = /<a href="FichaPelicula\.asp\?id=\d+"[^>]*>(.*?)<\/a>/g; | |
let titles = []; | |
let match; | |
while ((match = regex.exec(html)) !== null && titles.length < 3) { | |
titles.push(match[1]); | |
} |
This file contains hidden or 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
// Read parameter from widget | |
let parameter = args.widgetParameter | |
var parameters = ""; | |
if (parameter) parameters = parameter.split(";") | |
else | |
{ | |
// If no parameters were found, ask the user to put them | |
let w = new ListWidget() | |
error = w.addText("Introduce tu cuenta y token de IndexaCapital separados por un ; en la configuración del Widget") | |
error.font = new Font("Avenir-Book", 11) |
This file contains hidden or 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
require 'Matrix' | |
class Matrix | |
public :"[]=", :set_element, :set_component | |
end | |
# Prints de Matrix | |
def print_matrix(m) | |
puts "----------" | |
print m[0,0] ? 1 : 0, " ", m[0,1] ? 1 : 0, " ", m[0,2] ? 1 : 0 |
This file contains hidden or 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
function snapshot() { | |
// Assign 'today' today's date. | |
var today = Utilities.formatDate(new Date(), "GMT+1", "dd/MM/yyyy"); | |
// Assign 'dashboard' the Dashboard sheet. | |
var dashboard = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Dashboard'); | |
// Assign 'new_row' the first available row to write in. | |
var new_row = dashboard.getLastRow() + 1; |
This file contains hidden or 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
function! ToggleSyntax() | |
if exists("g:syntax_on") | |
syntax off | |
else | |
syntax enable | |
endif | |
endfunction | |
nmap <silent> ;s :call ToggleSyntax()<CR> |
This file contains hidden or 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
require 'hue' | |
require 'RMagick' | |
require 'ColorMath' | |
$path = "tmp/out.jpg" | |
$client = Hue::Client.new | |
def lights(h,s,l) | |
$client.lights.each do |light| | |
light.on! | |
light.hue = ((h/360)*65535).round |
This file contains hidden or 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
console.log('Simply.js demo!'); | |
simply.on('singleClick', function(e) { | |
console.log(util2.format('single clicked $button!', e)); | |
simply.subtitle('Has premut ' + e.button + '!'); | |
}); | |
simply.on('longClick', function(e) { | |
console.log(util2.format('long clicked $button!', e)); | |
simply.vibe(); |
This file contains hidden or 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 csv | |
import sys | |
import mechanize | |
import cookielib | |
import re | |
import time | |
# Creates a Browser instance | |
# and defines its headers | |
def createBrowser(): |
This file contains hidden or 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 re | |
import os.path | |
import datetime | |
import os | |
import time | |
# Path to the minecraft statistics file | |
mine_path = "FULL_PATH_TO_/stats_user_unsent.dat" |
This file contains hidden or 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
# Position where the first character of a name is found in each line | |
start = 19 | |
# File containing the watsapp conversation | |
file_name = "watext.txt" | |
def get_name(line): | |
end = line.find(":", start) | |
return line[start:end] |
NewerOlder