Skip to content

Instantly share code, notes, and snippets.

View eddywebs's full-sized avatar

Adi eddywebs

View GitHub Profile
jQuery("[id$=here_goes_apex_control_id]");
@eddywebs
eddywebs / hack.sh
Created April 2, 2012 19:19 — forked from erikh/hack.sh
OSX For Hackers
#!/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
#
@eddywebs
eddywebs / sc-dl.js
Created April 18, 2012 06:28 — forked from pheuter/sc-dl.js
Bookmarklet that generates download link for a Soundcloud upload
(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);
@eddywebs
eddywebs / AddressFuture
Created October 26, 2015 17:18 — forked from quintonwall/AddressFuture
Example of using JSON serialization to pass complex objects to @future handlers in Apex
/**
* Example of using JSON serialization to pass complex objects to @future handlers in Apex
* $author: qwall@salesforce.com
*/
public with sharing class AddressFuture {
public AddressFuture () {
List<String> addresses = new List<String>();
AddressHelper ah1 = new AddressHelper('1 here st', 'San Francisco', 'CA', '94105');
#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>
@eddywebs
eddywebs / SEO nginx-settings
Last active January 4, 2016 07:09
nginx config file to route different urls to different apps in host -SEO
# 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; }
I first needed to install rpi-update...
"sudo apt-get install rpi-update"
the update the kernel using:
sudo rpi-update
//redirect a page to visualforce page
ApexPages.PageReference pg = new ApexPages.PageReference('/apex/<VisualForcePage>?id='+Contact.Id);
pg.setRedirect(true);
return pg;
List<Id> accountids = new List<Id>();
accountids.addAll(new Map<Id, sObject>([select id from account where parentid='0016000000zK5N7AAK']).keyset());
system.debug(accountids);
@eddywebs
eddywebs / 01-expand.sh
Created April 24, 2016 02:03
auto expand rootfs on boot
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