UI for creating categories and subcategories example.
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
# Tweaked from http://tomislavsantek.iz.hr/2011/03/moving-mysql-databases-to-ramdisk-in-ubuntu-linux | |
# Log in as root | |
# Mount ramdisk folder in RAM | |
mkdir /tmp/ramdisk | |
mount -t tmpfs -o size=128M tmpfs /tmp/ramdisk/ | |
# Move MySQL data | |
mv /var/lib/mysql /tmp/ramdisk/mysql | |
ln -s /tmp/ramdisk/mysql/ /var/lib/mysql |
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
\s - whitespace | |
\n - newline | |
\} - } symbol | |
\b\w+\b - select all words | |
<(.*?)> - everything like <div class="col-xs-12"> | |
[a-z0-9_.]+(jpeg|jpg|png|gif) - "http://localhost/./files/pictures/picture_532.png" | |
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
require 'rubygems' | |
require 'nokogiri' | |
require 'open-uri' | |
require 'json' | |
require 'net/http' | |
require 'uri' | |
require 'open_uri_redirections' | |
require 'openssl' | |
def ping url |
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
require 'json' | |
require 'rubygems' | |
require 'nokogiri' | |
require 'open-uri' | |
require 'net/http' | |
file = File.read('music.json') | |
data_hash = JSON.parse(file) |
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
var wfw = function(){ | |
this.custom = { | |
trailerBrands: function(){ | |
var brands = []; | |
function init() { | |
CKEDITOR.instances.TrailerBrands.on("loaded", function(){ | |
CKEDITOR.instances.TrailerBrands.destroy(true); | |
$('#TrailerBrands').hide(); | |
}); |
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
require 'mechanize' | |
require 'logger' | |
website = ARGV[0] | |
uname = ARGV[1] | |
upass = ARGV[2] | |
agent = Mechanize.new { |agent| | |
agent.open_timeout = 6 | |
agent.read_timeout = 6 |
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
#!/usr/bin/python | |
import sys | |
import os | |
import requests | |
import json | |
url = 'http://api.forismatic.com/api/1.0/' | |
params = dict( |
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 | |
private function getListing() | |
{ | |
/* | |
$listingSid = \App()->Request['sid']; | |
$listing = \App()->ListingManager->getListingBySID($listingSid); | |
$json = $listing->getValueForEncodingToJson(); | |
$newJson = array(); | |
foreach ( $json as $k => $j ) { | |
$newJson[$k] = $j['value']; |
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 | |
$host = gethostname(); | |
$ip = gethostbyname($host); |
OlderNewer