Skip to content

Instantly share code, notes, and snippets.

Markus markushausammann

Block or report user

Report or block markushausammann

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active Nov 18, 2019
A badass list of frontend development resources I collected over time.
View frontendDevlopmentBookmarks.md
@naholyr
naholyr / _service.md
Created Dec 13, 2012
Sample /etc/init.d script
View _service.md

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
@dreikanter
dreikanter / encrypt_openssl.md
Last active Nov 10, 2019 — forked from crazybyte/encrypt_openssl.txt
File encryption using OpenSSL
View encrypt_openssl.md

Symmetic encryption

For symmetic encryption, you can use the following:

To encrypt:

openssl aes-256-cbc -salt -a -e -in plaintext.txt -out encrypted.txt

To decrypt:

@ziadoz
ziadoz / awesome-php.md
Last active Nov 5, 2019
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.
View awesome-php.md
@philsturgeon
philsturgeon / gist:5465246
Last active Oct 19, 2019
API Golden Rules
View gist:5465246

Never Expose DB Results Directly

  1. If you rename a field, then your users are fucked. Convert with a hardcoded array structure.
  2. Most DB drivers [for PHP] will show integers as numeric strings and false as "0", so you want to typecast them.
  3. Unless you're using an ORM with "hidden" functionality, people will see passwords, salts and all sorts of fancy codes. If you add one and forget to put it in your $hidden array then OOPS!

Use the URI sparingly, and correctly

  1. Use the query string for paired params instead of /users/id/5/active/true. Your API does not need to be SEO optimised.
  2. ?format=xml is stupid, use an Accept: application/xml header. I added this to the CodeIgniter Rest Server once for lazy people, and now people think it's a thing. It's not.
@igorw
igorw / gist:4475804
Last active Oct 4, 2019
Composer Versioning
@dylanmckay
dylanmckay / facebook-contact-info-summary.rb
Last active Jul 11, 2019
A Ruby script for collecting phone record statistics from a Facebook user data dump
View facebook-contact-info-summary.rb
#! /usr/bin/env ruby
# NOTE: Requires Ruby 2.1 or greater.
# This script can be used to parse and dump the information from
# the 'html/contact_info.htm' file in a Facebook user data ZIP download.
#
# It prints all cell phone call + SMS message + MMS records, plus a summary of each.
#
# It also dumps all of the records into CSV files inside a 'CSV' folder, that is created
@nikic
nikic / php-5.5-features.md
Last active Nov 27, 2018
List of new features in PHP 5.5
View php-5.5-features.md
You can’t perform that action at this time.