Skip to content

Instantly share code, notes, and snippets.

View salaros's full-sized avatar
🎉
Making magic happen

Yaroslav Zhmayev salaros

🎉
Making magic happen
View GitHub Profile
@hubgit
hubgit / file-exists-ci.php
Created June 28, 2010 16:10
Check if a file exists, with case-insensitive file name.
<?php
function file_exists_ci($file) {
if (file_exists($file))
return $file;
$lowerfile = strtolower($file);
foreach (glob(dirname($file) . '/*') as $file)
if (strtolower($file) == $lowerfile)
@anotheremily
anotheremily / find-base64-occurences
Created December 6, 2010 22:25
hackers seem to like base64 encoding their php commands
#!/bin/bash
find . -name "*.php" -exec grep "base64" '{}' \; -print &> b64-detections.txt
find . -name "*.php" -exec grep "eval" '{}' \; -print &> eval-detections.txt
@bowsersenior
bowsersenior / stooge_loader.rb
Created May 18, 2011 23:18
A demo of YAML anchors, references and nested values
require 'rubygems'
require 'yaml'
# A demonstration of YAML anchors, references and handling of nested values
# For more info, see:
# http://atechie.net/2009/07/merging-hashes-in-yaml-conf-files/
stooges = YAML::load( File.read('stooges.yml') )
# => {
# "default" => {
@oodavid
oodavid / README.md
Created March 26, 2012 17:05
Backup MySQL to Amazon S3

Backup MySQL to Amazon S3

This is a simple way to backup your MySQL tables to Amazon S3 for a nightly backup - this is all to be done on your server :-)

Sister Document - Restore MySQL from Amazon S3 - read that next

1 - Install s3cmd

this is for Centos 5.6, see http://s3tools.org/repositories for other systems like ubuntu etc

@oodavid
oodavid / README.md
Created March 26, 2012 21:21
Restore MySQL from Amazon S3

Restore MySQL from Amazon S3

This is a hands-on way to pull down a set of MySQL dumps from Amazon S3 and restore your database with it

Sister Document - Backup MySQL to Amazon S3 - read that first

1 - Set your MySQL password and S3 bucket, make a temp dir, get a list of snapshots

# Set our variables

export mysqlpass="ROOTPASSWORD"

@mjumbewu
mjumbewu / gist:4667649
Last active February 5, 2024 17:59
Synaptic TouchPad properties on a Dell XPS 13
mjumbewu@mjumbewu-xps ~
$ uname -a
Linux mjumbewu-xps 3.5.0-22-generic #34+kamal11~DellXPS-Ubuntu SMP Fri Jan 11 09:12:57 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
mjumbewu@mjumbewu-xps ~
$ xinput list-props 12
Device 'CyPS/2 Cypress Trackpad':
Device Enabled (132): 1
Coordinate Transformation Matrix (134): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
Device Accel Profile (255): 1
@HarishChaudhari
HarishChaudhari / country-code-to-currency-code-mapping.csv
Last active April 26, 2024 12:10
Country, Country Code, Currency code mapping in CSV format Taken from https://gist.github.com/304261 Contains 249 countries.
Country CountryCode Currency Code
New Zealand NZ New Zealand Dollars NZD
Cook Islands CK New Zealand Dollars NZD
Niue NU New Zealand Dollars NZD
Pitcairn PN New Zealand Dollars NZD
Tokelau TK New Zealand Dollars NZD
Australian AU Australian Dollars AUD
Christmas Island CX Australian Dollars AUD
Cocos (Keeling) Islands CC Australian Dollars AUD
Heard and Mc Donald Islands HM Australian Dollars AUD
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active April 30, 2024 04:42
A badass list of frontend development resources I collected over time.
@elclanrs
elclanrs / email-confirmation.php
Last active July 26, 2022 00:11
Simple e-mail confirmation plugin for WordPress.
<?php
/**
* Plugin Name: Email Confirmation
* Description: Send an email to the user with confirmation code and store form data in database until user confirms.
* Author: Cedric Ruiz
*/
class EmailConfirmation
{
const PREFIX = 'email-confirmation-';