Skip to content

Instantly share code, notes, and snippets.

View Fraganya's full-sized avatar
💡
aspiring to inspire.

Francis Ganya Fraganya

💡
aspiring to inspire.
View GitHub Profile
import 'package:flutter/material.dart';
class ScaleFactorAppBar extends StatelessWidget {
const ScaleFactorAppBar({
this.textScaleFactor = 1,
this.textDirection = TextDirection.ltr,
this.centerTitle = false,
});
final double textScaleFactor;
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
class Destination {
const Destination(this.title, this.icon, this.color);
final String title;
final IconData icon;
final MaterialColor color;
}
@boeledi
boeledi / shared_preferences.dart
Last active January 28, 2024 22:23
Sample to show a way of using the SharedPreferences in a build
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:shared_preferences/shared_preferences.dart';
List<String> _languages = <String>['de','en','es','fr','it','nl','pt'];
class TestPage extends StatefulWidget {
@override
_TestPageState createState() => _TestPageState();
@MalloyDelacroix
MalloyDelacroix / PyQt5WindowChangeExample.py
Last active July 4, 2023 09:05
A PyQt5 example of how to switch between multiple windows.
import sys
from PyQt5 import QtCore, QtWidgets
class MainWindow(QtWidgets.QWidget):
switch_window = QtCore.pyqtSignal(str)
def __init__(self):
QtWidgets.QWidget.__init__(self)
@hauthorn
hauthorn / postman.desktop
Last active April 26, 2024 16:24
Postman desktop entry
[Desktop Entry]
Categories=Development;
Comment=Supercharge your API workflow
Exec="/home/hauthorn/Programs/Postman/Postman"
Icon=/home/hauthorn/Programs/Postman/app/resources/app/assets/icon.png
Name=Postman
Terminal=false
Type=Application
Version=1.0
@zulhfreelancer
zulhfreelancer / handbrake_cli.md
Last active March 6, 2023 21:06
How to compress video using Handbrake CLI?

Step 1

Download HandBrake CLI for your OS here.

Step 2

cd into the folder where you have the HandBrakeCLI file and run this inside it:

./HandBrakeCLI -i /path/to/input.mov -o /path/to/output.mp4 -e x264 -q 28 -r 15 -B 64 -X 1280 -O
@james2doyle
james2doyle / simple-json-reponse.php
Last active March 7, 2024 06:02
A simple JSON response function for PHP. Used in various PhileCMS plugins.
<?php
function json_response($code = 200, $message = null)
{
// clear the old headers
header_remove();
// set the actual code
http_response_code($code);
// set the header to make sure cache is forced
header("Cache-Control: no-transform,public,max-age=300,s-maxage=900");
@rxaviers
rxaviers / gist:7360908
Last active May 6, 2024 17:53
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@asugai
asugai / Install composer on Amazon AMI running on EC2
Last active March 22, 2024 03:37
Install composer on Amazon AMI running on EC2
$ cd ~
$ sudo curl -sS https://getcomposer.org/installer | sudo php
$ sudo mv composer.phar /usr/local/bin/composer
$ sudo ln -s /usr/local/bin/composer /usr/bin/composer
then you can run
$ sudo composer install
@liuerfire
liuerfire / midpoint.cpp
Created December 24, 2012 12:07
bresenham's midpoint line algorithm
#include <GL/glut.h>
void init()
{
glClearColor(0.0, 0.0, 0.0, 0.0);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluOrtho2D(0.0, 500.0, 0.0, 500.0);
}