- Website pre & post launch checklist
- Oh Shit Git - A list of Git commands depending on the need.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Add this import: | |
| from sqlalchemy.sql import text | |
| def upgrade(): | |
| # ... | |
| conn = op.get_bind() | |
| conn.execute(text('UPDATE ...')) | |
| # ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Example of usage: | |
| * ``` | |
| * pdfshift('your_api_key', array( | |
| * 'source' => 'http://www.example.com', | |
| * 'use_print' => true | |
| * )); | |
| */ | |
| function pdfshift($apiKey, $params) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| read -e -p "Project Name: " project_name | |
| mkdir -p "/var/www/$project_name/project.git" | |
| cd "/var/www/$project_name/project.git" | |
| git init --bare | |
| cd "/var/www/$project_name/" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- config:utf-8 -*- | |
| import socket, select, re, logging | |
| from io import BytesIO | |
| divider_pattern = re.compile(br'^(.*?)\r?\n(.*?)\r?\n\r?\n', re.DOTALL) | |
| first_line_pattern = re.compile(br'^SPAMD/[^ ]+ 0 EX_OK$') | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # First of all, we check if the user is root | |
| if [[ $EUID -ne 0 ]]; then | |
| echo "This script must be run as root" | |
| exit 1 | |
| fi | |
| # Changing the password of the root user | |
| read -e -p "Do you want to change the root password? [Y/n] : " change_password |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # | |
| # -------------------------------------------------------------------- | |
| # This is a free shell script under GNU GPL version 3.0 or above | |
| # Copyright (C) 2005 ReFlectiv project. | |
| # Feedback/comment/suggestions : http://www.reflectiv.net/ | |
| # ------------------------------------------------------------------------- | |
| # | |
| # This script automatically set up a new *Debian* server (IMPORTANT : Debian!), by doing these actions : | |
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import logging, argparse | |
| import apache_beam as beam | |
| from apache_beam.io import gcsio | |
| from apache_beam.utils.options import PipelineOptions | |
| from openpyxl import load_workbook | |
| # @See https://cloud.google.com/dataflow/model/custom-io-python#ptransform-wrappers |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| dnf -y remove cheese evolution libreoffice* shotwell empathy | |
| # Installing repositories | |
| dnf -y install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm | |
| dnf -y install https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm | |
| dnf -y install http://rpms.famillecollet.com/fedora/remi-release-24.rpm | |
| # Installing Google Chrome repository |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| date_default_timezone_set('UTC'); | |
| define('DATE_FORMAT', '%a, %d %b %Y %H:%M:%S +0000'); | |
| $domain = 'blog.cnicodeme.com'; | |
| $blogId = 1; | |
| $pdo = new PDO('mysql:dbname=postera;host=127.0.0.1', 'root', '', array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES \'UTF8\'')); | |
| $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); |