Skip to content

Instantly share code, notes, and snippets.

View timbillstrom's full-sized avatar

Tim Billström timbillstrom

View GitHub Profile
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle"
android:dither="true">
<corners android:radius="2dp"/>
<solid android:color="#ccc" />
@timbillstrom
timbillstrom / friends.json
Created December 10, 2014 02:29
m.facebook friends
{
"payload": {
"actions": [
{
"cmd": "replace",
"target": "m_more_friends",
"html": "<div><div class=\"item _cs2 acw abt\" data-sigil=\"undoable-action marea\"><div class=\"ib cc _1aj4\"><a class=\"darkTouch _1aj5 l\" href=\"/billstromjack?fref=fr_tab&amp;pn_ref=friends_all\"><i class=\"img profpic\" aria-label=\"Jack Billstr&#xf6;m\" role=\"img\" style=\"background:#d8dce6 url(&quot;https://fbcdn-profile-a.akamaihd.net/hprofile-ak-xaf1/v/t1.0-1/p48x48/10349955_879078795457120_2428684333382669240_n.jpg?oh=bd5d92a080de8314efc5ed991e3870a9&amp;oe=5516CF92&amp;__gda__=1427130917_49565e13a2567dfe38eb34b95a5162b8&quot;) no-repeat center;background-size:100% 100%;-webkit-background-size:100% 100%;width:48px;height:48px;\" data-sigil=\"touchable\"></i></a><div class=\"_4mn c\"><a href=\"/billstromjack?fref=fr_tab&amp;pn_ref=friends_all\"><div class=\"_4mo\"><strong>Jack Billström</strong></div></a><div class=\"_4mp\"><div class=\"_4z0-\" data-sigil=\"m-friend-request-highlight-not
{"payload":{"actions":[{"cmd":"replace","target":"m_more_friends","html":"\u003Cdiv&gt;\u003Cdiv class=\"item _cs2 acw abt\" data-sigil=\"undoable-action marea\"&gt;\u003Cdiv class=\"ib cc _1aj4\"&gt;\u003Ca class=\"darkTouch _1aj5 l\" href=\"\/filip.vi.5?fref=fr_tab&amp;amp;pn_ref=friends_all\"&gt;\u003Ci class=\"img profpic\" aria-label=\"Filip Vi\" role=\"img\" style=\"background:#d8dce6 url(&amp;quot;https:\/\/fbcdn-profile-a.akamaihd.net\/hprofile-ak-xpa1\/v\/t1.0-1\/p480x480\/10422291_1533076660265315_4414758563003550678_n.jpg?oh=6b32c59d139148beae3134df79266fe2&amp;amp;oe=55036A3D&amp;amp;__gda__=1427045183_ef0807ed19a04ac841079dad51329e6f&amp;quot;) no-repeat center;background-size:100\u0025 100\u0025;-webkit-background-size:100\u0025 100\u0025;width:48px;height:48px;\" data-sigil=\"touchable\"&gt;\u003C\/i&gt;\u003C\/a&gt;\u003Cdiv class=\"_4mn c\"&gt;\u003Ca href=\"\/filip.vi.5?fref=fr_tab&amp;amp;pn_ref=friends_all\"&gt;\u003Cdiv class=\"_4mo\"&gt;\u003Cstrong&gt;Filip Vi\u003C\/strong&gt;\u003C\/d
{
"songs":[{
"title":"UFO",
"album":"UFO",
"artist":"Vigiland",
"duration":"144",
"spotify_song":"spotify:track:3zYqHQ4tu4pB2acp9Lltnz",
"spotify_album":"spotify:album:6kfTbuVKwpTPfzMwcDE0Sz",
"spotify_artist":"spotify:artist:3tLYpanVDomWAZqF82NPds",
@timbillstrom
timbillstrom / trafikinformation.html
Created December 17, 2014 00:52
Dintur.se - Trafikinformation
<section id="trafficInfo">
<div class="clickable all clicked" style="display: none;">
<h2>Trafikinfo (3)</h2>
<span id="chooseArea">Område<span></span></span>
</div>
<div class="clickable omrade omrade14 clicked" style="display: inline-block;">
<h2>Trafikinfo: Matfors (1)</h2>
@timbillstrom
timbillstrom / resize_nocrop_noscale
Created September 21, 2016 19:58 — forked from maxivak/resize_nocrop_noscale
Crop and resize an image using MiniMagick in Ruby on Rails. Two approaches.
def resize_nocrop_noscale(image, w,h)
w_original = image[:width].to_f
h_original = image[:height].to_f
if w_original < w && h_original < h
return image
end
# resize
image.resize("#{w}x#{h}")
@timbillstrom
timbillstrom / dropbox_backup.sh
Created December 9, 2016 13:30
Bash - Backup DB and site files to Dropbox folder.
#!/bin/bash
backup_path="/backup/$(date +"%y-%m-%d")/$(date +"%H-%M")-backup"
initdump () {
mkdir -p /tmp_backup
dump
storage
}
dump () {
@timbillstrom
timbillstrom / notify_46elks.sh
Created December 9, 2016 13:37
Bash - Check status for API, if status is unknown PING admin via SMS. To avoid extra text messages that day we save a textfile with a prefix specific to the day of alert.
#!/bin/bash
response=$(curl http://localhost:3000/api/status)
alert () {
curl -X POST \
-u username:password \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "from=BRON" \
-d "message=Status for API is unknown! 😭" \
-d "to=+467900000" \
@timbillstrom
timbillstrom / IVR.json
Last active December 16, 2016 15:32
46Elks incoming call params
{
"to":"+467668614100",
"direction":"incoming",
"from":"+467383931100",
"result":"newincoming",
"callid":"cae4eb39e3ea72caa36bb254c94760930"
}
@timbillstrom
timbillstrom / waze-types.json
Created January 3, 2017 15:58
Waze API Types
POLICE
- POLICE_HIDING // Gömd poliskontroll
- POLICE_VISIBLE // Poliskontroll
HAZARD
- HAZARD_ON_SHOULDER_CAR_STOPPED // Fordon har stannat på vägrenen