Skip to content

Instantly share code, notes, and snippets.

View Summonshr's full-sized avatar

Suman Shrestha Summonshr

View GitHub Profile

It's time to swap out these placeholders on the new Livewire landing page. Show some love!

(Please reply with a brief testimonial, name, and twitter handle)

image

@Summonshr
Summonshr / tweet.js
Last active July 16, 2023 16:53
Tweet automatically from nodejs script using openai and oauth1.0a
const axios = require('axios');
const util = require('util');
const crypto = require('crypto');
const OAuth = require('oauth-1.0a');
const options = [
'coding',
'music',
'sherlock holmes',
'wisdom',
@calebporzio
calebporzio / time_travel_helper.php
Last active August 18, 2019 00:00
A little Laravel helper function for hijacking Carbon's "now()" inside a callback
<?php
// Helper usage:
// timeTravel(Carbon::parse('one year ago'), function () {...});
function timeTravel($target, $callback) {
Illuminate\Support\Carbon::setTestNow($target);
return tap($callback(), function () {
Illuminate\Support\Carbon::setTestNow();
<?php
namespace App\Traits;
use App\Meta;
trait HasMeta
{
public function fromMeta($key)
{
return optional($this->meta->where('key', $key)->first())->value;
@branflake2267
branflake2267 / main.dart
Last active June 22, 2022 02:41
Flutter fonts example use.
import 'package:flutter/material.dart';
const String words1 = "Almost before we knew it, we had left the ground.";
const String words2 = "A shining crescent far beneath the flying vessel.";
const String words3 = "A red flair silhouetted the jagged edge of a wing.";
const String words4 = "Mist enveloped the ship three hours out from port.";
void main() {
runApp(new MyApp());
}
[
{
"author": "Abraham Lincoln",
"quote": "Things may come to those who wait, but only the things left by those who hustle.",
"image": "http://upload.wikimedia.org/wikipedia/commons/1/1b/Abraham_Lincoln_November_1863.jpg"
},
{
"author": "Adam Smith",
"quote": "The great secret of education is to direct vanity to proper objects.",
@matula
matula / awesm.md
Last active February 19, 2024 16:23
Awesome PHP stuff in one Gist