Skip to content

Instantly share code, notes, and snippets.

View juandesant's full-sized avatar

Juande Santander-Vela juandesant

View GitHub Profile
@skreutzberger
skreutzberger / calliCloudUserIDAsync.swift
Created November 27, 2015 09:07
use iCloudUserIDAsync
import CloudKit
iCloudUserIDAsync() {
recordID, error in
if let userID = recordID?.recordName {
print("received iCloudID \(userID)")
} else {
print("Fetched iCloudID was nil")
}
}
@ethanyzhang
ethanyzhang / scidb-install.txt
Last active January 25, 2018 15:00
Install SciDB
scp yzhang@linux04.cs.uh.edu:~/packages/scidb-15.7.0.9267.tgz ./
tar -xzf scidb-15.7.0.9267.tgz
mv scidb-15.7.0.9267/ scidbtrunk
sudo apt-get update
sudo apt-get -y install subversion expect openssh-server openssh-client
# The following environment variables should go into ~/.bashrc
export SCIDB_VER="15.7"
export SCIDB_SOURCE_PATH="/home/scidb/scidbtrunk"
package com.jamasoftware.search.util.analyzer;
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
@gruber
gruber / Battery Test — Safari.scpt
Last active January 18, 2021 17:35
A simple test to load a series of web pages in Safari repeatedly until the battery runs out.
on run
set imessage_id to "" -- leave blank to skip sending periodic iMessage progress updates, put your iMessage ID here to get updates as the script runs
set delay_seconds to 5 -- Don't set to 0, it runs too fast. 0.75 is a good setting for "go fast".
set computer_name to do shell script "scutil --get ComputerName"
set os_version to do shell script "sw_vers -productVersion"
set os_build to do shell script "sw_vers -buildVersion"
set _uptime to do shell script "uptime"
set url_list to {"http://techmeme.com", "http://www.consumerreports.org/laptops/macbook-pros-fail-to-earn-consumer-reports-recommendation/", "https://twitter.com/panzer/status/812367550734401536", "http://www.politico.com/story/2016/12/foreign-travelers-social-media-232930", "http://www.macworld.com/article/3153384/gaming/nintendo-plans-to-release-2-or-3-mobile-games-a-year-after-super-mario-runs-success.html", "http://www.wsj.com/articles/cyber-experts-cite-link-between-dnc-hacks-and-aggression-against-uk
@gruber
gruber / Battery Test — Chrome.scpt
Last active April 22, 2024 08:33
A simple test to load a series of web pages in Chrome on MacOS repeatedly until the battery runs out.
on run
set imessage_id to "" -- leave blank to skip sending periodic iMessage progress updates, put your iMessage ID here to get updates as the script runs
set delay_seconds to 5 -- Don't set to 0, it runs too fast. 0.75 is a good setting for "go fast".
set computer_name to do shell script "scutil --get ComputerName"
set os_version to do shell script "sw_vers -productVersion"
set os_build to do shell script "sw_vers -buildVersion"
set _uptime to do shell script "uptime"
set url_list to {"http://techmeme.com", "http://www.consumerreports.org/laptops/macbook-pros-fail-to-earn-consumer-reports-recommendation/", "https://twitter.com/panzer/status/812367550734401536", "http://www.politico.com/story/2016/12/foreign-travelers-social-media-232930", "http://www.macworld.com/article/3153384/gaming/nintendo-plans-to-release-2-or-3-mobile-games-a-year-after-super-mario-runs-success.html", "http://www.wsj.com/articles/cyber-experts-cite-link-between-dnc-hacks-and-aggression-against-uk
@sforteln
sforteln / MemoizationWithGenerics
Created July 4, 2017 13:26
Simple Swift Function to memoize generic functions of the form T -> U
func memoize<T: Hashable,U>(function: @escaping (T) -> U) -> (T) -> U{
var cache : [T:U] = [:]
func memoWrapper(input: T) -> U {
if let cacheValue = cache[input] {
print("used cached result")
return cacheValue
}
let newVal = function(input)
cache[input] = newVal
print("new result")
@ryerh
ryerh / jekyll-and-liquid.md
Created April 16, 2018 15:35 — forked from magicznyleszek/jekyll-and-liquid.md
Jekyll & Liquid Cheatsheet

Jekyll & Liquid Cheatsheet

A list of the most common functionalities in Jekyll (Liquid). You can use Jekyll with GitHub Pages, just make sure you are using the proper version.

Running

Running a local server for testing purposes:

@StuartLittlefair
StuartLittlefair / astropy_speedups.py
Last active May 18, 2020 17:10
Speedups for astropy coordinate transformations with >1000s of obstimes (works best for roughly regular spaced grid of obstimes)
"""
Contains some faster coordinate transformations than the ones currently used in astropy.
This is based on an idea put forward by @bwinkel in the pull request located at
at https://github.com/astropy/astropy/pull/6068. This may be merged into the astropy
master at some point. If this happens, this module can be removed.
Simply import into code to experience the speedups; the astropy coordinate transforms are
overwritten on modeul import.
"""
@juandesant
juandesant / atlassian_api_confluence.py
Last active July 28, 2023 14:48
Confluence API examples
from atlassian import Confluence # requires atlassian-python-api
cf_user = os.environ['CONFLUENCE_USER'] # requires environment variable
cf_pwd = os.environ['CONFLUENCE_PWD']
cf_url = os.environ['CONFLUENCE_URL']
cf_space = os.environ['CONFLUENCE_SPACE']
# Content preparation
my_title = "Testing Confluence API"
html_body = """<p>Paragraph 1</p>
<p>Paragraph 2</p>