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
| var gulp= require('gulp'); | |
| var sass = require('gulp-sass'); | |
| var browserSync = require('browser-sync').create(); | |
| var cssnano = require('gulp-cssnano'); | |
| var rename = require('gulp-rename'); | |
| var uglify = require('gulp-uglify'); | |
| var concat = require('gulp-concat'); | |
| var imagemin = require('gulp-imagemin'); |
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
| class String | |
| def red | |
| "\e[31m#{self}\e[0m" | |
| end | |
| def green | |
| "\e[32m#{self}\e[0m" | |
| end | |
| def yellow |
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
| from selenium import webdriver | |
| from selenium.webdriver.support.ui import WebDriverWait | |
| from selenium.webdriver.support import expected_conditions as EC | |
| from selenium.webdriver.common.by import By | |
| from selenium.common.exceptions import TimeoutException | |
| driver = webdriver.Chrome() | |
| url = "http://www.fgc.cat/cat/index.asp" |
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
| AREA_CODES = { | |
| Marbella: [822], Badajoz:[ 824, 924], Guipuzcoa: [843,943], | |
| Navarra: [848, 948], Granada: [858, 958], Murcia: [868, 968], Baleares:[871, 971], | |
| Gerona: [872, 972], Lerida:[ 873, 973],Zaragoza: [876, 976], | |
| Tarragona:[877, 977], Pontevedra: [886, 986], Madrid: [911, 912, 913, 914, 915, 916, 917, 918], | |
| Segovia: [921], Salamanca: [923], Toledo: [925], Ciudad_Real: [926], Caceres: [927], | |
| Barcelona: [931, 932, 933, 934, 935, 936, 937, 938], La_Rioja: [941], Cantabria: [942], | |
| Vizcaya: [944, 946], Alava: [945], Burgos: [947], Guadalajara: [949], Almeria: [950], | |
| Malaga: [951, 952], Jaen: [953], Sevilla: [954, 955], Cordoba: [957], Huelva: [959], | |
| Valencia: [960, 961, 962, 963], Alicante: [965, 966], Albacete: [967], Cuenca: [969], |
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
| class PhoneGenerator | |
| def self.generate_landline | |
| area_code = AREA_CODES.values.sample | |
| if area_code.is_a?(Array) | |
| area_code = area_code.sample | |
| end | |
| create_phone(area_code, six_digit_extension) | |
| end | |
| def self.generate_mobile |
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
| defmodule AreaCode do | |
| @moduledoc """ | |
| Returns map of provinces with corresponding area codes as a list | |
| """ | |
| def codes_by_province do | |
| %{ | |
| marbella: [822], badajoz: [ 824, 924], guipuzcoa: [843,943], | |
| navarra: [848, 948], granada: [858, 958], murcia: [868, 968], baleares: [871, 971], | |
| gerona: [872, 972], lerida: [ 873, 973], zaragoza: [876, 976], |
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
| SELECT table_name,(data_length+index_length)/power(1024,3) tablesize_gb | |
| FROM information_schema.tables | |
| WHERE table_schema='database_name' | |
| ORDER BY (data_length+index_length)/power(1024,3) DESC |
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 | |
| f = open('filename.csv', "rt") | |
| reader = csv.reader(f) | |
| row_count = 0 | |
| for row in reader: | |
| if #do something with row get columns with row[index]: |
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
| axios.put(this.apiBaseEndpoint + '/' + id, input) | |
| .then((response) => { | |
| // Success | |
| }) | |
| .catch((error) => { | |
| // Error | |
| if (error.response) { | |
| // The request was made and the server responded with a status code | |
| // that falls out of the range of 2xx | |
| // console.log(error.response.data); |
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
| live_loop :effects do | |
| with_fx :reverb, mix: 0.7, room: 0.5 do | |
| play 20, pan: -1 | |
| sleep 0.5 | |
| play 22, pan: 1 | |
| end | |
| end | |
| live_loop :prog do | |
| sample :bd_haus, rate: 2 |
OlderNewer