Skip to content

Instantly share code, notes, and snippets.

View eddywebs's full-sized avatar

Adi eddywebs

View GitHub Profile
@eddywebs
eddywebs / gist:52080a1535f8014bae035dbd42cf9008
Created November 16, 2022 20:07 — forked from dancinllama/gist:8f789e759dda1ce0a883
Thou shalt not put queries in loops (good example)
List<Account> accList = new List<Account>(
[Select
Id
,Name
,(Select
Email
From
Contacts
)
From Account]
@eddywebs
eddywebs / self-signed-certificate-with-custom-ca.md
Created March 9, 2018 20:25 — forked from fntlnz/self-signed-certificate-with-custom-ca.md
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@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: [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');
@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; }
@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 / 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
#