Skip to content

Instantly share code, notes, and snippets.

@huytd
huytd / wordle.md
Last active November 1, 2024 05:07
Wordle in less than 50 lines of Bash

image

How to use:

./wordle.sh

Or try the unlimit mode:

@masbog
masbog / yowsup-utilities.py
Last active April 4, 2024 22:12
yowsup utilities for getting new whatsapp.apk and processing it to get whatsapp version and classdex md5
#!/usr/bin/python
# yowsup utilities for getting new whatsapp.apk and processing it to get whatsapp version and classdex md5
#
# Output :
# WhatsApp Version: 2.17.296
# WhatsApp ClassesDex: YrJNPljM3TuNFPIOZ+jziw==
#
# @MasBog
import os
@tlhunter
tlhunter / average-geolocation.js
Created May 17, 2017 18:00
Calculate the center/average of multiple GeoLocation coordinates
/**
* Calculate the center/average of multiple GeoLocation coordinates
* Expects an array of objects with .latitude and .longitude properties
*
* @url http://stackoverflow.com/a/14231286/538646
*/
function averageGeolocation(coords) {
if (coords.length === 1) {
return coords[0];
}
package productmeister.com.productmeister.view;
import android.annotation.TargetApi;
import android.os.Build;
import android.support.design.widget.AppBarLayout;
import android.support.v4.view.ViewCompat;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
@bahamas10
bahamas10 / compile.md
Created February 25, 2015 20:15
haproxy

I compiled openssl 1.0.1l to $LIBSSLBUILD before hand use the directions in the haproxy readme... then

$ make TARGET=solaris USE_OPENSSL=yes USE_STATIC_PCRE=1 ADDINC=-I$LIBSSLBUILD/include ADDLIB="-L$LIBSSLBUILD/lib -ldl" clean all
...
$ ./haproxy -vv | grep OpenSSL | head -2
Built with OpenSSL version : OpenSSL 1.0.1l 15 Jan 2015
Running on OpenSSL version : OpenSSL 1.0.1e 11 Feb 2013
@baetheus
baetheus / README.md
Last active December 17, 2023 14:28
SmartOS Single IP with NAT using VLAN

WARNING

These intructions might work, but they need a bit of attention. I've been reading through ipf and smf documentation and have found a few ways to improve this process. When I have time I'll add that information here, until then, be sure to look into the ipf settings if you're having issues with routing. Good luck!

Foreword

This is a modified version of sjorge's instructions for Single IP with NAT. Those instructions can be found here: https://docu.blackdot.be/snipets/solaris/smartos-nat

The primary difference is that this version does not rely on etherstubs for internal switching, but instead uses a vlan configuration. The benefits of this method over using etherstubs are:

  1. Project Fifo (project-fifo.net) can create vms and zones with vlans, but does not currently have etherstub support.
  2. Vlan switching is supposedly more efficient than creating an etherstub to handle switching. I have not tested this statement.
@wess
wess / gist:3278911
Created August 6, 2012 22:12
Tapping in fucking CoreText
// A small chunk of it.
- (void)tapGestureAction:(UITapGestureRecognizer *)gesture
{
CGPoint location = [gesture locationInView:self];
_linkLocation = location;
location.y += (ARTICLE_BODY_FONT_SIZE / lineHeightFactor);
CFArrayRef lines = CTFrameGetLines(_frame);
@willolbrys
willolbrys / ApacheLogster.py
Created June 26, 2012 17:08
ApacheLogster Log Parser
### A modified sample logster parser file that can be used to count the number
### of response codes found in an Apache access log.
###
### For example:
### sudo ./logster --dry-run --output=ganglia ApacheLogster /var/log/httpd/access_log
###
###
### Copyright 2011, Etsy, Inc.
###
### This file is part of Logster.