git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
Using nginx version: nginx/1.6.2 and Laravel 5 | |
In the controller: | |
use Symfony\Component\HttpFoundation\StreamedResponse; | |
- - - - - - Some method - - - - - - - - - | |
$response = new StreamedResponse(); | |
$response->headers->set('Content-Type', 'text/event-stream'); | |
$response->headers->set('Cache-Control', 'no-cache'); | |
$response->setCallback( | |
function() { |
<?php | |
use Illuminate\Database\Seeder; | |
use Illuminate\Database\Eloquent\Model; | |
class DatabaseSeeder extends Seeder | |
{ | |
protected $toTruncate = ['users']; | |
public function run() |
@echo off | |
IF [%1] EQU [] goto noInterface | |
:: OPENDNS - OpenDNS, LLC,US | |
set DNS1=208.67.222.123 | |
:: Google DNS | |
set DNS2=8.8.4.4 | |
for /f "skip=2 tokens=1,2,3*" %%i in ('netsh int show interface') do ( |
One day in your Laravel app, you were required to redirect all http
requests to https
but need to make a certain URL route accessible via http
for a certain reason; perhaps a portion of your javascript code needs to redirect to http
URL but it can't because redirection to secure URL to insecure is prohibited. Therefore, in cases like this, you need to just allow just one URL to make an http
connection.
NOTE: There are obvious security implications here so don't just follow this blindly and understand if this is really the solution you're looking for. The nginx config can somehow be improved, I just don't have the time yet. It sure do look redundant.
http
to https
using System; | |
using System.Text; | |
using System.Security.Cryptography; | |
using System.Web.Script.Serialization; | |
using System.Collections.Generic; | |
namespace Aes256CbcEncrypterApp { | |
class MainClass { | |
public static void Main(string[] args) { | |
Console.WriteLine("Hello, world!"); |
Project moved due to excessive amount of unicorns. Repo https://git.io/adminpldt
Our community of amazing people. Managed by a cat. Backspace https://discord.gg/C43625u
Gist here will not be updated anymore Discussion here on Gist is still allowed but I strongly recommend going over to the repository or Discord chat
// Demonstration video can be found at: https://youtu.be/roAerKVfq-Y | |
// StopEC2Instance | |
const AWS = require('aws-sdk'); | |
exports.handler = (event, context, callback) => { | |
const ec2 = new AWS.EC2({ region: event.instanceRegion }); | |
ec2.stopInstances({ InstanceIds: [event.instanceId] }).promise() |
#! /usr/bin/env ruby | |
# NOTE: Requires Ruby 2.1 or greater. | |
# This script can be used to parse and dump the information from | |
# the 'html/contact_info.htm' file in a Facebook user data ZIP download. | |
# | |
# It prints all cell phone call + SMS message + MMS records, plus a summary of each. | |
# | |
# It also dumps all of the records into CSV files inside a 'CSV' folder, that is created |