Skip to content

Instantly share code, notes, and snippets.

View Swader's full-sized avatar
🏠
Buidling

Bruno Škvorc Swader

🏠
Buidling
View GitHub Profile
@Swader
Swader / xdebug.php.ini
Created February 5, 2013 13:25
Xdebug settings
[xdebug]
zend_extension=/usr/lib/php/extensions/no-debug-non-zts-20090626/xdebug_newer.so
xdebug.profiler_output_dir=/var/xdebug
xdebug.profiler_output_name=cachegrind.out.%s.%u
xdebug.file_link_format="txmt://open?url=file://%f&line=%1"
xdebug.remote_enable = On
xdebug.remote_autostart = 1
@Swader
Swader / virtualhosts.sh.conf
Created February 5, 2013 13:26
virtualhosts.conf
SKIP_DOCUMENT_ROOT_CHECK="yes"
BROWSER="Google Chrome"
DOC_ROOT_PREFIX="/Users/swader/Dropbox/Websites"
@Swader
Swader / icu.sh
Created February 5, 2013 13:27
install ICU
tar xzvf icu4c-4_8_1-src.tgz
cd icu/source
./runConfigureICU MacOSX
make
sudo make install
@Swader
Swader / imap.sh
Created February 5, 2013 13:28
Build imap
cd /usr/local
wget ftp://ftp.cac.washington.edu/imap/imap-2007f.tar.gz
tar zxvf imap-2007f.tar.gz
cd imap-2007f
make osx
@Swader
Swader / locale_error.txt
Created February 5, 2013 13:52
Terminal locale error
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_CTYPE = "UTF-8",
LANG = (unset)
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
@Swader
Swader / showhiddenfiles.sh
Created February 5, 2013 13:52
Show hidden files on OS X
defaults write com.apple.Finder AppleShowAllFiles YES
@Swader
Swader / ss6fix.js
Created February 6, 2013 18:54
Remove dumped personal information from Squarespace blog
<script type="text/javascript" id="tempScript">
var scripts = document.getElementsByTagName('script');
var numberOfScripts = scripts.length;
var tempText;
var current;
while (numberOfScripts--) {
current = scripts[numberOfScripts];
tempText = current.textContent;
if (
tempText.indexOf("Static.SQUARESPACE_CONTEXT") >= 0
@Swader
Swader / build.dart
Created March 14, 2013 18:25
Recursive folder copy in Dart: An updated Dart web_ui build script which recursively copies a folder and its contents to another location. Useful when building for a defined vhost (e.g. Apache with PHP back end for your Dart app) and don't want the build script to relativize your paths to go "one folder up" back from /out into /web to get CSS an…
import 'dart:io';
import 'package:web_ui/component_build.dart';
// Ref: http://www.dartlang.org/articles/dart-web-components/tools.html
main() {
build(new Options().arguments, ['web/index.html']);
//recursiveFolderCopySync('web/assets', 'web/out/assets');
}
bool isSymlink(String pathString) {
@Swader
Swader / bulksql.sh
Created March 15, 2013 22:09
How to import multiple SQL files for separate databases at once from terminal, if those files are named after the database (with an optional prefix / suffix). Just alias it, and change the file format for your own. Taken from http://stackoverflow.com/questions/4708013/import-multiple-sql-dump-files-into-mysql-database-from-shell/12481305
for SQL in *.sql; do DB=${SQL/\.sql/}; echo importing $DB; mysql $DB < $SQL; done
@Swader
Swader / .zshrc
Created March 20, 2013 00:54 — forked from SlexAxton/.zshrc
gifify() {
if [[ -n "$1" ]]; then
if [[ $2 == '--good' ]]; then
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif
rm out-static*.png
else
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif
fi
else