Skip to content

Instantly share code, notes, and snippets.

@taylorotwell
taylorotwell / gist:68f614deb9538f2e30108c2698266fda
Last active May 28, 2020 08:41
ADR out of the box for Brandon
<?php
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
@adamwathan
adamwathan / struct.php
Last active September 9, 2022 11:12
Structs in PHP
<?php
// Wow this whole thing is horrible
class Struct
{
public function __construct($properties)
{
foreach ($properties as $key => $value) {
if (property_exists($this, $key)) {
$this->{$key} = $value;
@mcuyar
mcuyar / terminal-logger.php
Created July 16, 2014 15:32
Send messages to logged in terminal user from your laravel application
<?php
if(! function_exists('tlog')) {
function tlog($logged, $message = '', $user = 'vagrant')
{
// Only available in test environments
if (app()->environment() === 'production') {
return;
}
@t-io
t-io / osx_install.sh
Last active October 22, 2023 13:04
Install most of my Apps with homebrew & cask
#!/bin/sh
echo Install all AppStore Apps at first!
# no solution to automate AppStore installs
read -p "Press any key to continue... " -n1 -s
echo '\n'
echo Install and Set San Francisco as System Font
ruby -e "$(curl -fsSL https://raw.github.com/wellsriley/YosemiteSanFranciscoFont/master/install)"
echo Install Homebrew, Postgres, wget and cask
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
@ircmaxell
ircmaxell / sturgeon_compat.php
Last active December 27, 2015 18:39
Sturgeon Compat
<?php
if (!function_exists('philsturgeon_said_so')) {
function philsturgeon_said_so($what) {
return 0 !== preg_match('(FIG|PSR|Pyro|Cider|doing it wrong)i', $what);
}
}
@bitdewy
bitdewy / stars.cpp
Created August 10, 2012 10:55
openGL practice - stars
#include <iostream>
#include <map>
#include <vector>
#include <boost/bind.hpp>
#include <boost/function.hpp>
#include <boost/noncopyable.hpp>
#include <boost/scoped_array.hpp>
#include <gl/glut.h>
#include <gl/SOIL.h>
@ljos
ljos / cocoa_keypress_monitor.py
Last active January 6, 2024 07:36
Showing how to listen to all keypresses in OS X through the Cocoa API using Python and PyObjC
#!/usr/bin/env python
#
# cocoa_keypress_monitor.py
# Copyright © 2016 Bjarte Johansen <Bjarte.Johansen@gmail.com>
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# “Software”), to deal in the Software without restriction, including
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 8, 2024 07:49
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@ziadoz
ziadoz / awesome-php.md
Last active April 17, 2024 21:06
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.
@attaboy
attaboy / gist:1346280
Created November 7, 2011 21:40
Destroy the localStorage copy of less.js client-side-generated CSS
// Destroys the localStorage copy of CSS that less.js creates
function destroyLessCache(pathToCss) { // e.g. '/css/' or '/stylesheets/'
if (!window.localStorage || !less || less.env !== 'development') {
return;
}
var host = window.location.host;
var protocol = window.location.protocol;
var keyPrefix = protocol + '//' + host + pathToCss;