This file contains 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
/* | |
Target: iOS, iOS5 | |
Let's say you have a SQLite DB to index a number of files, resources, or items in general. | |
You want to perform a full-text search on this item. Example: | |
TABLE: Item | |
---------------------------------------------------------------------- | |
ID | Name | Description |
This file contains 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
(function($) { | |
var settings = { | |
hoverClass: 'sUpload-hover', | |
dropAreaClass: 'sUpload-drop', | |
dropMessage: 'Drop file here!', | |
dropAreaHeight: 200, uploadURL: null, | |
fileReaderCallback: null, | |
fileUploadCallback: null, | |
errorCallback: null | |
}, |
This file contains 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 | |
function unzip($file) { | |
$zip = zip_open($file); | |
if (is_resource($zip)) { | |
$tree = ""; | |
while (($zip_entry = zip_read($zip)) !== false) { | |
echo "Unpacking " . zip_entry_name($zip_entry) . "\n"; | |
if (strpos(zip_entry_name($zip_entry), DIRECTORY_SEPARATOR) !== false) { | |
$last = strrpos(zip_entry_name($zip_entry), DIRECTORY_SEPARATOR); | |
$dir = substr(zip_entry_name($zip_entry), 0, $last); |
This file contains 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
find . -name "*.php" | while read line; do expand -t 4 $line > $line.new; mv $line.new $line; done |
This file contains 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 java.text.DateFormat; | |
import java.text.SimpleDateFormat; | |
import java.util.Calendar; | |
public class DateUtil { | |
public static String getDate(long milliSeconds) { | |
DateFormat formatter = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss.SSS"); | |
Calendar calendar = Calendar.getInstance(); | |
calendar.setTimeInMillis(milliSeconds); | |
return formatter.format(calendar.getTime()); |
This file contains 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
package es.cloudey.webanalyzer.util; | |
import java.util.ArrayList; | |
import java.util.Collection; | |
public class MFArrayList<E> extends ArrayList<E> { | |
private static final long serialVersionUID = 7281673743494991943L; | |
public MFArrayList(){ |
This file contains 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
package es.cloudey.pagespeed.util; | |
import java.util.HashMap; | |
import java.util.Map; | |
import android.os.Bundle; | |
import android.os.Parcelable; | |
public class CollectionUtils { | |
public static Bundle toBundle(Map<String, ? extends Parcelable> input) { |
This file contains 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
Vagrant.configure(2) do |config| | |
config.vm.box = "ubuntu/trusty64" | |
config.vm.network "forwarded_port", guest: 80, host: 8080 | |
config.vm.provider "virtualbox" do |vb| | |
# Display the VirtualBox GUI when booting the machine | |
vb.gui = false | |
vb.memory = "512" | |
end | |
end |
This file contains 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
Vagrant.configure(2) do |config| | |
config.vm.box = "ubuntu/trusty64" | |
config.vm.network "forwarded_port", guest: 80, host: 8080 | |
config.vm.provider "virtualbox" do |vb| | |
# Display the VirtualBox GUI when booting the machine | |
vb.gui = false | |
vb.memory = "512" | |
end | |
# Use Ansible for provisioning and load playbook.yml | |
config.vm.provision :ansible do |ansible| |
This file contains 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
--- | |
- hosts: all | |
sudo: yes | |
tasks: | |
- name: install nginx | |
apt: name=nginx state=present update_cache=yes | |
notify: | |
- start nginx | |
handlers: | |
- name: start nginx |
OlderNewer