Skip to content

Instantly share code, notes, and snippets.

View rschwarz's full-sized avatar

Robert Schwarz rschwarz

View GitHub Profile
using Luxor
function jump_circles()
setline(12)
setlinecap("round")
line(Point(20, 68), Point(120, 28), :stroke)
line(Point(4, 120), Point(120, 4), :stroke)
pts = box(Point(86, 84), 40, 40, vertices=true)
@layer begin
sethue(Luxor.julia_red)
@odow
odow / simple_jump.jl
Last active September 30, 2019 08:47
using JuMP, Ipopt
function minimize(
f::Function,
A::Matrix,
b::Vector,
optimizer::JuMP.OptimizerFactory
)
M, N = size(A)
@assert length(b) == M
@rschwarz
rschwarz / example_session.log
Created February 25, 2019 20:21
MWE for non-deterministic behavior of Julia with ccall, compared to equivalent(?) C code
$ julia
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.1.0 (2019-01-21)
_/ |\__'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tkaewplik
tkaewplik / new_forloop.cpp
Last active February 1, 2018 03:29
New For Loop
void
forloop_structures::iinit()
{
// INTERMEDIATE
// NEED TEMP
// INITIAL LOCALS
@tkaewplik
tkaewplik / forloop.as
Created January 30, 2018 11:30
For loop
package
{
import flash.display.Sprite;
import flash.utils.getTimer;
public class forloop_structures extends Sprite
{
public function forloop_structures(){
@eirikb
eirikb / clicktest.md
Last active April 9, 2021 16:49
Automated click testing in bash

About

This is a bash script, as an example, on how to do click-testing GUI based on finding components based on how they look.

Dependencies

@isaactzab
isaactzab / download-mp3-youtube-dl.md
Last active August 4, 2023 03:12
Install YouTube-DL in Ubuntu/Linux Mint and Debian

#How to download an MP3 track from a YouTube video You can also download the mp3 directly from youtube without converting using ffmpeg

youtube-dl --extract-audio --audio-format mp3 <video URL>

From the online help:

-x, --extract-audio        convert video files to audio-only files (requires
                           ffmpeg or avconv and ffprobe or avprobe)
@noamraph
noamraph / byzanz_window.py
Created January 10, 2014 08:24
byzanz_window: Use byzanz to create a GIF screencast of a specific window
#!/usr/bin/env python
"""
Use byzanz to create a GIF screencast of a specific window.
Required tools:
sudo apt-get install byzanz x11-utils xdotool
A tip: use an extra-long duration (-d 100), record your shot, and use
gimp to shorten the duration of the last frame. You need to rename the layer
from "Frame 123 (100000 ms) (combine)" to "Frame 123 (1000 ms) (combine)".
@bayan
bayan / gist:3382884
Created August 17, 2012 21:27
Clojure DSL to generate static HTML
;; Generating static HTML using Clojure macros
;; It is possible to write a DSL in Clojure that generates HTML markup without the need to write a separate parser and compiler (e.g. HAML).
;; Our aim here would be to write code that converts the following Clojure code into the HTML below it
;; (html
;; (head)
;; (body
;; (h1 "An example")