Skip to content

Instantly share code, notes, and snippets.

View Logiraptor's full-sized avatar
👁️

Patrick Oyarzun Logiraptor

👁️
View GitHub Profile
// 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.
"use strict";
import ReactDOM from 'react-dom';
import React from 'react';
class App extends React.Component {
constructor(props) {
super(props)
this.state = {stateVal: 0};
}
@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).
#!/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
# 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"
# 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!
@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]);