This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
# Some mobile browsers which look like desktop browsers. | |
RE_MOBILE = re.compile(r"(iphone|ipod|blackberry|android|palm|windows\s+ce)", re.I) | |
RE_DESKTOP = re.compile(r"(windows|linux|os\s+[x9]|solaris|bsd)", re.I) | |
RE_BOT = re.compile(r"(spider|crawl|slurp|bot)") | |
def is_desktop(user_agent): | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require("http"), | |
url = require("url"), | |
path = require("path"), | |
fs = require("fs") | |
port = process.argv[2] || 8888; | |
http.createServer(function(request, response) { | |
var uri = url.parse(request.url).pathname | |
, filename = path.join(process.cwd(), uri); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$apnsHost = 'gateway.sandbox.push.apple.com'; | |
$apnsCert = 'apns-dev.pem'; | |
$apnsPort = 2195; | |
$streamContext = stream_context_create(); | |
stream_context_set_option($streamContext, 'ssl', 'local_cert', $apnsCert); | |
$apns = stream_socket_client('ssl://' . $apnsHost . ':' . $apnsPort, $error, $errorString, 2, STREAM_CLIENT_CONNECT, $streamContext); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace CHH; | |
trait MetaObject | |
{ | |
protected static $__metaClass; | |
static function setMetaClass(MetaClass $metaClass) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
### | |
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer) | |
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos | |
### | |
# Alot of these configs have been taken from the various places | |
# on the web, most from here | |
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* I had to parse an XLSX spreadsheet (which should damn well have been a CSV!) | |
* but the usual tools were hitting the memory limit pretty quick. I found that | |
* manually parsing the XML worked pretty well. Note that this, most likely, | |
* won't work if cells contain anything more than text or a number (so formulas, | |
* graphs, etc ..., I don't know what'd happen). | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"folders": | |
[ | |
{ | |
"path": "Leanpub/sublime-productivity", | |
"folder_exclude_patterns": ["epub_images", "convert_html", "preview", "published"], | |
"file_exclude_patterns": [".gitignore", "*.sublime*", "*Icon*"] | |
}, | |
{ | |
"path": "SublimeTextTips" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* A helper file for Laravel 5, to provide autocomplete information to your IDE | |
* Generated for Laravel 5.5.13 on 2017-09-28. | |
* | |
* @author Barry vd. Heuvel <[email protected]> | |
* @see https://github.com/barryvdh/laravel-ide-helper | |
*/ | |
namespace { | |
exit("This file should not be included, only analyzed by your IDE"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
requirejs(['cordova.js'], | |
function () { | |
// start of require | |
// cordova is now available globally | |
var exec = cordova.require('cordova/exec'); | |
var app = { | |
// Application Constructor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public with sharing class ChatterUtils { | |
// makes a simple chatter text post to the specified user from the running user | |
public static void simpleTextPost(Id userId, String postText) { | |
ConnectApi.FeedType feedType = ConnectApi.FeedType.UserProfile; | |
ConnectApi.MessageBodyInput messageInput = new ConnectApi.MessageBodyInput(); | |
messageInput.messageSegments = new List<ConnectApi.MessageSegmentInput>(); | |
OlderNewer