Skip to content

Instantly share code, notes, and snippets.

@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
@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>
@Jogan
Jogan / FloatingActionButton.java
Last active December 4, 2023 12:48
Implementation of Android L's floating action button pattern. API 14+
package your_package;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.app.Activity;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
@staltz
staltz / introrx.md
Last active May 3, 2024 13:00
The introduction to Reactive Programming you've been missing
@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;
@DeanThompson
DeanThompson / ecb.go
Last active February 12, 2023 05:10
Golang AES ecb mode
package utils
import "crypto/cipher"
type ecb struct {
b cipher.Block
blockSize int
}
func newECB(b cipher.Block) *ecb {
@wbroek
wbroek / genymotionwithplay.txt
Last active February 12, 2024 03:22
Genymotion with Google Play Services for ARM
NOTE: Easier way is the X86 way, described on https://www.genymotion.com/help/desktop/faq/#google-play-services
Download the following ZIPs:
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)
Download the correct GApps for your Android version:
Google Apps for Android 6.0 (https://www.androidfilehost.com/?fid=24052804347835438 - benzo-gapps-M-20151011-signed-chroma-r3.zip)
Google Apps for Android 5.1 (https://www.androidfilehost.com/?fid=96042739161891406 - gapps-L-4-21-15.zip)
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip)
@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

@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{
@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