This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(d) { | |
var dl = d.createElement('a'); | |
dl.innerText = 'Download MP3'; | |
dl.href = "http://media.soundcloud.com/stream/"+d.querySelector('#main-content-inner img[class=waveform]').src.match(/\.com\/(.+)\_/)[1]; | |
dl.download = d.querySelector('em').innerText+".mp3"; | |
d.querySelector('.primary').appendChild(dl); | |
dl.style.marginLeft = '10px'; | |
dl.style.color = 'red'; | |
dl.style.fontWeight = 700; | |
})(document); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# wordpress over fastcgi | |
server { | |
listen 81; | |
server_name _; | |
root /mnt/apps/airpair-blog/current; | |
index index.html index.php /index.php; | |
# restricting all dot files | |
location ~ /\. { return 403; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery("[id$=here_goes_apex_control_id]"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Example of using JSON serialization to pass complex objects to @future handlers in Apex | |
* $author: [email protected] | |
*/ | |
public with sharing class AddressFuture { | |
public AddressFuture () { | |
List<String> addresses = new List<String>(); | |
AddressHelper ah1 = new AddressHelper('1 here st', 'San Francisco', 'CA', '94105'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#add remote repo from where commit needs to be pulled | |
git remote add <remote-repo> <git repository> | |
#fetch all the updates from remote-repo | |
git fetch <remote-repo> | |
#when the changes from the repo are fetched issue command below | |
git cherry-pick --strategy=recursive -X theirs <here-goes-sha1-for-commit-to-pull-from-remote-repo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo killall fbi >/dev/null 2>&1 | |
dialog --infobox "\nWelcome to retro gaming console - First time boot ! hang tight - Resizing the filesystem ..." 5 60 | |
sudo raspi-config nonint do_expand_rootfs >/dev/null 2>&1 | |
sleep 2 | |
dialog --infobox "\nDone. Rebooting now- ready to play in few moments..." 5 60 | |
sudo rm -f /etc/profile.d/01-expand.sh | |
sleep 2 | |
sudo reboot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I first needed to install rpi-update... | |
"sudo apt-get install rpi-update" | |
the update the kernel using: | |
sudo rpi-update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//redirect a page to visualforce page | |
ApexPages.PageReference pg = new ApexPages.PageReference('/apex/<VisualForcePage>?id='+Contact.Id); | |
pg.setRedirect(true); | |
return pg; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
List<Id> accountids = new List<Id>(); | |
accountids.addAll(new Map<Id, sObject>([select id from account where parentid='0016000000zK5N7AAK']).keyset()); | |
system.debug(accountids); |
OlderNewer