Skip to content

Instantly share code, notes, and snippets.

Tobsn tobsn

  • San Francisco/Diego, USA; Munich, Germany;
Block or report user

Report or block tobsn

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@tobsn
tobsn / unsure.txt
Created Sep 9, 2016
unsubscribe in different languages
View unsure.txt
We wish you wouldn't go, but we want to respect your inbox. Please verify your email address below. Thank you!
Nous ne souhaiterions pas vous perdre, mais nous respectons votre choix. Veuillez vérifier l’adresse ci-dessous. Merci.
@tobsn
tobsn / cf.states.custom.html
Last active May 19, 2016
clickfunnel snippets
View cf.states.custom.html
<div class="de elInputWrapper elSelectFormBox de-editable de-input-block elAlign_center elMargin0" id="tmp_select_input-97365" data-de-type="select-input" data-de-editing="false" data-title="select input form" data-ce="false" data-trigger="none" data-animate="fade" data-delay="500" type="state" style="margin-top: 10px; outline: none; cursor: pointer;">
<label class="elInputLabel">
<select name="state" class="elInput elSelectInput elInput100 elAlign_left elInputMid elInputStyl0 elInputBG1 elInputBR5 elInputI0 elInputIBlack elInputIRight required0 elInput-Select1 garlic-auto-save" data-type="state">
<option value="AL">Alabama</option>
<option value="AK">Alaska</option>
<option value="AZ">Arizona</option>
<option value="AR">Arkansas</option>
<option value="CA">California</option>
<option value="CO">Colorado</option>
<option value="CT">Connecticut</option>
View gist:83ea76850a3d141952a083ecc947645f
function ismobile(){var a=navigator.userAgent||navigator.vendor||window.opera;return (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|
@tobsn
tobsn / info.txt
Last active Nov 24, 2017 — forked from rpgreen/master.vm
API Gateway "Send Everything" Mapping Template
View info.txt
https://rpgreen.wordpress.com/2016/02/23/a-mapping-template-to-send-everything-to-your-backend-integration/
location/cookie headers:
https://stackoverflow.com/questions/35595672/aws-api-gateway-use-302-redirect-and-set-cookie-header
https://blog.hiramsoftware.com/blog/day-one-aws-api-gateway/
@tobsn
tobsn / aws-sns-event-template-with-actual-ses-deliverynotification-sns-message Lambda function to process a Amazon SES Delivery Notification message from a SNS Topic into a DynamoDB Table
View aws-sns-event-template-with-actual-ses-deliverynotification-sns-message
{
"Records": [
{
"EventSource":"aws:sns",
"EventVersion":"1.0",
"EventSubscriptionArn":"arn:aws:sns:us-west-2:xxxx:xxxx",
"Sns": {
"Type":"Notification",
"MessageId":"88B1B251-2E92-4FC3-BFAA-E3BBD0BAB10A",
"TopicArn":"arn:aws:sns:us-west-2:881222951025:survey-tool-ses-delivery",
@tobsn
tobsn / SecureSessionHandler.php
Last active Mar 18, 2016 — forked from eddmann/SecureSessionHandler.php
Secure session handler implementation.
View SecureSessionHandler.php
<?php
class SecureSessionHandler extends SessionHandler {
protected $key, $name, $cookie;
public function __construct($key, $name = 'MY_SESSION', $cookie = [])
{
$this->key = $key;
$this->name = $name;
@tobsn
tobsn / encodedecode.js
Last active Mar 18, 2016
char code shifting encode decode
View encodedecode.js
var z='',x='',s = 'now.something.com';
for( var i = 0; i < s.length; i++ ){
x += String.fromCharCode(s.charCodeAt(i)^6);
}
console.log(x)
for( var i = 0; i < x.length; i++ ){
z += String.fromCharCode(6^x.charCodeAt(i));
}
console.log(z)
@tobsn
tobsn / replace php
Created Mar 18, 2016
super simple token replace
View replace php
$G['c2'] = 'bar';
$r='http://google.com/?s1=#c1#&s2=#c2#';
$r=preg_replace('/#([^#]+?)#/sUe','$G{"$1"}',$r);
http://google.com/?s1=&s2=bar
View gist:201f07cc1a100075ca44
$var = 'zee,tv,Zee Khana Khazana,Mango,Kulfi,Khana Khazana (TV Program),Sanjeev Kapoor (Chef),Khoa (Dish),Condensed Milk (Invention),Mango Purée (Ingredient),Dessert (Type Of Dish)';
$var = array_filter(array_map(function($v){$v=mb_strtolower(trim($v));return (strlen($v)>2)?$v:0;},explode(',',preg_replace('/\s\([^)]+\)/','',$var))));
Array
(
[0] => zee
[2] => zee khana khazana
[3] => mango
[4] => kulfi
[5] => khana khazana
@tobsn
tobsn / getlang.php
Created Mar 18, 2016
get http accept language short
View getlang.php
function lang($l=['en'],$u){
return $l[array_keys($l,substr(explode(',',$u?:$_ENV['HTTP_ACCEPT_LANGUAGE'])[0],0,2))[0]]?:$l[0];
}
You can’t perform that action at this time.