Skip to content

Instantly share code, notes, and snippets.

@jakebellacera
jakebellacera / ICS.php
Last active October 11, 2024 10:58
A convenient script to generate iCalendar (.ics) files on the fly in PHP.
<?php
/**
* This is free and unencumbered software released into the public domain.
*
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any
* means.
*
@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;
@ziadoz
ziadoz / awesome-php.md
Last active July 13, 2024 05:29
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active November 17, 2024 01:28
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@ljos
ljos / cocoa_keypress_monitor.py
Last active August 12, 2024 17:34
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 <[email protected]>
#
# 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
@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>
@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);
}
}
@t-io
t-io / osx_install.sh
Last active October 9, 2024 17:36
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)"
@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;
}
@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;