Skip to content

Instantly share code, notes, and snippets.

View loicpirez's full-sized avatar
:shipit:

Loïc PIREZ loicpirez

:shipit:
  • Paris, France
View GitHub Profile
@nboubakr
nboubakr / subnet.py
Created December 20, 2012 11:23
A simple python script converts a Classless Inter-Domain Routing (CIDR)-formatted IP address into an IP range and netmask.
#!/usr/bin/env python
# python subnet.py 200.100.33.65/26
import sys
# Get address string and CIDR string from command line
(addrString, cidrString) = sys.argv[1].split('/')
# Split address into octets and turn CIDR into int
addr = addrString.split('.')
@rxaviers
rxaviers / gist:7360908
Last active July 25, 2024 19:00
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@davidosomething
davidosomething / vimup.sh
Last active March 25, 2020 10:10
Script to update NeoBundle plugins from the commandline
#!/usr/bin/env bash
_vimup() {
vim -N -u ~/.vimrc -c "try | \
NeoBundleClean! | \
NeoBundleCheck | \
NeoBundleUpdate! | \
NeoBundleUpdatesLog $* | \
finally | qall! | endtry" \
-U NONE -i NONE -V1 -e -s
@goyalankit
goyalankit / bash_to_zsh_history.rb
Last active October 28, 2023 05:07
Import bash history to zsh history.
#################################################################
# = This script transfers bash history to zsh history
# = Change bash and zsh history files, if you don't use defaults
#
# = Usage: ruby bash_to_zsh_history.rb
#
# = Author: Ankit Goyal
#################################################################
# change if you don't use default values
@nrollr
nrollr / nginx.conf
Last active June 9, 2024 23:39
NGINX config for SSL with Let's Encrypt certs
# UPDATED 17 February 2019
# Redirect all HTTP traffic to HTTPS
server {
listen 80;
listen [::]:80;
server_name www.domain.com domain.com;
return 301 https://$host$request_uri;
}
# SSL configuration
@a7madgamal
a7madgamal / Kaomoji.txt
Last active July 6, 2024 06:12
┬┴┬┴┤( ͡° ͜ʖ├┬┴┬┴
Joy
(^ω^)
(-‿‿-)
(o^▽^o)
(⌒▽⌒)☆
<( ̄︶ ̄)>
ヽ(・∀・)ノ
(´。• ω •。`)
( ̄ω ̄)
@beeman
beeman / remove-all-from-docker.sh
Created November 15, 2016 03:04
Remove all from Docker
# Stop all containers
docker stop `docker ps -qa`
# Remove all containers
docker rm `docker ps -qa`
# Remove all images
docker rmi -f `docker images -qa `
# Remove all volumes
@sknuell
sknuell / PHPNativeFunctionMock.php
Last active February 10, 2021 22:22
Mocking native PHP functions (date(), time() and shell_exec) for PHPUnit using php-mock/php-mock and php-mock/php-mock-phpunit
<?php
namespace Foo\Bar;
use phpmock\MockBuilder;
use phpmock\phpunit\PHPMock;
use PHPUnit_Framework_TestCase;
class Baz
{
/**
@ekwoodrich
ekwoodrich / DVRIP-Sonia Reference Codes.md
Last active April 30, 2024 20:24
Reference codes for the DVRIP/Sonia TCP protocol used by the Net Surveillance ActiveX plugin

DVRIP/Sonia Protocol

DVRIP/Sonia TCP protocol used by the Net Surveillance ActiveX plugin

1. Response Codes

Return code Definition
100 Success
101 Unknown error
102 Version not supported
103 Illegal request
@mattmarcum
mattmarcum / facebook-cleanse.js
Created February 12, 2018 23:03
Console script to unlike everything you ever liked on facebook
/*
This works on 2/12/2018, but will need to be updated as facebook updates it's DOM
1: Go to your profile, click More->Likes
2: Scroll down to the bottom of the page and keep scrolling as facebook loads more of your 'likes'
3: Open the console and c&p this:
*/
document.querySelectorAll('button.PageLikedButton').forEach(b=>b.click());
document.querySelectorAll('li[data-label="Unlike"] a').forEach(a=>a.click());