This file contains hidden or 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
Deface::Override.new(:name => "remove billing address form", | |
:virtual_path => "spree/checkout/_address", | |
:remove => "#billing[data-hook]" | |
) | |
Deface::Override.new(:name => "remove use billing address checkbox", | |
:virtual_path => "spree/checkout/_address", | |
:remove => "[data-hook='use_billing']" | |
) |
This file contains hidden or 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 ends_with($haystack, $needle) | |
{ | |
$length = strlen($needle); | |
if ($length == 0) { | |
return true; | |
} | |
return (substr($haystack, -$length) === $needle); |
This file contains hidden or 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 | |
/* | |
Plugin Name: Remove admin bar | |
Author: Denis Gukov | |
Version: 1.0 | |
*/ | |
add_action('after_setup_theme', 'remove_admin_bar'); | |
function remove_admin_bar() { |
This file contains hidden or 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
def long_word_wrap(str, options = {}) | |
opts = { length: 10000, word_length: 10, shy_length: 4 }.merge(options) | |
ret = '' | |
offset = 0 | |
str = truncate(str, length: opts[:length]) if str.length > opts[:length] | |
m = str.match(/[^\s\n\r]{#{opts[:word_length]},}/, offset) | |
while m | |
ret << h(str[offset..m.begin(0)-1]) if offset < m.begin(0) | |
s = m[0].scan(/[^\s\n\r]{1,#{opts[:shy_length]}}/) | |
ret << s.map{ |x| h(x) }.join('­') |
This file contains hidden or 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
private class HttpUploadImageTask extends AsyncTask<String, Void, Boolean> { | |
final Bitmap imageBitmap; | |
public HttpUploadImageTask(final Bitmap imageBitmap) { | |
this.imageBitmap = imageBitmap; | |
} | |
@Override | |
protected Boolean doInBackground(String... urls) { | |
for (final String u : urls) { | |
try { |
This file contains hidden or 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
#!/bin/sh | |
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the | |
# CREATE block and create them in separate commands _after_ all the INSERTs. | |
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk. | |
# The mysqldump file is traversed only once. | |
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite | |
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite |
NewerOlder