Skip to content

Instantly share code, notes, and snippets.

View Philipinho's full-sized avatar
🎯
Focusing on Java

Philip Okugbe Philipinho

🎯
Focusing on Java
View GitHub Profile
def get_free_port():
s = socket.socket()
s.bind(('', 0))
port = s.getsockname()[1]
s.close()
return port
@Sprocket
Sprocket / laravel-ums.markdown
Created December 6, 2012 20:39 — forked from anchetaWern/laravel-ums.markdown
Building a User Management System in Laravel

There's no shortage of good resources for learning laravel. So instead of the usual introductory tutorial were just gonna learn Laravel by building a project from scratch and that's gonna be a User Management System.

I don't know if my definition of a User Management System is correct but here's my idea of what's it's capable of doing:

  • Register Roles
  • Register Users
  • Update Users
@revolunet
revolunet / mailgun-test.py
Last active September 6, 2022 17:08
create and send a tracked message through the mailgun SMTP gateway
# -*- encoding: UTF-8 -*-
import smtplib
import json
from email.mime.text import MIMEText
MAILGUN_SMTP_LOGIN = "[email protected]"
MAILGUN_SMTP_PASSWORD = "secret"
def send_message_via_smtp(from_, to, mime_string):
@ccjeng
ccjeng / gist:5175340
Last active February 22, 2022 05:43
Android adb backup command
## backup nonsystem apk
adb backup -apk -shared -nosystem -all -f backup_apk.ab
### backup system and nonsystem apk
adb backup -apk -noshared -system -all -f backup_apk.ab
## backup individual apk
adb backup -apk com.example.testing -f testing.ab
## restore all
@yanofsky
yanofsky / LICENSE
Last active March 14, 2025 18:19
A script to download all of a user's tweets into a csv
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
@granoeste
granoeste / EachDirectoryPath.md
Last active April 27, 2025 06:18
[Android] How to get the each directory path.

System directories

Method Result
Environment.getDataDirectory() /data
Environment.getDownloadCacheDirectory() /cache
Environment.getRootDirectory() /system

External storage directories

@ogrrd
ogrrd / dnsmasq OS X.md
Last active April 29, 2025 14:43
Setup dnsmasq on OS X

Never touch your local /etc/hosts file in OS X again

To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time.

Requirements

Install

@irazasyed
irazasyed / Install Composer using MAMP's PHP.md
Last active April 5, 2025 13:08
Instructions on how to change preinstalled Mac OS X PHP to MAMP's PHP Installation and then install Composer Package Management

Change default Mac OS X PHP to MAMP's PHP Installation and Install Composer Package Management


Instructions to Change PHP Installation


First, Lets find out what version of PHP we're running (To find out if it's the default version).

To do that, Within the terminal, Fire this command:

which php

@vbtechsupport
vbtechsupport / ghostsitemap.sh
Last active January 24, 2023 11:41
Ghost sitemap generator for ghost.centminmod.com
#!/bin/bash
##############################################
# modified version of original http://media-glass.es/ghost-sitemaps/
# for ghost.centminmod.com
# http://ghost.centminmod.com/ghost-sitemap-generator/
##############################################
url="ghost.centminmod.com"
webroot='/home/nginx/domains/ghost.centminmod.com/public'
path="${webroot}/sitemap.xml"
user='nginx' # web server user
@akeinhell
akeinhell / showNews.java
Created November 27, 2013 17:09
sample JSoup XMLHttpRequest with cookies
Document doc = Jsoup.connect(jurl)
.header("Accept","text/html, */*; q=0.01")
.header("Accept-Encoding","gzip,deflate,sdch")
.header("Accept-Language","ru-RU,ru;q=0.8,en-US;q=0.6,en;q=0.4")
.header("Connection","keep-alive")
.header("Cookie",cookie)
.header("Host","rivalregions.com")
.header("Referer","http://rivalregions.com/")
.header("User-Agent","Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.57 Safari/537.36")
.header("X-Requested-With", "XMLHttpRequest")