Skip to content

Instantly share code, notes, and snippets.

@bcicen
bcicen / somacli.sh
Last active March 8, 2019 18:01
somacli
#!/bin/bash
baseurl="http://somafm.com"
tmpdir="/tmp/"
boldtext=`tput bold`
normaltext=`tput sgr0`
WGET="/usr/bin/wget"
MPLAYER="/usr/bin/mplayer"
stationnames=("Christmas Rocks!" "Christmas Lounge" "Xmas in Frisko (holiday)" "Groove Salad (ambient/electronica)" "Lush (electronica)" "Earwaves (experimental)" "Deep Space One (ambient)" "Drone Zone (ambient)" "PopTron (alternative)" "DEF CON Radio (specials)" "Dub Step Beyond (electronica)" "Space Station Soma (electronica)" "Mission Control (ambient/electronica)" "Indie Pop Rocks! (alternative)" "Folk Forward (folk/alternative)" "BAGeL Radio (alternative)" "Digitalis (electronica/alternative)" "Sonic Universe (jazz)" "Secret Agent (lounge)" "Suburbs of Goa (world)" "Boot Liquor (americana)" "Illinois Street Lounge (lounge)" "The Trip (electronica)" "cliqhop idm (electronica)" "Iceland Airwaves (alternative)" "Covers (eclectic)" "Underground 80s (alternative/electronica)" "Beat Blender (electronica)" "Doomed (ambient/industrial)" "Black Rock FM (eclectic)" "SF
@joshmcarthur
joshmcarthur / jquery-ajax-retry.js
Created September 13, 2016 00:14
jQuery AJAX Prefilter for retrying failed XHR requests with backoff delay
/**
* This AJAX prefilter is based on http://stackoverflow.com/a/12840617 with some changes:
* 1. References to the question asker's context have been removed (they related to Auth)
* 2. Fixes have been made to code style at JSHint's request.
* 3. Assign max retries so that we can determine how many retries we STARTED from.
* 4. Add a setTimeout call so that the retried requests wait before performing the request.
* 5. Treat a '0' status as an error. (JM: I believe this is because Ember fakes it's own 'XHR' object
* that doesn't contain the actual request status code).
*/
@rhysburnie
rhysburnie / jquery-ajax-dataFilter.js
Last active January 17, 2022 22:02
jQuery ajax dataFilter to remove scripts from html string to prevent script execution if loading string into a temp dom element
function dfStripScripts = function(data, type)
{
// incase the response is full html with scripts remove them
type = type || 'text';
if(type=='html'||type=='text'){
/*return data.replace(/<script.*>.*?<\/script>/gi, '');*/
return data.replace(/<script.*?>([\w\W\d\D\s\S\0\n\f\r\t\v\b\B]*?)<\/script>/gi, '');
}
return data;
};
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@roachhd
roachhd / quick-ref-jekyll-markdown.md
Created November 11, 2014 09:15
Jekyll Markdown Quick Reference

#Jekyll Markdown Quick Reference

####Write in simply awesome markdown

layout: post
title: Markdown Style Guide
---
@matinrco
matinrco / toBase64.js
Last active July 14, 2023 16:11
Convert any file to base64 in javascript
var toBase64=function (file , callBack) {
file=file.files[0];
var reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = function () {
callBack(file,reader.result);
};
reader.onerror = function (error) {
console.log('Error: ', error);
};
@dikiaap
dikiaap / git-io-custom-url.md
Last active August 5, 2023 04:21
git.io custom URL

Update: As of 11 January 2022, git.io no longer accepts new URLs.

Command:

curl https://git.io/ -i -F "url=https://github.com/YOUR_GITHUB_URL" -F "code=YOUR_CUSTOM_NAME"

URLs that can be created is from:

  • https://github.com/*
  • https://*.github.com
@p3t3r67x0
p3t3r67x0 / pseudo_elements.md
Last active January 16, 2024 01:17
A CSS pseudo-element is used to style specified parts of an element. In some cases you can style native HTML controls with vendor specific pseudo-elements. Here you will find an list of cross browser specific pseudo-element selectors.

Styling native elements

Native HTML controls are a challenge to style. You can style any element in the web platform that uses Shadow DOM with a pseudo element ::pseudo-element or the /deep/ path selector.

video::webkit-media-controls-timeline {
  background-color: lime;
}

video /deep/ input[type=range] {
@kevinSuttle
kevinSuttle / meta-tags.md
Last active March 31, 2024 14:26 — forked from lancejpollard/meta-tags.md
List of Usable HTML Meta and Link Tags