Skip to content

Instantly share code, notes, and snippets.

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

Thomas Layh tlayh

🏠
Working from home
View GitHub Profile
@tlayh
tlayh / ShowGist.php
Created January 14, 2014 07:34
Using Gists for Syntaxhighlight in Wordpress
class EmbededGithubGist extends Wordpress {
public function showGithubGist() {
return displayGist();
}
}
@tlayh
tlayh / TwitterApiLoginUrl.php
Last active August 29, 2015 13:56
Get the login URL to sign in with twitter
/**
* get the login url from oauth
*
* @return string $loginUrl
*/
public function getLoginUrl() {
// create the twitterOAuth object using your consumer_key and consumer_secret, after creating an app on
// dev.twitter.com/apps
$this->twitterOAuth = new TwitterOAuth($this->consumerKey, $this->consumerSecret);
@tlayh
tlayh / loginUser.php
Last active August 29, 2015 13:56
Login a user during the callback
/**
* login the user
* should receive the information from twitter/oauth if login was successful
*
* @param string $oauthtoken
* @param string $oauthVerifier
* @return boolean
*/
public function loginUser($oauthtoken, $oauthVerifier) {
@tlayh
tlayh / searchIds.sh
Created April 30, 2014 15:46
Shell script to find unused xliff ids in your project. ./searchIds.sh Packages/Applications/My.Package
#!/bin/bash
files=$( find $1 -name "*xlf" )
for file in $files; do
list=$(cat $file | grep "id=" | cut -d '"' -f2)
for i in `echo $list`; do