This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for line in `find . -iname '*.svg';` | |
do | |
for dpi in 90 180 360 720 | |
do | |
inkscape -z -f "${line}" --export-png="png/${line}_${dpi}.png" -d "${dpi}" | |
done | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.richard1993.android.inputhack; | |
import android.app.Service; | |
import android.content.Intent; | |
import android.net.nsd.NsdManager; | |
import android.net.nsd.NsdServiceInfo; | |
import android.os.IBinder; | |
import android.util.Log; | |
import java.io.BufferedInputStream; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This function split a string into multi part, each part start with(exclude) $start and end with(exclude) $end. | |
$end is optional. | |
Thanks @zenozeng for backend code at QSC mobile. (function get_between) | |
*/ | |
function gets_between($start, $end, $content) { | |
$r = explode($start, $content); | |
$arr = array(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <omp.h> | |
#include <ctime> | |
using namespace std; | |
#define N 3000000000L | |
int main() { | |
omp_set_num_threads(8); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static String networkInputstreamtoString(InputStream is) throws IOException { | |
byte []sig = new byte[2]; | |
final PushbackInputStream pb = new PushbackInputStream(is, sig.length); | |
pb.read(sig); | |
pb.unread(sig); | |
if (sig[0] == (byte) 0x1f && sig[1] == (byte) 0x8b) { | |
is = new GZIPInputStream(pb); | |
} else { | |
is = new BufferedInputStream(pb); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 10, mContext.getResources().getDisplayMetrics()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// A typings definition of some telegram data structure | |
// author: Richard He<[email protected]> | |
// https://gist.github.com/richard1122/1eb54cd4e422aeb707718ab307decd34 | |
// see more detail: https://core.telegram.org/bots/api | |
declare namespace TL { | |
export interface IResponse<T> { | |
ok:boolean | |
result:T | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<code_scheme name="Default" version="173"> | |
<HTMLCodeStyleSettings> | |
<option name="HTML_SPACE_INSIDE_EMPTY_TAG" value="true" /> | |
</HTMLCodeStyleSettings> | |
<JSCodeStyleSettings> | |
<option name="USE_SEMICOLON_AFTER_STATEMENT" value="false" /> | |
<option name="FORCE_SEMICOLON_STYLE" value="true" /> | |
<option name="USE_DOUBLE_QUOTES" value="false" /> | |
<option name="FORCE_QUOTE_STYlE" value="true" /> | |
<option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Main > .box tr > td:first-child { | |
width: 0; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.assertJ : AssertJ | |
ANY → org.assertj.core.api.Assertions.assertThat($expr$) | |
.isEqualTo: AssertJ And isEqualTo | |
ANY → org.assertj.core.api.Assertions.assertThat($expr$).isEqualTo($END$) | |
.isZero: AssertJ And isZero | |
ANY → org.assertj.core.api.Assertions.assertThat($expr$).isZero() | |
.isCloseTo: AssertJ And isCloseTo | |
ANY → org.assertj.core.api.Assertions.assertThat($expr$).isCloseTo($value#1$, Percentage.withPercentage(.1))$END$ | |
.isTrue: AssertJ And isTrue | |
ANY → org.assertj.core.api.Assertions.assertThat($expr$).isTrue() |
OlderNewer