Skip to content

Instantly share code, notes, and snippets.

View ninsuo's full-sized avatar
🐢

Alain Tiemblo ninsuo

🐢
View GitHub Profile
@stasius12
stasius12 / countries.py
Created September 23, 2018 10:38
List of all timezones with name of country and country code
countries = [
{'timezones': ['Asia/Kabul'], 'code': 'AF', 'name': 'Afghanistan'},
{'timezones': ['Europe/Mariehamn'], 'code': 'AX', 'name': 'Aland Islands'},
{'timezones': ['Europe/Tirane'], 'code': 'AL', 'name': 'Albania'},
{'timezones': ['Africa/Algiers'], 'code': 'DZ', 'name': 'Algeria'},
{'timezones': ['Pacific/Pago_Pago'], 'code': 'AS', 'name': 'American Samoa'},
{'timezones': ['Europe/Andorra'], 'code': 'AD', 'name': 'Andorra'},
{'timezones': ['Africa/Luanda'], 'code': 'AO', 'name': 'Angola'},
{'timezones': ['America/Anguilla'], 'code': 'AI', 'name': 'Anguilla'},
{'timezones': ['Antarctica/Casey', 'Antarctica/Davis', 'Antarctica/DumontDUrville', 'Antarctica/Mawson', 'Antarctica/McMurdo', 'Antarctica/Palmer', 'Antarctica/Rothera', 'Antarctica/Syowa', 'Antarctica/Troll', 'Antarctica/Vostok'], 'code': 'AQ', 'name': 'Antarctica'},
@Zenexer
Zenexer / escapeshellrce.md
Last active October 11, 2024 16:26
Security Advisory: PHP's escapeshellcmd and escapeshellarg are insecure

Paul Buonopane paul@namepros.com at NamePros
PGP: https://keybase.io/zenexer

I'm working on cleaning up this advisory so that it's more informative at a glance. Suggestions are welcome.

This advisory addresses the underlying PHP vulnerabilities behind Dawid Golunski's [CVE-2016-10033][CVE-2016-10033], [CVE-2016-10045][CVE-2016-10045], and [CVE-2016-10074][CVE-2016-10074]. It assumes prior understanding of these vulnerabilities.

This advisory does not yet have associated CVE identifiers.

Summary

@tott
tott / ip_in_range.php
Created November 27, 2013 22:46
php check if IP is in given network range
/**
* Check if a given ip is in a network
* @param string $ip IP to check in IPV4 format eg. 127.0.0.1
* @param string $range IP/CIDR netmask eg. 127.0.0.0/24, also 127.0.0.1 is accepted and /32 assumed
* @return boolean true if the ip is in this range / false if not.
*/
function ip_in_range( $ip, $range ) {
if ( strpos( $range, '/' ) == false ) {
$range .= '/32';
}
@zenorocha
zenorocha / README.md
Last active November 28, 2024 00:57
A template for Github READMEs (Markdown) + Sublime Snippet

Project Name

TODO: Write a project description

Installation

TODO: Describe the installation process

Usage

@Ocramius
Ocramius / User.php
Last active July 24, 2024 14:38
Doctrine 2 ManyToMany - the correct way
<?php
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
/**
* @ORM\Entity()
* @ORM\Table(name="user")
*/
class User
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active December 3, 2024 02:44
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@jmathai
jmathai / phpunit-reinstall.sh
Created June 14, 2012 04:15
Uninstall and reinstall phpunit
pear list -c phpunit | grep stable | awk '{print "phpunit/"$1}' | xargs pear uninstall ; pear install phpunit/phpunit

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name: