Skip to content

Instantly share code, notes, and snippets.

View Logiraptor's full-sized avatar
👁️

Patrick Oyarzun Logiraptor

👁️
View GitHub Profile
@Logiraptor
Logiraptor / pong1.cpp
Last active August 29, 2015 14:00 — forked from anonymous/pong1.txt
#include <iostream>
#include <SDL2/SDL.h>
#include <SDL2/SDL_mixer.h>
#include <SDL2/SDL_image.h>
using namespace std;
SDL_Texture* LoadTexture(SDL_Renderer* render, const char* name);
bool processInput(bool b[4]);
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
# i3status configuration file.
# see "man i3status" for documentation.
# It is important that this file is edited as UTF-8.
# The following line should contain a sharp s:
# ß
# If the above line is not correctly displayed, fix your editor first!
general {
output_format = "i3bar"
#!/bin/bash
scrot /tmp/screen_locked.png
# convert /tmp/screen_locked.png -blur 0x6 /tmp/screen_locked.png
# convert /tmp/screen_locked.png -charcoal 5 /tmp/screen_locked.png
convert /tmp/screen_locked.png -blur 0x6 /tmp/screen_locked.png
i3lock -i /tmp/screen_locked.png
# Turn the screen off after a delay.
sleep 60; pgrep i3lock && xset dpms force off
@Logiraptor
Logiraptor / gist:e636e60a05e41980461c
Created April 10, 2015 14:28
Find all predicates satisfied by a value.
sleepy(micah).
sleepy(john).
dumb(micah).
retiring(radle).
has_micah(X) :-
%% Find a predicate of arity 1
current_predicate(X/1),
%% "Call" that predicate with micah
call(X, micah).
"use strict";
import ReactDOM from 'react-dom';
import React from 'react';
class App extends React.Component {
constructor(props) {
super(props)
this.state = {stateVal: 0};
}
// Ignore these imports
import React from 'react';
import ReactDOM from 'react-dom';
// Usage:
// 1. render a Popup anywhere in the app.
// 2. pass trigger and content props
// - trigger is the clickable element which shows/hides the content
// 3. register a global onClick listener **once** that calls Popup.hidePopups.
import * as sinon from "sinon";
import { Observable } from "../../lib/Rx";
export function doNothing<T>(): T {
const handler = {
get(target, name) {
return () => {};
},
};
return new Proxy({}, handler);
package main
import (
"database/sql"
"encoding/json"
"log"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
@Logiraptor
Logiraptor / main.ts
Created February 6, 2018 20:04
Failure reproduction
export function broken1(callback: (x: any) => void, value1: string) {
return callback(() => console.log(value1))
}
export function broken2(callback: any, value2: string) {
return callback(() => console.log(value2))
}
export function working(callback: (x: () => void) => void, value3: string) {
return callback(() => console.log(value3))