Skip to content

Instantly share code, notes, and snippets.

@p13i
p13i / JSON.swift
Created February 15, 2018 22:02
Simple JSON wrapper for Foundation's JSONEncoder and JSONDecoder
//
// JSON.swift
//
// Created by Pramod Kotipalli on 11/1/17.
// Copyright © 2017 Pramod Kotipalli. All rights reserved.
//
import Foundation
public class JSON {
@fatso83
fatso83 / format-code.gs
Last active August 25, 2021 20:46
Styles a paragraph as code. When adding this script using the Google Docs script editor it will appear under a new menu called "Extras"
// is called by google docs when a document is open
// adds a menu with a menu item that applies a style to the currently selected text
function onOpen() {
DocumentApp.getUi()
.createMenu('Extras')
.addItem('Apply code style', 'applyCodeStyle')
.addToUi();
}
var backgroundColor = "#DDDDDD";
@ricalo
ricalo / .bashrc
Last active December 26, 2022 09:45
Use git-bash from Android Studio terminal
if [ ! -z "${IDE}" -a "${IDE}" == "AndroidStudio" ]; then
cd $OLDPWD;
fi
@darryl-davidson
darryl-davidson / App.js
Created December 4, 2019 00:51
Example Expo 35 App that registers Background Fetch and Location Updates
import React, { useEffect } from "react";
import { StyleSheet, Text, View } from "react-native";
import * as BackgroundFetch from "expo-background-fetch";
import * as TaskManager from "expo-task-manager";
import * as Permissions from "expo-permissions";
import * as Location from "expo-location";
import { Notifications } from "expo";
import { Button } from "react-native";
const LOCATION_FETCH_TASK = "upload-job-task-with-location";
@physacco
physacco / README.md
Last active December 27, 2023 09:05
Python 3 extension example

Python 3 extension example

Build

python3 setup.py build

Output: build/lib.macosx-10.11-x86_64-3.5/hello.cpython-35m-darwin.so

Run

/** * @OnlyCurrentDoc */
function autofill() {
// get active sheet
var sheet = SpreadsheetApp.getActiveSheet();
// get last row of data for later pasting into
var lastRow = sheet.getLastRow();
@laramiel
laramiel / wwu_schedule.py
Last active March 8, 2024 18:07
A python script to fetch available class slots for WWU schedule generation
#!/usr/bin/env python3
#
'''
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
WWU Schedule Generator
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This requires python; it's probably easiest to run on linux or WSL.
First install the prerequisites: