Skip to content

Instantly share code, notes, and snippets.

View juandesant's full-sized avatar

Juande Santander-Vela juandesant

View GitHub Profile
@derEremit
derEremit / gource-multiple-repositories.sh
Created November 8, 2011 14:58 — forked from anonymous/gource-multiple-repositories.sh
Generates gource video out of multiple repositories.
#!/usr/bin/env bash
# Generates gource video (h.264) out of multiple repositories.
# Pass the repositories in command line arguments.
# Example:
# <this.sh> /path/to/repo1 /path/to/repo2
RESOLUTION="1600x1080"
outfile="gource.mp4"
i=0
@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:

@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>
@juandesant
juandesant / Einstein's Riddle.pl
Created December 10, 2022 21:20
Solving Einstein's Riddle with Prolog
right_of(X, Y) :- X =:= Y+1.
left_of(X, Y) :- right_of(Y, X).
next_to(X, Y) :- right_of(X, Y).
next_to(X, Y) :- left_of(X, Y).
solution(Street) :-
/* There are 5 houses in the street, all of different colours;
and their owners all have different nationalities, smoke different brands,
have different pets, and have different drinks */
@jgilchrist
jgilchrist / einstein.pl
Last active December 10, 2022 20:33
A Prolog solution to Einstein's Riddle
right_of(X, Y) :- X is Y+1.
left_of(X, Y) :- right_of(Y, X).
next_to(X, Y) :- right_of(X, Y).
next_to(X, Y) :- left_of(X, Y).
solution(Street, FishOwner) :-
Street = [
house(1, Nationality1, Color1, Pet1, Drinks1, Smokes1),
house(2, Nationality2, Color2, Pet2, Drinks2, Smokes2),
@wildmichael
wildmichael / convertBibDeskLinks.m
Created October 28, 2010 15:07
Converts the Bdsk-File-X base64 encoded aliases created by BibDesk to normal file paths
@simonbs
simonbs / Slack Status.js
Last active November 23, 2021 02:37
Peforms OAuth flow against Slack and sets a Slack Status. Meant to be used with Shortcuts.
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: pink; icon-glyph: user;
// In order to use the script, you must create a Slack app and install it on your workspace. Go here to create your app: api.slack.com/apps
// There's two important configurations you must make to the app:
// 1. Add the users.profile:write scope to the app. This scope is necessary to set a Slack status.
// 2. Add the following redirect URL, so Slack will redirect to Scriptable after authorizing.
// https://open.scriptable.app
// Run the script to grant your newly created app authorization to access your Slack account. After you've done this, you can use the script in Shortcuts.
@jasonsnell
jasonsnell / airquality.scpt
Created August 26, 2020 17:50
Air Quality AppleScript
-- PurpleAir station ID
set theStationID to "6732"
tell application "JSON Helper"
set theWeather to (fetch JSON from ("https://www.purpleair.com/json?show=" & theStationID) with cleaning feed)
set theStatsA to (read JSON from (Stats of item 1 of results of theWeather))
set theStatsB to (read JSON from (Stats of item 2 of results of theWeather))
set theLocation to Label of item 1 of results of theWeather
set theLat to (Lat of item 1 of results of theWeather)
set theLon to (Lon of item 1 of results of theWeather)
@mlgill
mlgill / New reminder from Launchbar
Last active May 18, 2021 13:19 — forked from Jayphen/New reminder from Launchbar
A script for quickly adding reminders to the Reminders app in Mountain Lion from Launchbar and Alfred. Save this as a .scpt and drop it in ~/Library/Application\ Support/LaunchBar/Actions
--Script for setting Reminders for LaunchBar and Alfred
--For Alfred, Applescript must NOT be set to run in Background otherwise date parsing does not work
--For LaunchBar, place the script in ~/Library/Scripts/LaunchBar
--by Michelle L. Gill, 10/07/2012
--Inspired by https://gist.github.com/3187630
--A related Alfred version 2 workflow can be found here: https://github.com/mlgill/alfred-workflow-create-reminder
--Changes
--02/01/2013 * Fixed an issue with setting the time when the hour is 12 and AM/PM (12-hour clock) is used
-- * Removed the ability to set seconds for the time since Reminders doesn't recognize them
// AFNetworking
[[AFHTTPSessionManager manager] GET:@"http://httpbin.org/ip" parameters:nil success:^(NSURLSessionDataTask *task, id JSON) {
NSLog(@"IP Address: %@", JSON[@"origin"]);
} failure:^(NSURLSessionDataTask *task, NSError *error) {
NSLog(@"Error: %@", error);
}];
// NSURLSession
NSURL *URL = [NSURL URLWithString:@"http://httpbin.org/ip"];