Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View jolyon129's full-sized avatar
😌
Ready for the next challenge

Jolyon jolyon129

😌
Ready for the next challenge
View GitHub Profile
@jolyon129
jolyon129 / dabblet.css
Last active August 29, 2015 14:21 — forked from LeaVerou/dabblet.css
Move in a circle without wrapper elements
/**
* Move in a circle without wrapper elements
* Idea by Aryeh Gregor, simplified by Lea Verou
*/
@keyframes rot {
from {
transform: rotate(0deg)
translate(-150px)
rotate(0deg);
@jolyon129
jolyon129 / train_valid_split.py
Created January 31, 2019 22:22 — forked from sariabod/train_valid_split.py
Break up training set into train/valid splits.
import pandas as pd
import pathlib
import sys
import uuid
import shutil
df = pd.read_csv('data/train.csv')
f = open("data/labels.csv","a")
@jolyon129
jolyon129 / k_fold_roc_plot.py
Created February 28, 2020 21:19
Draw k-fold roc curves for multiple classifiers and plot them in the same figure
import matplotlib.pyplot as plt
import numpy as np
from numpy import interp
from sklearn import metrics
from sklearn.metrics import precision_recall_fscore_support
from sklearn.model_selection import KFold
def k_fold_roc_plot(cls, Xs, y, verbose=False):
""" Plot 10-fold Mean ROC
@jolyon129
jolyon129 / bulk-delete-weibo.js
Last active March 7, 2020 01:45
Automate bulk delete weibo though web weibo. 批量删除微博
/*
Sign in to weibo webside.
Click on your home page.
Paste the following code into the console and enter.
*/
'use strict';
var s = document.createElement('script');
@jolyon129
jolyon129 / iterm2-solarized.md
Created March 27, 2020 20:17 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@jolyon129
jolyon129 / center.css
Created April 1, 2020 16:38
The Ultimate Centering in CSS
/*
https://twitter.com/jacobmparis/status/1245193222181326848?s=21
*/
.center{
text-align: center;
align-items: center;
align-content: center;
justify-content: center;
justify-self: center;
justify-items: center;
@jolyon129
jolyon129 / vim-diff-against-saved-file.md
Created April 8, 2020 23:38 — forked from dergachev/vim-diff-against-saved-file.md
VIM snippet to show diff of unsaved changes.

Let's say you're editing a file in VIM, and want to see a diff between your current unsaved version and what's on the hard disk. Turns out you can just type this:

:w !git diff --no-index % -

What this does it pipes the whole contents of the current file to the command git diff --no-index % - The % symbol is substituted by vim to be the path to the saved file. The - tells git diff to read from STDIN.

@jolyon129
jolyon129 / RequestAndResponseLoggingFilter.java
Last active August 10, 2020 06:31 — forked from int128/RequestAndResponseLoggingFilter.java
Spring Web filter for logging request and response
import lombok.extern.slf4j.Slf4j;
import lombok.val;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.web.filter.OncePerRequestFilter;
import org.springframework.web.util.ContentCachingRequestWrapper;
import org.springframework.web.util.ContentCachingResponseWrapper;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;