Skip to content

Instantly share code, notes, and snippets.

View shahzeb1's full-sized avatar
🛠️
building

Shahzeb K. shahzeb1

🛠️
building
View GitHub Profile
@jed
jed / how-to-set-up-stress-free-ssl-on-os-x.md
Last active February 25, 2024 17:35
How to set up stress-free SSL on an OS X development machine

How to set up stress-free SSL on an OS X development machine

One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.

Most workflows make the following compromises:

  • Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.

  • Use production SSL certificates locally. This is annoying

@jed
jed / README.md
Last active December 27, 2015 15:09
Use U+200B to evade Twitter's DM malware flagging

Use this bookmarklet to escape the URL of the current page and evade Twitter's broken malware link flagging. It prepends all periods with a zero-width space, which Chrome, Firefox, and Safari all seem to ignore. Twitter's server won't recognize it as a link (yet), but the Twitter client will, which means it remains clickable in the DM pane.

For example: https://twitter.com/ will get flagged as malware in a DM, while https://twitter​.com/ won't. They look the same, but the latter has a ZWSP before the . in .com.

@Kartones
Kartones / postgres-cheatsheet.md
Last active May 19, 2024 17:20
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
-------Frameworks------
EmberJS
AngularJS
React
Flight
BackboneJS / UnderscoreJS <- Use lodash instead of underscore
-------Build Tools-----
@grantland
grantland / README.md
Last active January 25, 2024 23:09
NextBus API
@landonf
landonf / 0_data_prettyprint.json
Created October 19, 2014 23:00
In Yosemite, all Safari web searches are sent to not only the search engine you've selected (e.g., Google, DuckDuckGo), but *also* to Apple, even if you've disabled "Spotlight Suggestions" (System Preferences > Spotlight Suggestions, as per Apple's privacy documentation) and sharing of Usage and Diagnostics data. https://github.com/fix-macosx/yo…
[
{
"timestamp": 0,
"input": "W",
"type": "search_local",
"latency": 0
},
{
"local_results": [
"ddg_search",
anonymous
anonymous / loghn.pl
Created December 13, 2014 11:01
use HTML::FromANSI ();
open (LOG, '>>hnchatlog.html');
select((select(LOG), $|=1)[0]);
print LOG "<body bgcolor=black>\n";
while (<>) {
my $h = HTML::FromANSI->new();
print LOG $h->ansi_to_html($_), "\n";
}
/*
Meteor allows you to store functions on the server for handling things like data.
This is the server-side component to the Meteor.call() example in add-taco.js.
*/
Meteor.methods({
// Define our method. Note, we're passing an argument for the tacoToInsert value we passed to our Meteor.call() method.
'addTaco': function(tacoName){
// Here we do our insert again.
Tacos.insert({
#include <iostream>
#include "Time.h"
Time::Time()
{
} // Time()
Time::void update()
{
@imjasonh
imjasonh / markdown.css
Last active May 17, 2024 07:30
Render Markdown as unrendered Markdown (see http://jsbin.com/huwosomawo)
* {
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;
}