Skip to content

Instantly share code, notes, and snippets.

Avatar

Tommy Jerry Mairo TommyJerryMairo

View GitHub Profile
View ccls-nvim-init.vim
call plug#begin('~/.local/share/nvim/plugged')
" " Language Server Protocol (LSP) support
Plug 'autozimu/LanguageClient-neovim', {
\ 'branch': 'next',
\ 'do': 'bash install.sh',
\ }
" (Optional) Multi-entry selection UI.
Plug 'junegunn/fzf'
@TommyJerryMairo
TommyJerryMairo / acm.h
Created Jun 23, 2018
Macros that useful in competitive programming
View acm.h
#include <functional>
#include <algorithm>
#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <numeric>
#include <cstring>
#include <cassert>
#include <cstdio>
@TommyJerryMairo
TommyJerryMairo / darkart.h
Created Jun 8, 2018
Macro for Competitive Programming
View darkart.h
#include <functional>
#include <algorithm>
#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <numeric>
#include <cstring>
#include <cassert>
#include <cstdio>
View Endianess revertor.
#include<iostream>
#include<cstdio>
#include<unistd.h>
#include<getopt.h>
using namespace std;
int reverse(int);
void help(char *);
void big2lettle(int);
View Endianess revertor.
#include<iostream>
#include<cstdio>
using namespace std;
int main(int argc, char * argv[]){
if(2==argc){
int x = atoi(argv[1]);
cout << "Origional: " << x << endl;
//cout << "Big-endian: " << hex << uppercase << x << endl;
@TommyJerryMairo
TommyJerryMairo / VPS-Service-List
Created Nov 28, 2017
Functionality to do with vps.
View VPS-Service-List
1. Host Tor relay
2. Host i2p node
3. Tor gateway via i2p
4. Gogs
5. zeronet node
@TommyJerryMairo
TommyJerryMairo / simulate_keypress.js
Created Nov 22, 2016 — forked from ejoubaud/simulate_keypress.js
Simulate keypress that works in Google nav in Chrome
View simulate_keypress.js
// Based on http://stackoverflow.com/a/10520017/1307721 and http://stackoverflow.com/a/16022728/1307721
Podium = {};
Podium.keydown = function(k) {
var oEvent = document.createEvent('KeyboardEvent');
// Chromium Hack
Object.defineProperty(oEvent, 'keyCode', {
get : function() {
View archbase-Dockerfile
From base/archlinux
Maintainer "TJM <tommy.mairo@gmail.com>"
ENV TERM=xterm-256color
RUN ["/usr/bin/pacman","-Sy"]
RUN ["/usr/bin/pacman","--noconfirm","-S","archlinux-keyring"]
RUN ["/usr/bin/pacman","--noconfirm","-S","pacman-mirrorlist"]
RUN ["/usr/bin/sed","-i","s/^#Server/Server/","/etc/pacman.d/mirrorlist.pacnew"]
RUN /usr/bin/bash -c '/usr/bin/grep -v \# /etc/pacman.d/mirrorlist.pacnew >/tmp/mirrorlist'
RUN /usr/bin/bash -c "/usr/bin/rankmirrors /tmp/mirrorlist > /etc/pacman.d/mirrorlist"
RUN ["/usr/bin/pacman","--noconfirm","-Syu"]
View CWM_run.sh
#!/bin/bash
export TRIGGER=FB_RecoveryLauncher/recovery.trigger.new
export LAUNCHER=FB_RecoveryLauncher/recovery.launcher
export RECOVERY=FB_RecoveryLauncher/recovery.zip
export OEMTRIGGER=/system/bin/logcat
export OEMCMD=stop_partitioning
fastboot flash /tmp/recovery.zip $RECOVERY
fastboot flash /tmp/recovery.launcher $LAUNCHER
View Bash shell for rooting ASUS ZenFone 2 Z00A
#!/bin/sh
#need ZenFoneRootKit_20150614.zip
#set -v
BASEDIR=$(dirname $0)
cd $BASEDIR
chmod +x files/adb.mac
chmod +x files/fastboot.mac
ADBBINARY="adb"