Skip to content

Instantly share code, notes, and snippets.

View sole's full-sized avatar
🌞
🌿🌱

sole sole

🌞
🌿🌱
View GitHub Profile
google-chrome --user-agent="Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_7; en-us) AppleWebKit/533.4 (KHTML, like Gecko) Version/4.1 Safari/533.4"
@sole
sole / xcursor theme tutorial
Created September 9, 2010 12:34
A lightly edited version of the xcursor theme tutorial by the_One at http://kde-look.org/content/show.php?content=11428
<---TUTORIAL FOR CREATING XCURSOR THEMES.--->
<---By ThEOnE @ kde-look--->
<---My_foros@yahoo.com.ar-->
_______________________________________________________________________________________
| |
| First of all, let me tell you that everything I know I've learned it by inspecting |
| some xcursor themes like jaguarx, and others. |
@sole
sole / galaxy.c
Created September 10, 2010 22:45
// Copyright (C) 2009 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
@sole
sole / thumbpdf.diff
Created September 26, 2010 20:29
make thumbpdf behave nicely when called from python
diff /usr/bin/thumbpdf /usr/bin/thumbpdf.bak
1c1,5
< #!/usr/bin/env perl
---
> eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q'
> if 0;
> use strict;
> $^W=1; # turn warning on
> #
@sole
sole / JSLitmus.js
Created October 19, 2010 10:11
benchmarking tween.js easing functions
// JSLitmus.js
//
// Copyright (c) 2010, Robert Kieffer, http://broofa.com
// Available under MIT license (http://en.wikipedia.org/wiki/MIT_License)
(function() {
// Private methods and state
// Get platform info but don't go crazy trying to recognize everything
// that's out there. This is just for the major platforms and OSes.
@sole
sole / double_spacing.php
Created August 19, 2011 14:23
Testing double spaces
<?php
$txt = '';
$pasted_text = '';
if($_SERVER['REQUEST_METHOD'] == 'POST')
{
$pasted_text = $_POST['text'];
$text = str_replace("\n", '<span class="n"></span>' . "\n", $pasted_text);
@sole
sole / gist:1493825
Created December 18, 2011 16:27
Rotate video counterclockwise with ffmpeg
ffmpeg -i inputfile -vf "rotate=-2" outputfile
This uses mplayer's rotate filter, so the options are the same:
rotate[=<0−7>]
Rotates the image by 90 degrees and optionally flips it. For values between 4−7 rotation is only done if the movie geometry is portrait and not landscape.
0
Rotate by 90 degrees clockwise and flip (default).
1
Rotate by 90 degrees clockwise.
@sole
sole / macos_is_a_joke.sh
Last active September 29, 2015 14:17
Unretinise files
# delete not retina files
find . -not -iname '*@2x*' -delete
# remove @2x suffix
# MAC OS DOESN'T HAVE RENAME? SERIOUSLY? LIKE... SERIOUSLYYYYYYYY???
for i in *.jpg; do j=`echo $i | sed 's/@2x//'`; echo $j; mv "$i" "$j"; done
# hyphen to underscore
for i in *; do j=`echo $i | sed 's/-/_/g'`; echo $j; mv "$i" "$j"; done
@sole
sole / ios_to_android.sh
Created January 17, 2012 17:26
MOV to Android suitable MP4
WIDTH="720"
HEIGHT="480"
BITRATE="1500k"
for i in $(ls *.mov); do
ffmpeg -i $i -r 30 -vcodec mpeg4 -acodec libfaac -ac 1 -ar 44100 -vf scale=$WIDTH:$HEIGHT -b $BITRATE -y $i.mp4
done
for i in *.mov.mp4; do j=`echo $i | sed 's/.mov.mp4/.mp4/'`; mv "$i" "$j"; done
@sole
sole / compile_ffmpeg.sh
Created January 18, 2012 08:57
Get an updated, 64-bit FFMPEG in your Mac Os X Lion computer
#!/bin/bash
# Thanks to Martin Los for his guide: http://www.martinlos.com/?p=41
URLS=("http://downloads.sourceforge.net/project/lame/lame/3.99/lame-3.99.3.tar.gz" "http://downloads.sourceforge.net/project/faac/faac-src/faac-1.28/faac-1.28.tar.gz" "http://downloads.sourceforge.net/project/faac/faad2-src/faad2-2.7/faad2-2.7.tar.gz")
for i in "${URLS[@]}"
do
echo $i
curl -O -L $i