Skip to content

Instantly share code, notes, and snippets.

View lucien144's full-sized avatar
🤘
Refactor!

lucien144

🤘
Refactor!
View GitHub Profile
@lucien144
lucien144 / mysql.sql
Created February 19, 2016 00:24
Useful MySQL queries, tricks, tips
--- Show current SQLs
SELECT time, state, info FROM information_schema.processlist WHERE command != 'Sleep' ORDER BY time ASC;
@lucien144
lucien144 / copydeck.md
Last active July 10, 2017 00:29
List of useful copy

Login

Forgotten password

  • Hello. \n If you want to reset your password, please, follow this link. [email]
  • Reset your password [heading]
  • Your new password [placceholder]
  • Repeat your password [placceholder]
  • [Thanks! | Wohoo!] Your password has been changed. [alert, notification]
  • [Thanks!] Please, follow the instructions in the email [we] just sent you. [alert, notification]
  • [Please enter your email and follow the instructions to re-set your password.] [description]
  • [Ooops!| Yay! | Sorry!] Invalid email address, we cannot send you the reset password instructions. [alert, notification]
@lucien144
lucien144 / HomepagePresenter.php
Created February 16, 2016 23:46
Nette Latte macro: ifCurrentIn (array)
<?php
/**
* Homepage presenter.
*
* @author John Doe
* @package MyApplication
*/
class HomepagePresenter extends BasePresenter
{
@lucien144
lucien144 / index.html
Created February 4, 2016 22:51
livereload.js - minified and obfuscated
<script async>
var _0x1e69=["\x73\x65\x61\x72\x63\x68","\x68\x6F\x73\x74\x6E\x61\x6D\x65","\x3C\x73\x63\x72\x69\x70\x74\x20\x73\x72\x63\x3D\x22\x2F\x2F\x31\x32\x37\x2E\x30\x2E\x30\x2E\x31\x3A\x33\x35\x37\x32\x39\x2F\x6C\x69\x76\x65\x72\x65\x6C\x6F\x61\x64\x2E\x6A\x73\x22\x3E\x3C\x2F","\x73\x63\x72\x69\x70\x74\x3E","\x77\x72\x69\x74\x65"];if(location[_0x1e69[1]][_0x1e69[0]](/localhost|.dev/)>=0){document[_0x1e69[4]](_0x1e69[2]+_0x1e69[3])};
</script>
@lucien144
lucien144 / png2jpg.sh
Created January 18, 2016 11:06
Mac OS bulk convert from PNG to JPG (inline)
#!/bin/bash
mkdir converted;for i in *.png; do sips -s format jpeg $i --out converted/`echo "$i" | sed -e "s/\.png//g"`.jpg;done
@lucien144
lucien144 / mysql-backup.sh
Last active April 6, 2016 08:32
Server backup - MySQL & Vhosts - to S3 usign s3cmd
#! /bin/bash
# MySQL requirements
# CREATE USER 'backup'@'localhost' IDENTIFIED BY 'secret';
# GRANT SELECT, SHOW VIEW, RELOAD, REPLICATION CLIENT, EVENT, TRIGGER ON *.* TO 'backup'@'localhost';
# GRANT LOCK TABLES ON *.* TO 'backup'@'localhost';
TIMESTAMP=$(date +"%A")
DATE=$(date +"%F")
BACKUP_DIR="./mysql-backup"
@lucien144
lucien144 / 0_reuse_code.js
Created October 10, 2015 19:23
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@lucien144
lucien144 / application.xml
Created October 7, 2015 10:01
Allow non-secure connection for Adobe AIR build under iOS9 SDK
<!--
Fixing IOError #2032 caused by ATS in iOS9 for Adobe AIR applications.
More: http://htmlspank.tumblr.com/post/130674234457/ioerror-2032-ios9-adobe-air-and-ats
//-->
<InfoAdditions>
<![CDATA[
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
@lucien144
lucien144 / composer.json
Created August 3, 2015 13:37
J4W XML/JSON templates translator
{
"repositories": [{
"type": "package",
"package": {
"name": "PHPOffice/PHPExcel",
"version": "1.8.0",
"source": {
"url": "https://github.com/PHPOffice/PHPExcel.git",
"type": "git",
"reference": "1.8.0"
<?php
/*
This is an update of https://wordpress.org/plugins/tumblr-importer/ that fixes several issues:
- do not skip posts without title/content
- when importing 1 image import it as a WP type image instead of gallery
- when importing images, import first image as a post's featured image
Plugin Name: Tumblr Importer
Plugin URI: http://wordpress.org/extend/plugins/tumblr-importer/