Skip to content

Instantly share code, notes, and snippets.

View breekoy's full-sized avatar
🏠
Working from home

Bree C. Dingding breekoy

🏠
Working from home
View GitHub Profile
#!/usr/bin/env python
import sys, os, time
import tweepy
keys = dict(
consumer_key='_YOUR_CONSUMER_KEY',
consumer_secret='_YOUR_SECRET_KEY',
access_token='_YOUR_ACCESS_TOKEN',
access_token_secret='_YOUR_ACCESS_TOKEN_SECRET'
)
@dylanmckay
dylanmckay / facebook-contact-info-summary.rb
Last active March 12, 2024 22:46
A Ruby script for collecting phone record statistics from a Facebook user data dump
#! /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
@eddmann
eddmann / start-stop-ec2-instances.js
Created November 3, 2017 14:00
Scheduled Start/Stop of EC2 Instances using Lambda and CloudWatch Events
// 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()
@kleo
kleo / backspace.md
Last active July 28, 2023 17:59
backspace

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


@doncadavona
doncadavona / Aes256CbcEncrypterApp.cs
Last active April 30, 2024 08:23
A sample C# class to encrypt and decrypt strings using the cipher AES-256-CBC used in Laravel.
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!");
@dorelljames
dorelljames / laravel-nginx-config-make-http-exception-url-and-make-all-others-https.md
Last active December 18, 2023 10:05
Laravel nginx config to redirect all requests to https and an exception URL that can still be accessible via http

Pre-condition

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.

Understanding and examples

  • Redirect everything from http to https
@n074v41l4bl34u
n074v41l4bl34u / set-dns.cmd
Created March 20, 2016 19:41
set static dns for network connection using windows console cmd script
@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 (
@andyg1
andyg1 / DatabaseSeeder.php
Created November 20, 2015 11:05
Truncating Laravel tables before seeding them
<?php
use Illuminate\Database\Seeder;
use Illuminate\Database\Eloquent\Model;
class DatabaseSeeder extends Seeder
{
protected $toTruncate = ['users'];
public function run()
@lgalaz
lgalaz / gist:aec80abd40350161ff63
Last active July 12, 2022 02:18
Server sent events with Laravel
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() {
@pongstr
pongstr / Globe4gLTE.md
Last active October 3, 2023 05:39
Access to Globe Broadband's Azatech DSL5001EN Router

Globe 4G LTE (Internet Only)

Noob access to administer your local area network and wifi access:

http://192.168.254.254

username: user
password: @l03e1t3