Skip to content

Instantly share code, notes, and snippets.

@asaokamei
asaokamei / Vagrant
Created April 8, 2015 08:23
Vagrant + Nginx + Php-fpm/ZTS
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.hostname = "web-dev"
package your_package;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
@yuvadm
yuvadm / haproxy.cfg
Created March 17, 2011 10:10
A basic HAProxy configuration for a proxy server with stats
global
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
#log loghost local0 info
maxconn 4096
#chroot /usr/share/haproxy
user haproxy
group haproxy
daemon
#debug
@leommoore
leommoore / mongodb_basic_commands.md
Last active January 16, 2021 16:36
MongoDB - Basic Commands

#MongoDB - Basic Commands

##Saving Data

db  //Tells you the current database

show collections //Shows the collections available in the current db

db.foo.save({_id:1, x:10}) //Save the document into the foo collection  

db.bar.save({_id:1, x:10}) //Save the document into the bar collection

import android.content.Context;
import android.support.annotation.NonNull;
import android.widget.ImageView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.Priority;
import com.bumptech.glide.load.data.DataFetcher;
import com.bumptech.glide.load.model.stream.StreamModelLoader;
@JakeWharton
JakeWharton / AutoGson.java
Last active November 28, 2021 12:32
A Gson TypeAdapterFactory which allows serialization of @autovalue types. Apache 2 licensed.
import com.google.auto.value.AutoValue;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
/**
* Marks an {@link AutoValue @AutoValue}-annotated type for proper Gson serialization.
* <p>
@eliangcs
eliangcs / linode-security.md
Last active January 11, 2022 23:09
Basic security setup for a brand new Linode

Basic Security Setup for a Brand New Linode

Why

When you start a clean Linode, it isn't secured in the following aspects:

  • Allows root SSH login
  • Uses password authentication on SSH
  • Doesn't have a firewall
@e2po
e2po / app-min-android-version-fetcher.py
Created September 3, 2021 14:42
Python script to fetch min Android version of an app directly from Google Play Store
import requests
import csv
import sys
import pandas
from google_play_scraper import app
def min_os_ver(app_id):
print('fetching min os version for app id: ' + str(app_id))
try:
return app(app_id, lang = 'en', country = 'us')['androidVersion']
@BeMoreDifferent
BeMoreDifferent / filter.class.php
Created October 17, 2012 15:11
small html cleaner class
<?php
/**
*
* @author: Daniel Albrecht [http://bemoredifferent.com]
* @abstract: Class to clean html tags and attributes based on DOMDocument
*
*/
class filter{
@wuyongzheng
wuyongzheng / ECDH_BC.java
Last active October 29, 2022 14:44
Elliptic curve Diffie–Hellman using Bouncy Castle v1.50 example code
import java.math.BigInteger;
import java.security.PublicKey;
import java.security.PrivateKey;
import java.security.KeyFactory;
import java.security.Security;
import java.security.KeyPairGenerator;
import java.security.KeyPair;
import java.security.SecureRandom;
import java.security.spec.PKCS8EncodedKeySpec;
import java.security.spec.ECGenParameterSpec;