Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am poorcoder on github.
  • I am cryptopoor (https://keybase.io/cryptopoor) on keybase.
  • I have a public key ASDJwqN1xCuUz6wuf6hkP0V9TFTIe9dIJuFAImFl8DmJRgo

To claim this, I am signing this object:

@poorcoder
poorcoder / config.json
Created February 19, 2017 02:31
Scrape Tweets with CasperJS
{"sslProtocol": "any", "cookiesFile": "biscuit", "maxDiskCacheSize": 1000, "diskCache": true}
@poorcoder
poorcoder / app.js
Created September 13, 2016 05:40 — forked from fideloper/app.js
Using Event Emitter in your node modules
var Fancy = require('FancyModule');
var mod = new Fancy();
mod.on('success', function(data) {
console.log(data); // { this_is_fancy:'indubitably' }
});
@poorcoder
poorcoder / install.sh
Created September 13, 2016 05:39 — forked from fideloper/install.sh
Vagrant Provisioning Script for PHP applications. This installs a LAMP stack.
#!/usr/bin/env bash
echo ">>> Starting Install Script"
# Update
sudo apt-get update
# Install MySQL without prompt
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password root'
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password root'
@poorcoder
poorcoder / ngxhost.sh
Created September 13, 2016 05:34 — forked from fideloper/ngxhost.sh
Vhost creation file for nginx
#!/usr/bin/env bash
if [ $EUID -ne 0 ]; then
echo "You must be root: \"sudo ngxvhost\""
exit 1
fi
# May need to run this as sudo!
# I have it in /usr/local/bin and run command 'ngxvhost' from anywhere, using sudo.
server {
# Redirect any subdomain to the root domain
# to be captured by next server block
server_name *.example.com;
return 301 $scheme://example.com$request_uri;
}
server {
root /var/www;
index index.html index.htm;
@poorcoder
poorcoder / gist:9b16b189cc157c182c7d9c4348ed1993
Created September 13, 2016 05:33 — forked from fideloper/gist:0dfb4491ffefba6766eb
nginx cache secondary php location
fastcgi_cache_path /tmp/cache levels=1:2 keys_zone=images:100m inactive=60m;
fastcgi_cache_key "$scheme$request_method$host$request_uri";
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
#root /usr/share/nginx/html;
root /var/www/html;
index index.html index.htm;
@poorcoder
poorcoder / nginx.conf
Created September 13, 2016 05:33 — forked from fideloper/nginx.conf
Nginx redirects
server {
# ...
# Redirect /book and any sub-uris
# e.g. /book/anything
# e.v. /book/whatever?maybe=a_query_too
location /book {
return 301 http://book.serversforhackers.com;
}
@poorcoder
poorcoder / gist:dd6e24ca36243a4bd17d95bb38f0d2c8
Created July 13, 2016 12:18 — forked from burkeholland/gist:7475bb40a305d9f35494
Customizing The Navigation Bar / Status Bar

As I've been learning more and more about NativeScript, one of the first tasks I really dove into was learning how to customize the Navigation Bar for an iOS app. NativeScript has a Navbar component on the roadmap, but for now, it requires some knowledge about the underlying iOS implementation of UINavigationControllers, UIViewControllers and the like.  But fear not!  I have braved the treacherous waters of StackOverflow and the Objective-C docs and emerged, victorious and unscathed.

1

In this article, I’ll go over a few of the more common tweaks that you might be needing to make to the Navigation Bar or Status Bar. While NativeScript is a cross-platform framework, these tweaks apply specifically to iOS. However, most of the items that I will

@poorcoder
poorcoder / info.plist
Created June 21, 2016 17:39 — forked from mlynch/info.plist
Disable App Transport Security in iOS 9
<!--
This disables app transport security and allows non-HTTPS requests.
Note: it is not recommended to use non-HTTPS requests for sensitive data. A better
approach is to fix the non-secure resources. However, this patch will work in a pinch.
To apply the fix in your Ionic/Cordova app, edit the file located here:
platforms/ios/MyApp/MyApp-Info.plist
And add this XML right before the end of the file inside of the last </dict> entry: