I hereby claim:
- I am Jamesits on github.
- I am jamesits (https://keybase.io/jamesits) on keybase.
- I have a public key whose fingerprint is F37F 9BC8 BBE8 C9AB 7EC2 D7E3 5CE8 0C34 0ACC 0CC0
To claim this, I am signing this object:
#include <iostream> | |
#include <regex> | |
#include <fstream> | |
#include <string> | |
using namespace std; | |
int main() { | |
std::ifstream ifs("sample.in"); | |
std::string var((std::istreambuf_iterator<char>(ifs)), | |
(std::istreambuf_iterator<char>())); |
I hereby claim:
To claim this, I am signing this object:
// See the comment for flashing instruction. | |
#include <ESP8266WiFi.h> | |
#define ONBOARD_LED 16 | |
#define ESP8266_LED 2 | |
// ADC_MODE(ADC_VCC); will result in compile error. use this instead. | |
int __get_adc_mode(void) { return (int) (ADC_VCC); } | |
void setup() |
#!/usr/bin/env bash | |
# dotfiles utility - https://gist.github.com/Jamesits/9bc4adfb1f299380c79e | |
# Set $DOTFILES to where you want to put your dotfiles. | |
# then run dotfiles-init someSoftware, | |
# and it will move all files starting with `.someSoftware` to the correct location | |
# then link them back, | |
# Which will produce a directory structure like: | |
# | |
# $ tree -aL 2 ~/Dropbox/Code/config/dotfiles/ |
#!/usr/bin/env bash | |
update() { | |
case $1 in | |
# apt-get | |
apt) | |
apt update && apt full-upgrade -y | |
;; | |
#!/usr/bin/env python3 | |
# 8 Queens Problem | |
# by James Swineson | |
from functools import reduce | |
# 一个棋盘的表示,其中 .board[i] 表示第 i 行的旗子在第几列 | |
class nQueenBoard: | |
def __init__(self, size, board=[]): | |
self.size = size |
#include <stdio.h> | |
#include <stdlib.h> | |
int main(void) | |
{ | |
// input arguments (assuming n, k > 0) | |
int n, k; | |
scanf("%d%d", &n, &k); | |
// initialize number -> position mapping array |
/* | |
by James Swineson, 2016-06-30 | |
Apply to: URL starts with http://www.jjwxc.net/onebook.php?novelid= | |
*/ | |
body { | |
background: moccasin !important; | |
} | |
body>div { |
#!/bin/bash | |
# Public Domain | |
# (someone claimed the next lines would be useful for… | |
# people. So here goes: © 2012 Stefan Breunig | |
# stefan+measure-net-speed@mathphys.fsk.uni-heidelberg.de) | |
# modified by James Swineson <github@public.swineson.me> | |
# interfaces | |
interfaces=(enp1s0 wlp2s0) |
#!/usr/bin/env python3 | |
# by @Jamesits 2016-08-23 | |
# Great thanks to @m13253 | |
def dec_unicode_decode(s): | |
return ''.join((bytes([x&255, x>>8]).decode('utf-16-le') for x in map(int, s.split('#')[1:]))) | |
def dec_unicode_encode(s): | |
return '#' + '#'.join([str(int(x, 16)) for x in str(s.encode("unicode-escape"))[2:-1].split("\\\\u")[1:]]) |