Skip to content

Instantly share code, notes, and snippets.

View xavicolomer's full-sized avatar

Xavi Colomer xavicolomer

View GitHub Profile
// Keyboard
sudo dpkg-reconfigure keyboard-configuration
// WiFi
sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
network={
ssid="SchoolNetworkSSID"
psk="passwordSchool"
id_str="school"
let realmItems = nextProps.items || []
let start = new Date()
let finish = new Date()
let a = []
// items.length = 479
for (let i = 0, len = realmItems.length; i < len; ++i) {
// Option A
a.push({name: 'item_name' + Math.round(Math.random() * 100), category: {name: 'category_name ' + i, image: 'image_name'}})
a = [1,3,5,2,1,3,5,2,2,5,6,5,25,7,2,1,3,5,2,2,2,5,7,2,1,3,5,2,5]
b = [2,2,5]
indexes = []
for i in range(len(a)):
if a[i:i+len(b)] == b:
indexes.append((i, i+len(b)))
print(indexes)
@xavicolomer
xavicolomer / template.php
Last active August 3, 2016 09:15
Drupal n-level submenus working with Zurb Foundation 5
/**
* This snippet should replace the old 'zurb_foundation_links__system_main_menu' found on template.php inside the zurb-foundation theme
/*
/**
* Implements theme_links() targeting the main menu specifically
* Outputs Foundation Nav bar http://foundation.zurb.com/docs/navigation.php
*
*/
function zurb_foundation_links__system_main_menu($vars) {