Skip to content

Instantly share code, notes, and snippets.

View daimajia's full-sized avatar
🏓
Ping <--> Pong

代码家 daimajia

🏓
Ping <--> Pong
View GitHub Profile
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remote fetch="ssh://git@d2tehp.chickenkiller.com:22123" name="gitlab" />
<remote fetch="git://codeaurora.org/quic/la/" name="caf" />
<project name="CyanogenMod/hudson" path="hudson" remote="github" revision="master" />
<project name="TheMuppets/proprietary_vendor_samsung" path="vendor/samsung" remote="github" />
<project name="TheMuppets/proprietary_vendor_lge" path="vendor/lge" remote="github" />
@sundayu
sundayu / protobuf.js
Created July 28, 2011 07:26
Reads an unsigned 64 bit integer from the buffer at the specified offset; readUInt64, writeUInt64 for Nodejs
var _0x100000000000000 = 0x100000000000000,
_0x1000000000000 = 0x1000000000000,
_0x10000000000 = 0x10000000000,
_0x100000000 = 0x100000000,
_0x1000000 = 0x1000000,
_0x10000 = 0x10000,
_0x100 = 0x100,
_0xff = 0xff,
_0x80 = 0x80;
@JakeWharton
JakeWharton / README.md
Last active October 13, 2015 14:38
Maven pom for Google Play services
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.5.+'
}
}
@hzlzh
hzlzh / jQuery.fn.shake.js
Created August 6, 2012 04:51
jQuery shake effect like WordPress Login Form
jQuery.fn.shake = function(intShakes, intDistance, intDuration) {
this.each(function() {
$(this).css({
position: "relative"
});
for (var x = 1; x <= intShakes; x++) {
$(this).animate({
left: (intDistance * -1)
}, (((intDuration / intShakes) / 4))).animate({
left: intDistance
@cviebrock
cviebrock / DateFormat.php
Created March 14, 2012 21:50
DateFormat class for Laravel (or anyone)
<?php
class DateFormat {
const DATE_SHORT = 'Y-m-d';
const DATE_LONG = 'F j, Y';
const DATETIME_SHORT = 'Y-m-d H:i';
const DATETIME_LONG = 'F j, Y, g:i a';
@nicolasjafelle
nicolasjafelle / SafeAsyncTask.java
Last active February 16, 2017 12:36
SafeAsyncTask taken from Roboguice 2.0. and adapted to work without roboguice. Simple copy and paste this class and follow the javadoc.
package com.asynctask.util;
import android.os.Handler;
import android.os.Looper;
import android.util.Log;
import java.io.InterruptedIOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.concurrent.Callable;
@ahgood
ahgood / gist:4d53f6d9ac1f3c593255fd20b15407e1
Created September 2, 2017 01:33
Setting up proxy(Shadowsocks, socket 5) for Google Backup and Sync(Google Photos Mac App)
git clone https://github.com/rofl0r/proxychains-ng.git
cd proxychains-ng
./configure --prefix=/usr --sysconfdir=/etc
make
sudo make install
sudo make install-config
sudo nano /etc/proxychains.conf
add this code to the end of proxychains.conf: socks5 127.0.0.1 1080
proxychains4 open -a /Applications/Backup\ and\ Sync.app
@cyx
cyx / gist:3690597
Created September 10, 2012 12:13 — forked from inkel/gist:3690584
Monit Redis
check process redis-server
with pidfile "/var/run/redis.pid"
start program = "/etc/init.d/redis-server start"
stop program = "/etc/init.d/redis-server stop"
if 2 restarts within 3 cycles then timeout
if totalmem > 100 Mb then alert
if children > 255 for 5 cycles then stop
if cpu usage > 95% for 3 cycles then restart
if failed host 127.0.0.1 port 6379 then restart
if 5 restarts within 5 cycles then timeout
@jkwiecien
jkwiecien / retrofit2_rxjava_proguard_config
Last active September 15, 2020 08:43
Retrofit2 + RxJava proguard config.
########--------Retrofit + RxJava--------#########
-dontwarn retrofit.**
-keep class retrofit.** { *; }
-dontwarn sun.misc.Unsafe
-dontwarn com.octo.android.robospice.retrofit.RetrofitJackson**
-dontwarn retrofit.appengine.UrlFetchClient
-keepattributes Signature
-keepattributes Exceptions
-keepclasseswithmembers class * {
@retrofit.http.* <methods>;