Skip to content

Instantly share code, notes, and snippets.

View pabloroman's full-sized avatar

Pablo Román pabloroman

View GitHub Profile

Ticket 1111

We'd like to add a page to view user profiles. Users can view only their own profiles but an admin can see anyone's profile.

A user can also update their profile, they are allowed to change their display name and phone number. Afterwards their updated profile should be shown.

For compliance reasons, we need to log when a user views their own profile. We don't want to log views by admins.

Just for clarity's sake, it would be nice if we could highlight on the page if the user is an admin.

pablo@web01:~$ wget -d "https://packagist.org/p/provider-active\$935770e07ea8c28bcb5f81f647e65fd6564b068ec0fd585658643f0604e1f064.json"
DEBUG output created by Wget 1.15 on linux-gnu.
URI encoding = ‘UTF-8’
--2014-08-29 16:42:15-- https://packagist.org/p/provider-active$935770e07ea8c28bcb5f81f647e65fd6564b068ec0fd585658643f0604e1f064.json
Resolving packagist.org (packagist.org)... 87.98.253.214
Caching packagist.org => 87.98.253.214
Connecting to packagist.org (packagist.org)|87.98.253.214|:443... connected.
Created socket 3.
Releasing 0x0000000000758e60 (new refcount 1).
@pabloroman
pabloroman / gist:e7a37e345e0be99f48d9
Created August 29, 2014 16:42
Packagist fails to download
pablo@web02:~$ wget -d "https://packagist.org/p/provider-active\$c374b7b143b6ea3c0e8f6cf094fba6e23e434495c7d37d466f46db3e94836ed7.json"
DEBUG output created by Wget 1.15 on linux-gnu.
URI encoding = ‘UTF-8’
--2014-08-29 16:34:23-- https://packagist.org/p/provider-active$c374b7b143b6ea3c0e8f6cf094fba6e23e434495c7d37d466f46db3e94836ed7.json
Resolving packagist.org (packagist.org)... 87.98.253.214
Caching packagist.org => 87.98.253.214
Connecting to packagist.org (packagist.org)|87.98.253.214|:443... connected.
Created socket 3.
Releasing 0x0000000000dd3e30 (new refcount 1).
[{"asin":"B0014DC0AK","date":"1995","id":616,"image":true,"label":"Roadrunner Records","name":"Symbolic","release_type":"Full-length","review_count":27,"score":91.63,"spotify_link":"spotify:album:1QgFthItpbxvMXlgGjvhBR","score_name":"masterpiece","band":{"id":141,"name":"Death"}},{"tracks":[{"bpm":113.681,"disc_number":1,"echonest_id":"SOPFWHK12A8C140897","energy":0.98194,"title":"Symbolic","track_length":"06:33","track_number":1},{"bpm":80.314,"disc_number":1,"echonest_id":"SOHUCRR12A8C1408A8","energy":0.95794,"title":"Zero Tolerance","track_length":"04:49","track_number":2},{"bpm":117.066,"disc_number":1,"echonest_id":"SOHCLLM13129A8FD63","energy":0.99087,"title":"Empty Words","track_length":"06:22","track_number":3},{"bpm":138.646,"disc_number":1,"echonest_id":"SOGNMJN12A8C13F649","energy":0.98934,"title":"Sacred Serenity","track_length":"04:27","track_number":4},{"bpm":108.546,"disc_number":1,"echonest_id":"SODBTSH1374054F530","energy":0.9929,"title":"1,000 Eyes","track_length":"04:29","track_number":5},{
@pabloroman
pabloroman / gist:9386725
Created March 6, 2014 10:14
Pro notification emails
No more TNW Pro for you? Oh NOES!
--------------------------------
Hi Pablo,
Thank you for trying out a TNW Pro account for the past month! Unfortunately your time is up. That was it amigo. You are all done.
Missed my earlier email to extend your Pro membership? No problem at all, just click here to fix this: http://thenextweb.com/pro/
If you have decided not to upgrade for now don’t worry either. We still love you. Was it a money issue? Are you short on cash? Can we pitch in somehow? Or maybe it wasn’t the money? Oh well, that’s not our business really. Have a great day and keep in touch!
@pabloroman
pabloroman / gist:7308541
Created November 4, 2013 20:14
Disqus callback
public function action_disqus() {
$input = Input::all();
if ( isset( $input['error'] ) ) {
die( $input['error'] );
}
if( isset( $input['verify'] ) ) {
$code = $input['code']; // A temporary token which you will exchange for a finalized access token.
@pabloroman
pabloroman / gist:6068508
Last active December 20, 2015 04:09
Cronjobs para politweets.es
* * * * * php /var/www/politweets.es/private/stream/process_stream.php >> /dev/null 2>&1
*/5 * * * * php /var/www/politweets.es/private/stream/monitor_stream.php >> /dev/null 2>&1
50 * * * * php /var/www/politweets.es/private/scripts/beanstalk/stats_updater.fill.php >> /dev/null 2>&1
* * * * * php /var/www/politweets.es/private/scripts/beanstalk/stats_updater.process.php >> /dev/null 2>&1
15 * * * * find /var/www/dev.politweets.es/private/cache/es/sql -mmin +720 -delete
15 * * * * find /var/www/politweets.es/private/cache/es/sql -mmin +720 -delete
20 * * * * find /var/www/dev.politweets.es/private/cache/es/html -mmin +720 -delete
20 * * * * find /var/www/politweets.es/private/cache/es/html -mmin +720 -delete
@pabloroman
pabloroman / gist:5611769
Created May 20, 2013 11:42
Varnishtop -i TxURL
1.49 TxURL /wp-admin/post.php?post=621963&action=edit&message=10
1.48 TxURL /?p=621963&preview=true
1.13 TxURL /?s=%22datadog%22
1.09 TxURL /2009/01/08/how-to-snap-up-that-twitter-username-youve-always-wanted/
1.00 TxURL /wp-content/blogs.dir/1/files/2012/02/Screen-Shot-2012-02-02-at-9.57.39-AM-594x245.png
1.00 TxURL /wp-content/blogs.dir/1/files/2012/08/youtube-520x245@2x.jpg
1.00 TxURL /apps/2011/09/07/the-5-best-blogging-platforms-you-havent-heard-of/
1.00 TxURL /wp-content/blogs.dir/1/files/2013/05/2013-05-19_10h02_57-520x245@2x.jpg
1.00 TxURL /wp-content/blogs.dir/1/files/2011/12/Altodot-The-Fan-Machine-founders-657x245.jpg
1.00 TxURL /wp-content/blogs.dir/1/files/2011/12/Anton-Chalbaud-300x200.jpg
@pabloroman
pabloroman / gist:5611763
Created May 20, 2013 11:40
Varnishtop -i RxURL
96.41 RxURL /wp-content/themes/icetea/assets/stylesheets/styles.css?1366631169
88.53 RxURL /wp-content/themes/icetea/assets/js/tnw.js?1368742061
84.88 RxURL /wp-content/themes/icetea/assets/js/libraries.js?1355331683
75.07 RxURL /wp-content/themes/icetea/assets/images/sprite.20121122.svg
73.08 RxURL /wp-content/themes/icetea/assets/images/tnw-loading-grey.gif
68.45 RxURL /wp-content/themes/icetea/assets/images/spinner.gif
68.26 RxURL /wp-content/themes/icetea/assets/fonts/0dc68bf6-6370-4b81-9d14-f4a3e4945a25-3.woff
67.91 RxURL /wp-content/themes/icetea/assets/fonts/fa446211-272d-435f-84e5-0b72a78d3e68-3.woff
66.48 RxURL /wp-content/themes/icetea/assets/fonts/13e28e74-142d-4dc5-a420-4f51798f8c70-3.woff
66.47 RxURL /favicon.ico
@pabloroman
pabloroman / varnishstat.txt
Created May 20, 2013 11:19
Varnishstat for TNW
39+19:50:15
Hitrate ratio: 10 100 141
Hitrate avg: 0.9519 0.9288 0.9272
140302542 46.93 40.77 client_conn - Client connections accepted
641 0.00 0.00 client_drop - Connection dropped, no sess/wrk
253372226 60.91 73.63 client_req - Client requests received
321234903 86.88 93.35 cache_hit - Cache hits
280754 0.00 0.08 cache_hitpass - Cache hits for pass
23226341 2.00 6.75 cache_miss - Cache misses