Skip to content

Instantly share code, notes, and snippets.

@lifeisfoo
lifeisfoo / results.txt
Last active December 16, 2015 22:29 — forked from anonymous/results.txt
Running hphp... [84 errors in core]
--------------------------------
File : applications/vanilla/controllers/class.discussionscontroller.php:479
Reason : UseUndeclaredVariable
Snippet : $ID
Line : $User = $UserModel->GetID($ID, DATASET_TYPE_ARRAY);
--------------------------------
File : applications/vanilla/modules/class.promotedcontentmodule.php:281
@lifeisfoo
lifeisfoo / Disable mysql+apache autostart ubuntu upstart
Last active December 18, 2016 11:49
avoid mysql apache start at boot ubuntu 13.04
echo "manual" | sudo tee -a /etc/init/mysql.override
sudo update-rc.d -f apache2 remove
# then, to start manually
# sudo service apache2 start
# sudo service mysql start
@lifeisfoo
lifeisfoo / gist:8547561
Last active January 4, 2016 01:19
Linux + NGINX + php-fpm + custom domain (digitalocean)
https://www.digitalocean.com/community/articles/how-to-set-up-nginx-virtual-hosts-server-blocks-on-ubuntu-12-04-lts--3
http://wiki.nginx.org/WordPress
http://www.howtoforge.com/installing-nginx-with-php5-and-php-fpm-and-mysql-support-lemp-on-ubuntu-12.04-lts
http://codex.wordpress.org/Installing_WordPress#Step_2:_Create_the_Database_and_a_User
https://rtcamp.com/tutorials/php/increase-file-upload-size-limit/
@lifeisfoo
lifeisfoo / 0_reuse_code.js
Created January 26, 2014 13:55
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
http://wiki.centos.org/HowTos/SELinux#head-4f1e4e4307ab4e76c81ae5fbebc24a907b24fd92
http://wiki.centos.org/HowTos/Network/IPTables
http://serverfault.com/questions/418955/cant-connect-to-ruby-on-rails-development-server-on-centos-6-3
iptables -I INPUT -p tcp --dport 3000 -j ACCEPT
service iptables save
//The connect.options.middleware is the relevant part
//Adapted from https://github.com/yeoman/generator-angular/issues/433#issuecomment-37706899
// Generated on 2014-01-30 using generator-angular 0.7.1
'use strict';
// # Globbing
// for performance reasons we're only matching one level down:
// 'test/spec/{,*/}*.js'
// use this if you want to recursively match all subfolders:
@lifeisfoo
lifeisfoo / nightwatch.json
Created March 27, 2015 14:11
nightwatch.json configuration file with chrome --disable-web-security
{
"src_folders" : ["tests"],
"output_folder" : "reports",
"custom_commands_path" : "",
"custom_assertions_path" : "",
"globals_path" : "",
"selenium" : {
"start_process" : false,
"server_path" : "lib/selenium-server-standalone-2.45.0.jar",
@lifeisfoo
lifeisfoo / android-mail.java
Last active March 4, 2024 00:52
android send mail with attachment, without write file to external memory
//based on http://stephendnicholas.com/archives/974
package it.my.app;
import android.content.ContentProvider;
import java.io.File;
import java.io.FileNotFoundException;
import android.content.ContentProvider;
import android.content.ContentValues;
import android.content.UriMatcher;
@lifeisfoo
lifeisfoo / Log2Sqlite.java
Created April 13, 2015 08:04
Use sqlite to as a database log in android
package com.example.alessandro.sqlitetest;
import java.util.LinkedList;
import java.util.List;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
@lifeisfoo
lifeisfoo / LogModel.java
Created April 13, 2015 08:05
LogModel for logging in android and sqlite
package com.example.alessandro.sqlitetest;
public class LogModel {
private int id;
private int created;
private String content;
public LogModel(){}