Skip to content

Instantly share code, notes, and snippets.

View olitomas's full-sized avatar
🎯
Focusing

Óli Tómas olitomas

🎯
Focusing
  • Repeat.is, Orkuskipting.is, Fjáröflun.is, Skildingur, Kaffiklúbburinn
  • Iceland
View GitHub Profile
@olitomas
olitomas / gist:43d8156e6f9470dfa90a041a114e5d30
Created August 18, 2020 13:01
Django rest framework strings
Invalid basic header. No credentials provided.
Invalid basic header. Credentials string should not contain spaces.
Invalid basic header. Credentials not correctly base4 encoded.
Invalid username/password.
User inactive or deleted.
from facebook_business.adobjects.adaccount import AdAccount
from facebook_business.api import FacebookAdsApi
from facebook_business.adobjects.adset import AdSet
from facebook_business.adobjects.adsinsights import AdsInsights
import arrow
my_access_token = 'xxx'
my_app_id = 'xxx'
my_app_secret = 'xxx'
@olitomas
olitomas / chmod.sh
Created October 14, 2016 02:17
Terminal chmod recursive (réttindastýringar)
//Þetta setur allar möppur sem 755 (recursive)
find . -type d -exec chmod 755 {} \;
//Þetta setur alla fæla sem 644 (recursive)
find . -type f -exec chmod 644 {} \;
@olitomas
olitomas / parseUrl.js
Created July 4, 2016 00:04 — forked from cmatskas/parseUrl.js
ParseUrl.js
var parseQueryString = function(url) {
var urlParams = {};
url.replace(
new RegExp("([^?=&]+)(=([^&]*))?", "g"),
function($0, $1, $2, $3) {
urlParams[$1] = $3;
}
);
return urlParams;
var sendEmail = function(settings) {
//attachmentName should be the full name. Example: reikningur.pdf
var s = {
from: settings.from,
replyTo: settings.replyTo,
to: settings.to,
subject: settings.subject,
body: settings.body,
attachment: settings.attachment,
//This is a comment
function cssAnimationEvent(element, type, callback) {
var self = this;
var pfx = ["webkit", "moz", "MS", "o", ""];
for (var p = 0; p < pfx.length; p++) {
if (!pfx[p]) type = type.toLowerCase();
element.addEventListener(pfx[p]+type, function() {
callback(element);
}, false);
}