Skip to content

Instantly share code, notes, and snippets.

View jk2K's full-sized avatar
💭
I may be slow to respond.

jk2K jk2K

💭
I may be slow to respond.
View GitHub Profile
@selfboot
selfboot / v2ex_auto.py
Created May 21, 2013 11:35
V2EX 自动领取奖励脚本:延迟一秒领取奖励(服务器检测速度判定是否是程序领取奖励)
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import requests
import time
from bs4 import BeautifulSoup
signin_url = "http://www.v2ex.com/signin"
award_url = "http://www.v2ex.com/mission/daily"
main_url = "http://www.v2ex.com"
@hfhimage
hfhimage / xshell solarized dark theme.xcs
Created November 2, 2013 05:57
xshell solarized dark theme
[Names]
count=1
name0=Solarized Dark
[Solarized Dark]
text(bold)=839496
magenta(bold)=dd3682
text=839496
white(bold)=fdf6e3
green=859900
red(bold)=cb4b16
@bolhoso
bolhoso / gist:8403087
Last active October 7, 2017 05:09
An Android Espresso IdlingResource to monitor Volley requests (bot not working yet..)
public final class VolleyIdlingResource implements IdlingResource {
private static final String TAG = "VolleyIdlingResource";
private final String resourceName;
// written from main thread, read from any thread.
private volatile ResourceCallback resourceCallback;
private Field mCurrentRequests;
private RequestQueue mVolleyRequestQueue;
@chrvadala
chrvadala / KOA.js middleware
Created July 29, 2016 08:53
KOA.js use Promise instead of async/await or yield
koa.use((ctx, next) => new Promise((resolve, reject) => {
ctx.body = "hello"
next().then(_ => {
resolve();
});
}));
@proustibat
proustibat / install-comparisons.sh
Last active August 13, 2018 03:21
NPM 5 / NPM 6 / Yarn installations
#!/usr/bin/env bash
## @file install-comparisons.sh
## @author Jennifer Proust - proustibat@gmail.com
## @section DESCRIPTION Compare installations times between NPM 5/ NPM6 and YARN
set -o errexit || true
set -o errtrace
set -o nounset
set -o pipefail
#set -o xtrace
@alexfacciorusso
alexfacciorusso / PostActivity.java
Created May 30, 2015 10:00
AppBarLayout + WebView issue
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
android:id="@+id/main_content"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
@clyfish
clyfish / solarized-dark.xcs
Created December 21, 2011 07:06
xshell solarized dark color theme
[Solarized Dark]
text(bold)=839496
magenta(bold)=6c71c4
text=839496
white(bold)=fdf6e3
green=859900
red(bold)=cb4b16
green(bold)=586e75
black(bold)=073642
red=dc322f
@jgibbard
jgibbard / pythonInstall.sh
Last active November 10, 2020 08:52
CentOS7 - Install Python 2.7 and 3.6 from source
#!/bin/bash
# Python 2.7 and 2.6 install script for CentOS 7
# Instructions mainly taken from tutorial by Daniel Eriksson
# https://danieleriksson.net/2017/02/08/how-to-install-latest-python-on-centos/
python27_version=2.7.15
python36_version=3.6.6
build_dir=python_build_temp
example_environment_dir=pythonEnv
@matt-curtis
matt-curtis / NumberPadDoneBtn.h
Last active December 31, 2020 14:29
Done Button for UIKeyboard NumberPad (must be set as inputAccessoryView)
#import <UIKit/UIKit.h>
@interface NumberPadDoneBtn : UIView
@end
@interface NumberPadButton : UIButton
@end
@carloseduardosx
carloseduardosx / AutoIncrementEntity.java
Last active January 18, 2021 05:36
RealmAutoIncrement is a singleton which maintain the last id saved from each database model
package com.carloseduardo.model;
import com.carloseduardo.constants.KnownClasses;
import com.carloseduardo.exception.UnknownModelException;
import io.realm.RealmObject;
import io.realm.annotations.PrimaryKey;
import io.realm.annotations.Required;
/**