Skip to content

Instantly share code, notes, and snippets.

@NeoCat
NeoCat / gist:a6189f245347581d608c
Created January 20, 2015 22:50
twicli CSS - Don't enlarge thumbnails on hover & enlarge thumbnails when selected
/* twicliの設定→ユーザスタイルシートに下記をペーストして保存 */
/* サムネールをマウスオーバーで拡大しない */
.thumbnail-image:hover { max-width: 32px; width: 32px\9; }
/* tweetをクリックで選択した時にサムネールを拡大 */
div.selected img.thumbnail-image { width: auto; max-width: 300px; }
@NeoCat
NeoCat / tweet-ingress-damage.rb
Last active August 29, 2015 14:05
Monitor your GMail mail box and tweet the damage report.
#!/usr/bin/ruby
require 'net/imap'
require 'nokogiri'
require 'twitter'
require 'cgi'
require 'open-uri'
mail_user = '***@gmail.com'
mail_password = '***'
mail_label = 'Ingress'
@NeoCat
NeoCat / add2numbers_12lang_polyglot
Created April 21, 2014 14:47
12 language polyglot which adds 2 numbers from stdin. Runnable in Bash/Brainf**k/C/CLIPS/INTERCAL/Perl/Perl 6/Python/Ruby/Pike/Prolog (swi)/Whitespace, tested in Ideone.com http://ideone.com/JmXx4l .
#define x /* ++[>[-]+>>++++++++++[>++++++[>++++++<-]>++<<<<[[-]>+>>>>,----------<<<<<]>[<+>-]>>>>[>+>+<<-]<[>>-<<-]>>>>+<[[-]>-<]>[[-]<<[+]<<<<<<[-]>>[-]+<<>>>>>>>>]>>>>>>>>>>[>+<-]<[>+<-]<[>+<-]<[>+<-]<[>+<-]<[>+<-]<[>+<-]<[>+<-]<[>+<-]<<<<[>>>>+<<<<-]<<<<-]<<<[>>+>+<<<-]>>[<<+>>-]>-[[-]>>>>>>>+++++++++[>>>>>>>>>>>>>>>>>>>>[>+<-]<[>+<-]<[>+<-]<[>+<-]<[>+<-]<[>+<-]<[>+<-]<[>+<-]<[>+<-]<[>+<-]<[>+<-]<[>+<-]<[>+<-]<[>+<-]<[>+<-]<[>+<-]<[>+<-]<[>+<-]<[>+<-]<<-]<<<<<<<]<<<-]>>>>>>>>>>>>>>>>>>>>[>>>>>>>>>+<<<<<<<<<-]<[>>>>>>>>>+<<<<<<<<<-]<[>>>>>>>>>+<<<<<<<<<-]<[>>>>>>>>>+<<<<<<<<<-]<[>>>>>>>>>+<<<<<<<<<-]<[>>>>>>>>>+<<<<<<<<<-]<[>>>>>>>>>+<<<<<<<<<-]<[>>>>>>>>>+<<<<<<<<<-]<[>>>>>>>>>+<<<<<<<<<-]<++++++++[>>>>>>>>>>[<<<<<<<<+<+>>>>>>>>>-]<<<<<<<<[>>>>>>>>+<<<<<<<<-]+++++++++[<[[<<+>>-]<<->>]<<[>>+<<-]>>>-]<[[-]>>>>>>>>>---------->+<<<<<<<<<<][<+>-]>[<+>-]>[<+>-]>[<+>-]>[<+>-]>[<+>-]>[<+>-]>[<+>-]>[<+>-]>[<+>-]>[<+>-]>[<+>-]>[<+>-]>[<+>-]>[<+>-]>[<+>-]>[<+>-]>[<+>-]><<<<<<<<<<<<<<<<<<<-]>>>>>>>>>>>>+++++++++[<<[[-
@NeoCat
NeoCat / ideone.pl
Last active August 29, 2015 14:00
Submit a source code in the specified language to ideone.com (in private mode) and get executed results
#!/usr/bin/perl
use strict;
use warnings;
use SOAP::Lite;
my $user = '******';
my $pass = '******';
my $client = SOAP::Lite->new(proxy => 'http://ideone.com/api/1/service');
@NeoCat
NeoCat / ignchild.c
Last active August 29, 2015 13:58
Avoid zombie processes on Linux
/*
* Avoid creation of zombie process by child processes.
* build: gcc -O2 ignchld.c -o ignchld
* usage: ignchld bad-command-that-creates-zombie-processes [args ...]
*/
#include <signal.h>
#include <string.h>
#include <unistd.h>
@NeoCat
NeoCat / 2048.stp
Last active August 29, 2015 13:58
2048 -- Join the numbers and get to the 2048 tile using SystemTap!
#!/bin/bash
//usr/bin/env stty -echo; sudo staprun -T 30 `stap -p4 "$0"` "$@"; stty echo; exit
// 2048.stp - written by NeoCat
// Inspired by https://github.com/gabrielecirulli/2048/
// Licensed under MIT license or GPLv2
// Join the numbers and get to the 2048 tile!
// HOW TO PLAY: Use your arrow keys to move the tiles. When two tiles with the same number touch, they merge into one!
@NeoCat
NeoCat / virt-addr
Last active November 23, 2016 19:36
#!/bin/bash
type=ipv4
function usage() {
echo "usage: $(basename "$0") [OPTIONS] domain"
echo " -6 get ipv6 address (default: ipv4)"
echo " -h show this help"
echo " -n show interface name"
echo " -p show prefix"
echo " -i interface specify interface (default: all)"
@NeoCat
NeoCat / New Data
Last active December 30, 2015 15:59
LED FAN data
0 02 [][][][][] [] 40 37 [] []
1 0e [][][] [] 41 37 [] []
2 7f 42 40 [][][][][][]
3 7f 43 00 [][][][][][][]
4 02 [][][][][] [] 44 77 []
5 7f 45 77 []
6 7f 46 77 []
7 51 [] [][][] 47 00 [][][][][][][]
8 36 [] [] [] 48 09 [][][] [][]
9 36 [] [] [] 49 76 [] []
@NeoCat
NeoCat / Makefile
Created November 18, 2013 21:18
にゃんぱすー と表示するカーネルモジュール 使用方法: make && sudo insmod nyanpasu.ko && cat /dev/renchon
obj-m = nyanpasu.o
all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
clean:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
@NeoCat
NeoCat / yurex-de-eject.sh
Created November 13, 2013 21:52
YUREX de eject
while :;do x=$y;sleep 2;y=$(cat /dev/yurex0);o=;[ $(($y-x)) -gt 2 ]&&o=-t;eject $o;done