Skip to content

Instantly share code, notes, and snippets.

View keybase.md

Keybase proof

I hereby claim:

  • I am kaeruct on github.
  • I am kaeruct (https://keybase.io/kaeruct) on keybase.
  • I have a public key whose fingerprint is BF9E 3EFB 4677 898C F631 CB80 C6DA 1A18 34DE DE53

To claim this, I am signing this object:

@KaeruCT
KaeruCT / .conkyrc
Created Jun 5, 2014
new conky config
View .conkyrc
# Conky Google Now style #
# Conky settings #
background yes
update_interval 1
double_buffer yes
no_buffers yes
format_human_readable yes
# Window specifications #
@KaeruCT
KaeruCT / yt-js-api-example.html
Created May 23, 2014
Playing music in the background using the Youtube JS API
View yt-js-api-example.html
<!DOCTYPE html>
<html>
<body>
<div id="player" style="position: absolute; top: -9999px; left: -9999px;"></div>
<div id="info">loading...</div>
<script src="http://www.youtube.com/player_api"></script>
<script>
var info = document.getElementById('info');
function onYouTubePlayerAPIReady() {
var player = new YT.Player('player', {
View gist:11333134
javax.persistence.EntityNotFoundException: Unable to find com.gangfive.sima.ejb.Nutricionista with id 88org.hibernate.ejb.Ejb3Configuration$Ejb3EntityNotFoundDelegate.handleEntityNotFound(Ejb3Configuration.java:155)org.hibernate.proxy.AbstractLazyInitializer.checkTargetState(AbstractLazyInitializer.java:261)org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:175)org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:285)org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:185)com.gangfive.sima.ejb.Nutricionista_$$_javassist_7.getId(Nutricionista_$$_javassist_7.java)com.gangfive.sima.pojo.UsuarioPOJO.<init>(UsuarioPOJO.java:28)com.gangfive.sima.pojo.NutricionistaPOJO.<init>(NutricionistaPOJO.java:26)com.gangfive.sima.pojo.RetoPOJO.setNutricionista(RetoPOJO.java:161)com.gangfive.sima.pojo.RetoPOJO.<init>(RetoPOJO.java:48)com.gangfive.sima.controllers.RetosController.findByUsuario(RetosController.java:
View syncmusic.sh
rsync -avz --delete Music/ /media/andres/iwayo/music/
View c.js
// six(dividedBy(two())) == 3
var self = this;
['zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine'].forEach(function (el, i) {
self[el] = (function (i) {
return function (op) {
return op ? op(i) : i;
};
}(i));
});
@KaeruCT
KaeruCT / noise.py
Created Jan 8, 2014
./noise.py | aplay --channels=2 --rate=22500
View noise.py
#!/usr/bin/env python2
# ./noise.py | aplay --channels=2 --rate=22500
import sys
import math
import random
TEMPO=1000
def p(i):
View url-builder.js
(function (exports, undefined) {
var baseUrl,
resourceMap,
type;
exports.ub = {
init: function (options) {
baseUrl = options.baseUrl;
type = options.type;
resourceMap = options.resourceMap;
View gist:7977254
#!/usr/bin/php
<?php
class Gasm { private $code = []; private $pc = 0; private $code_start = 0; private $code_len = 0; private $vars = []; private $labels = []; private $stack = []; private $comparison = false; private function line_number() { return 1 + $this->code_start + $this->pc; } private function strip_comments($line) { return trim(preg_replace('%;(.*)$%m', '', $line)); } private function is_label ($line) { return substr($line, -1) === ':'; } private function parse_line($line) { return array_map('trim', preg_split('%\s%', $line, 2)); } private function parse_args($args) { return array_map('trim', preg_split('%,%', $args)); } private function eval_expression($exp) { $matches = []; $ops = [ '+' => function ($a, $b) {return $a + $b;}, '-' => function ($a, $b) {return $a - $b;}, '*' => function ($a, $b) {return $a * $b;}, '/' => function ($a, $b) {return $a / $b;}, '%' => function ($a, $b) {return $a % $b;}, ]; $literals = [ '\n' => "\n", '\t' => "\t" ]; $ifx = '/(\w+)\s*(['.preg_quote(implode('', array_ke
View stacky.php
#!/usr/bin/php
<?php
if (empty($argv[1])) {
die("please specify a file\n");
}
function is_str($word) {
return preg_match('%^".*"$%', $word);
}