Skip to content

Instantly share code, notes, and snippets.

View nfreear's full-sized avatar

Nick Freear nfreear

View GitHub Profile
@paslandau
paslandau / mysql2csv
Last active February 15, 2024 16:27
Helper command to export data for an arbitrary mysql query into a CSV file.
#!/usr/bin/env php
<?php
$intro = <<<TEXT
Helper command to export data for an arbitrary mysql query into a CSV file.
Especially helpful if the use of "SELECT ... INTO OUTFILE" is not an option, e.g.
because the mysql server is running on a remote host.
Usage example:
./mysql2csv --file="/tmp/result.csv" --query='SELECT 1 as foo, 2 as bar;' --user="username" --password="password"
pages:
stage: deploy
script:
- mkdir .public
- cp -r * .public
- mkdir public
- mv .public public/.public
- cd public
- mv .public HASH_PASSWORD
- wget https://gist.githubusercontent.com/diegoos/a6414c67e5b0c9525385a556c10aa03d/raw/2a96c28318a4419aba0147ff353410b230b4f18e/index.html
@haakym
haakym / laravel-request.md
Created February 26, 2017 20:27
Laravel accessing the request object

So say you have a form like this:

<form method="POST" action="users/register">
	<input type="text" name="username">
	<button type="submit">Submit</button>
</form>

Then you want to access the request in your controller, you have a couple of methods...

@thornbill
thornbill / .gitlab-ci.yml
Created November 22, 2016 21:29
Example Node GitLab CI Yamlfile
# Official framework image. Look for the different tagged releases at:
# https://hub.docker.com/r/library/node/tags/
image: node:6
before_script:
- npm install
# This folder is cached between builds
# http://docs.gitlab.com/ce/ci/yaml/README.html#cache
cache:
@ericelliott
ericelliott / manifest.json
Created November 8, 2016 00:35
Sample manifest.json
{
"name": "My Progressive Web Application",
"short_name": "Progressive",
"start_url": "/?home=true",
"icons": [
{
"src": "/icons/icon36.png",
"sizes": "36x36",
"type": "image/png"
},
@dtomasi
dtomasi / default
Last active December 8, 2023 04:20
Brew Nginx PHP7
server {
listen 80;
server_name localhost;
root /Users/YOUR_USERNAME/Sites;
access_log /Library/Logs/default.access.log main;
location / {
include /usr/local/etc/nginx/conf.d/php-fpm;
}
@cvan
cvan / HOWTO.md
Last active March 20, 2024 17:56
How to serve a custom HTTPS domain on GitHub Pages with CloudFlare: *FREE*, secure and performant by default

Instructions

CloudFlare is an awesome reverse cache proxy and CDN that provides DNS, free HTTPS (TLS) support, best-in-class performance settings (gzip, SDCH, HTTP/2, sane Cache-Control and E-Tag headers, etc.), minification, etc.

  1. Make sure you have registered a domain name.
  2. Sign up for CloudFlare and create an account for your domain.
  3. In your domain registrar's admin panel, point the nameservers to CloudFlare's (refer to this awesome list of links for instructions for various registrars).
  4. From the CloudFlare settings for that domain, enable HTTPS/SSL and set up a Page Rule to force HTTPS redirects. (If you want to get fancy, you can also enable automatic minification for text-based assets [HTML/CSS/JS/SVG/etc.], which is a pretty cool feature if you don't want already have a build step for minification.)
  5. If you
@tony-jones
tony-jones / package.json
Last active August 27, 2023 13:48
jekyll site: asset building using npm run-scripts
{
"name": "jekyll-starter-kit",
"version": "1.0.0",
"description": "jekyll, asset build using npm scripts",
"main": "src/scripts/main.js",
"scripts": {
"eslint:dist": "eslint src/scripts/*.js",
"eslint": "npm run eslint:dist",
"uglify:dist": "uglify -s src/scripts/*.js -o dist/scripts/main.min.js",
"uglify:_site": "uglify -s src/scripts/*.js -o _site/dist/scripts/main.min.js",
Laravel Framework version 5.1.24 (LTS)
Usage:
command [options] [arguments]
Options:
-h, --help Display this help message
-q, --quiet Do not output any message
-V, --version Display this application version
--ansi Force ANSI output
@gokulkrishh
gokulkrishh / media-query.css
Last active April 23, 2024 08:01
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
/* CSS */