This file contains 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
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEngine.XR.ARFoundation; | |
using UnityEngine.XR.ARSubsystems; | |
// This script is inspired by: | |
// https://www.youtube.com/watch?v=x08UU-I8eZ8&list=PLw3UgsOGHn4loDyxHG75eJxSnxxVgB-Yb&index=5&t=0s | |
// video Getting Started With ARFoundation in Unity (ARKit, ARCore): https://www.youtube.com/watch?v=Ml2UakwRxjk&list=WL&index=4 | |
[RequireComponent(typeof(ARRaycastManager))] |
This file contains 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 React from "react"; | |
import { ActionMeta, ValueType } from "react-select"; | |
import CreatableSelect from "react-select/creatable"; | |
type CreatableMultiSelectProps = { | |
options: Set<string>; // available choices | |
values: Set<string>; // current selections | |
onChange: (values: Set<string>) => void; | |
}; |
This file contains 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 java.io.*; | |
import org.apache.poi.xslf.usermodel.XMLSlideShow; | |
import org.apache.poi.POIXMLProperties.*; | |
import org.apache.poi.xslf.usermodel.*; | |
public class HelloPoi { | |
public static void main(String[] args) { | |
This file contains 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
function batchDelete() { | |
var batchSize = 10; // Process up to 10 threads at once | |
for (i = 175; i > 0; i--) { | |
var threads = GmailApp.search('label:outbound older_than:' + i + 'd'); | |
for (j = 0; j < threads.length; j += batchSize) { | |
GmailApp.moveThreadsToTrash(threads.slice(j, j+batchSize)); | |
// Logger.log('finished move %d', j); | |
} | |
} | |
} |
This file contains 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
'use strict'; | |
function toDecimal(A) { | |
var sum = 0; | |
for (var i = 0; i < A.length; i++) { | |
sum += A[i] * Math.pow(-2, i); | |
} | |
return sum; | |
} |
This file contains 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 math | |
values = [ | |
True, False, 1, 0, -1, "true", "false", "1", "0", "-1", "", None, math.inf, -math.inf, [], {}, [[]], [0], [1] | |
] | |
print("Truth Table") | |
print("-----------") | |
for value in values: | |
print(f"\t", end="") |
This file contains 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
# 1. Clunky lambda syntax | |
numbers = [1, 2, 3] | |
# don't do this... | |
doubled = list(map(lambda n: n * 2, numbers)) | |
# There's no way to define the end of the block except that comma. What about wrapping lines? | |
# better for this case | |
doubled = [n * 2 for n in numbers] |
This file contains 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 url = "http://twitter.com/status/user_timeline/adamloving.json?count=10&callback=?"; | |
$.getJSON( url, function( data ){ console.log(data) }); |
This file contains 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
# on macOS, put this in ~/.config/flake8 | |
[flake8] | |
max-line-length=88 | |
ignore= | |
#E302 expected 2 blank lines, found 1 | |
E302, | |
#E261 at least two spaces before inline comment | |
E261, | |
# E401 multiple imports on one line | |
E401, |
This file contains 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 ProjectForm = React.createClass({ | |
getInitialState: function() { | |
return { headerText: 'nothing' } | |
}, | |
handleToggleChange: function(value) { | |
this.setState({ headerText: value.toUpperCase() }) | |
}, | |
render: function() { | |
return ( | |
<form> |