Skip to content

Instantly share code, notes, and snippets.

View AndreiRailean's full-sized avatar
🏠
Working from home

Andrei Railean AndreiRailean

🏠
Working from home
View GitHub Profile
@AndreiRailean
AndreiRailean / gist:31083
Created December 2, 2008 10:31
PHP: twitter status of user
<?php
$twit_user = 'andrei_md';
$url = 'http://twitter.com/users/show/'.$twit_user.'.json';
$twitter_user = json_decode(file_get_contents($url));
echo $twitter_user->status->text;
?>
<?php
$countries = Array(
'AF' => 'Afghanistan',
'AL' => 'Albania',
'DZ' => 'Algeria',
'AS' => 'American Samoa',
'AD' => 'Andorra',
'AO' => 'Angola',
'AI' => 'Anguilla',
'AG' => 'Antigua And Barbuda',
{"ABW":"Aruba",
"AFG":"Afghanistan",
"AGO":"Angola",
"AIA":"Anguilla",
"ALA":"Åland Islands",
"ALB":"Albania",
"AND":"Andorra",
"ANT":"Netherlands Antilles",
"ARE":"United Arab Emirates",
"ARG":"Argentina",
AFG | Afghanistan
ALB | Albania
DZA | Algeria
ASM | American Samoa
AND | Andorra
AGO | Angola
AIA | Anguilla
ATA | Antarctica
ATG | Antigua and Barbuda
ARG | Argentina
<div id="breadcrumbs">
<a href="{{ shop.url }}">Home</a>
{% case template %}
{% when 'product' %}
&raquo; <a href="{{ product.type | url_for_type }}">{{ product.type }}</a>
{% else %}
{% endcase %}
&raquo; <span class="page-title">{{ page_title }}</span>
</div>
require 'rubygems'
require 'sinatra'
require 'redis'
# To use, simply start your Redis server and boot this
# example app with:
# ruby example_note_keeping_app.rb
#
# Point your browser to http://localhost:4567 and enjoy!
#
<div id="categories">
<div id="categories-wrapper">
<ul class="top">
{% for toplink in linklists.product-top-menu.links %}
{% capture link_section %}{{ toplink.title | handleize }}{% endcapture %}
<li class="category {% if forloop.first %}first{% endif %}"><a>{{ toplink.title }}</a>
<ul class="items">
{% for link in linklists[link_section].links %}
<li><a href="{{ link.url }}">{{ link.title }}</a></li>
{% endfor %}

Keybase proof

I hereby claim:

  • I am andreirailean on github.
  • I am andreirailean (https://keybase.io/andreirailean) on keybase.
  • I have a public key whose fingerprint is E471 C53A 5D75 ACFF F336 7B62 FC87 179E 15D8 5E90

To claim this, I am signing this object:

@AndreiRailean
AndreiRailean / clean_local.sh
Last active August 29, 2015 14:10
Clear old branches from local and remote repos
# Delete all merged local branches except for master
git branch --merged master | grep -v master | xargs git branch -d
@AndreiRailean
AndreiRailean / pg.sh
Last active August 29, 2015 14:11 — forked from cjolly/pg.sh
mac upgrade postgres to 9.4.0 after automatic homebrew upgrade
newpg=9.4.0
oldpg=9.3.5_1 # set this to your current PG version
# Stop current Postgres server
# launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
# Backup current db
mv /usr/local/var/postgres/ /usr/local/var/postgres-$oldpg
# Homebrew